[Bug 8612] New: System preference to have custom fields in exort csv basket
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Priority: P5 - low Change sponsored?: Sponsored Bug ID: 8612 Assignee: koha-bugs@lists.koha-community.org Summary: System preference to have custom fields in exort csv basket Severity: enhancement Classification: Unclassified OS: All Reporter: pelletiermaxime@gmail.com Hardware: All Status: NEW Version: master Component: Acquisitions Product: Koha New system preference where you can write the fields you want to have in the "Export this basket as CSV" button in a basket page of the acquisition module. This could be done in better ways, but this is what I came up with, in the time I had. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #1 from Maxime Pelletier <pelletiermaxime@gmail.com> --- Created attachment 11514 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=11514&action=edit patch that adds new syspref and uses it -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Maxime Pelletier <pelletiermaxime@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |pelletiermaxime@gmail.com |ity.org | --- Comment #2 from Maxime Pelletier <pelletiermaxime@gmail.com> --- This needs to be completly redone because the basket csv export is now in a template. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Mike <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Maxime, maybe you could consider doing this similar to the new option for exporting late serial issues, where the export format is defined as a CSV profile. This could also allow to have multiple formats instead of only one (see bug 10654) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simith.doliveira@inlibro.co | |m Assignee|pelletiermaxime@gmail.com |simith.doliveira@inlibro.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.begin@inLibro.com, | |francois.charbonnier@inlibr | |o.com, | |philippe.blouin@inlibro.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10854 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Just a quick update: you can use CSV profiles now to define the export format for late serials - it would be nice if this could work similarly, so we don't add too many different ways of how to configure the CSV exports. (bug 10854) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #5 from simith.doliveira@inlibro.com --- Created attachment 36860 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36860&action=edit Bug 8612 - System preference to have custom fields in exort csv basket This patch allows the user use a CSV export profile to create the fields to export the basket as CSV in a basket page. To test: I - Apply the patch; II - Create a CSV export profile - type sql - Home › Tools › CSV export profiles ex: biblionumber=biblio.biblionumber|auteur=biblio.author|titre=biblio.title|date=biblioitems.copyrightdate|editeur=biblioitems.publishercode|isbn=biblioitems.isbn|quantite=aqorders.quantity|prix=aqorders.rrp|panier=aqorders.basketno III - Create a new basket and add an order to the basket IV - Validate: the text "Select CSV profile:" and a dropdown V - Select the CSV export profile created VI - Validate: the CSV file. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #11514|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|System preference to have |CSV export profile to have |custom fields in exort csv |custom fields in exort csv |basket |basket -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 simith.doliveira@inlibro.com changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|CSV export profile to have |CSV export profile to have |custom fields in exort csv |custom fields in export csv |basket |basket -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #6 from Blou <philippe.blouin@inlibro.com> --- Created attachment 37289 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37289&action=edit Bug 8612 - System preference to have custom fields in export csv basket This patch allows the user use a CSV export profile to create the fields to export the basket as CSV in a basket page. To test: 1) Apply the patch; 2) Create a CSV export profile - type sql - Home › Tools › CSV export profiles ex: biblionumber=biblio.biblionumber|auteur=biblio.author|titre=biblio.title|date=biblioitems.copyrightdate|editeur=biblioitems.publishercode|isbn=biblioitems.isbn|quantite=aqorders.quantity|prix=aqorders.rrp|panier=aqorders.basketno 3) Create a new basket and add an order to the basket 4) Validate: the text "Select CSV profile:" and a dropdown in the basket view 5) In the new dropdown, select the CSV export profile created 6) Validate the CSV file. 7) Do the same validation with a closed basket. a) close the basket b) View the basket c) validate that there is a dropdown d) test it with an export -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36860|0 |1 is obsolete| | --- Comment #7 from Blou <philippe.blouin@inlibro.com> --- Comment on attachment 36860 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36860 Bug 8612 - System preference to have custom fields in exort csv basket The left panel was removed by this patch, and it when used on a closed basket it caused a crash. These are fixed by the latest version. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #8 from Mike <black23@gmail.com> --- Hello Biou, thanks for this pattch. I tested it in sandbox but get some messs with some character for example "í". But not for all characters in natioanl alphabet. We need more tests. I confirm that patch works with open or close basket. Mike -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #9 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 37293 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37293&action=edit [SIGNED-OFF] Bug 8612 - System preference to have custom fields in export csv basket This patch allows the user use a CSV export profile to create the fields to export the basket as CSV in a basket page. To test: 1) Apply the patch; 2) Create a CSV export profile - type sql - Home › Tools › CSV export profiles ex: biblionumber=biblio.biblionumber|auteur=biblio.author|titre=biblio.title|date=biblioitems.copyrightdate|editeur=biblioitems.publishercode|isbn=biblioitems.isbn|quantite=aqorders.quantity|prix=aqorders.rrp|panier=aqorders.basketno 3) Create a new basket and add an order to the basket 4) Validate: the text "Select CSV profile:" and a dropdown in the basket view 5) In the new dropdown, select the CSV export profile created 6) Validate the CSV file. 7) Do the same validation with a closed basket. a) close the basket b) View the basket c) validate that there is a dropdown d) test it with an export Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Works as expected for me -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37289|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #10 from Josef Moravec <josef.moravec@gmail.com> --- *** Bug 10654 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|simith.doliveira@inlibro.co |philippe.blouin@inlibro.com |m | CC| |jonathan.druart@biblibre.co | |m QA Contact| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- Comment on attachment 37293 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37293 [SIGNED-OFF] Bug 8612 - System preference to have custom fields in export csv basket Review of attachment 37293: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=8612&attachment=37293) ----------------------------------------------------------------- ::: acqui/basket.pl @@ +197,5 @@
-type => 'text/csv', -attachment => 'basket' . $basket->{'basketno'} . '.csv', ); + if ( $query->param('csv_profile') eq 'default'){ + print GetBasketAsCSV($query->param('basketno'), $query);
Actually this subroutine should take the csv profile in parameter, don't you think? @@ +531,4 @@
return \%line; }
+sub get_basket_DB_info{
Don't you have something in the module to do that? (I didn't check). In all cases, you cannot add it here in the pl. Yes that means tests. ::: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ +190,5 @@
[% END %] + <div class="btn-group"> + <fieldset class="action"> + <label for="csv_code">Select CSV profile:</label> + <select id="csv_profile_for_export">
This block is c/p twice, should be in a TT BLOCK. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Blou <philippe.blouin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|philippe.blouin@inlibro.com |maxime.beaulieu@inlibro.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |remi.mayrand-provencher@inL | |ibro.com --- Comment #12 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Hi Jonathan,
::: acqui/basket.pl @@ +197,5 @@
-type => 'text/csv', -attachment => 'basket' . $basket->{'basketno'} . '.csv', ); + if ( $query->param('csv_profile') eq 'default'){ + print GetBasketAsCSV($query->param('basketno'), $query);
Actually this subroutine should take the csv profile in parameter, don't you think?
Could you be more specific about what are the changes you would like to see here? Thank you, (In reply to Jonathan Druart from comment #11)
Comment on attachment 37293 [details] [review] [SIGNED-OFF] Bug 8612 - System preference to have custom fields in export csv basket
Review of attachment 37293 [details] [review]: -----------------------------------------------------------------
::: acqui/basket.pl @@ +197,5 @@
-type => 'text/csv', -attachment => 'basket' . $basket->{'basketno'} . '.csv', ); + if ( $query->param('csv_profile') eq 'default'){ + print GetBasketAsCSV($query->param('basketno'), $query);
Actually this subroutine should take the csv profile in parameter, don't you think?
@@ +531,4 @@
return \%line; }
+sub get_basket_DB_info{
Don't you have something in the module to do that? (I didn't check). In all cases, you cannot add it here in the pl. Yes that means tests.
::: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ +190,5 @@
[% END %] + <div class="btn-group"> + <fieldset class="action"> + <label for="csv_code">Select CSV profile:</label> + <select id="csv_profile_for_export">
This block is c/p twice, should be in a TT BLOCK.
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #13 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 41224 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41224&action=edit Bug 8612 - Cleans basket.tt by using TT blocks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41224|0 |1 is obsolete| | --- Comment #14 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 41225 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41225&action=edit Bug 8612 - Cleans basket.tt by using TT blocks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #15 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 41226 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41226&action=edit Bug 8612 - System preference to have custom fields in export csv basket This patch allows the user use a CSV export profile to create the fields to export the basket as CSV in a basket page. To test: 1) Apply the patch; 2) Create a CSV export profile - type sql - Home › Tools › CSV export profiles ex: biblionumber=biblio.biblionumber|auteur=biblio.author|titre=biblio.title|date=biblioitems.copyrightdate|editeur=biblioitems.publishercode|isbn=biblioitems.isbn|quantite=aqorders.quantity|prix=aqorders.rrp|panier=aqorders.basketno 3) Create a new basket and add an order to the basket 4) Validate: the text "Select CSV profile:" and a dropdown in the basket view 5) In the new dropdown, select the CSV export profile created 6) Validate the CSV file. 7) Do the same validation with a closed basket. a) close the basket b) View the basket c) validate that there is a dropdown d) test it with an export Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Works as expected for me -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37293|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41225|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #16 from Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> --- Created attachment 41227 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41227&action=edit Bug 8612 - Cleans basket.tt by using TT blocks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Rémi Mayrand-Provencher <remi.mayrand-provencher@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Rémi Mayrand-Provencher from comment #12)
Hi Jonathan,
::: acqui/basket.pl @@ +197,5 @@
-type => 'text/csv', -attachment => 'basket' . $basket->{'basketno'} . '.csv', ); + if ( $query->param('csv_profile') eq 'default'){ + print GetBasketAsCSV($query->param('basketno'), $query);
Actually this subroutine should take the csv profile in parameter, don't you think?
Could you be more specific about what are the changes you would like to see here?
You added 2 subroutines to the script acqui/basket.pl to build a CSV file. But the subroutine GetBasketAsCSV already does it. I think you should modify this subroutine to do what you want to do: export a basket as CSV given a specific CSV profile. The call would be: my $csv = GetBasketAsCSV($basketno, $query, $csv_profile_id); Yes, it's a little bit more work, but more robust and reusable :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Genevieve Plantin <genevieve.plantin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41226|0 |1 is obsolete| | --- Comment #18 from Genevieve Plantin <genevieve.plantin@inlibro.com> --- Created attachment 42532 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42532&action=edit Bug 8612 - System preference to have custom fields in export csv basket This patch allows the user use a CSV export profile to create the fields to export the basket as CSV in a basket page. To test: 1) Apply the patch; 2) Create a CSV export profile - type sql - Home › Tools › CSV export profiles ex: biblionumber=biblio.biblionumber|auteur=biblio.author|titre=biblio.title|date=biblioitems.copyrightdate|editeur=biblioitems.publishercode|isbn=biblioitems.isbn|quantite=aqorders.quantity|prix=aqorders.rrp|panier=aqorders.basketno 3) Create a new basket and add an order to the basket 4) Validate: the text "Select CSV profile:" and a dropdown in the basket view 5) In the new dropdown, select the CSV export profile created 6) Validate the CSV file. 7) Do the same validation with a closed basket. a) close the basket b) View the basket c) validate that there is a dropdown d) test it with an export Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Works as expected for me -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Genevieve Plantin <genevieve.plantin@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41227|0 |1 is obsolete| | --- Comment #19 from Genevieve Plantin <genevieve.plantin@inlibro.com> --- Created attachment 42533 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42533&action=edit Bug 8612 - Cleans basket.tt by using TT blocks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 --- Comment #20 from Genevieve Plantin <genevieve.plantin@inlibro.com> --- Created attachment 42534 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42534&action=edit Bug 8612 - Clean basket.pl getting rid of subroutines with sql query and use GetBasketAsCSV instead GetBasketAsCSV now has a new argument the profile_csv_id, when this param is defined, it loads the profile_content, searches the value of the predefined fields and assembles the data to create the output of the csv file. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8612 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #21 from Josef Moravec <josef.moravec@gmail.com> --- Could you please rebase and change the icon to Font Awesome icon? See http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13696 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org