[Bug 11603] New: Gather print notices: add csv and ods export
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Bug ID: 11603 Summary: Gather print notices: add csv and ods export Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@biblibre.com QA Contact: testopia@bugs.koha-community.org I completely refactored the gather_print_notices cronjob in order to allow the generation of csv and ods files. You can have a look at the wip on the BibLibre repo: http://git.biblibre.com/?p=kohac;a=shortlog;h=refs/heads/sanop/ft/MT13212 -- 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=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |jonathan.druart@biblibre.co |ity.org |m -- 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=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |10832 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |11609 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|11609 |11209 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |11678 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25021 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25021&action=edit Bug 11603: Preparation step, cleaning up This patch refactores and adds some good practices: - use Modern::Perl - use Pod::Usage - add POD -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25022 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25022&action=edit Bug 11603: Gather print notices - add a csv parameter This patch adds: - the ability to generate a csv file instead of a html file. - a letter_code parameter.
From now you are able to generate a csv file for print notices.
Imagine a template notice defined as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> You would like to generate a csv file and not a html file. Test plan: - define your OVERDUE notice for the print template as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> - define overdues rules for a patron category - check 2 items out using a due date in order to generate the overdue notices - check these 2 items in - launch the overdue_notices script - the message_queue table should now contain 2 new entries - launch the gather_print_notices cronjob with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE --letter_code=CHECKIN you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE -d=: will produce 1 csv file in your /tmp/test directory - verify the csv file is correct and contain only 1 csv header column. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25023 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25023&action=edit Bug 11603: Gather print notices - add a ods parameter This patch adds: - the ability to generate an ods file
From now you are able to generate a ods file for print notices.
You would like to generate a csv file and not a html file. Test plan: - same as previous patch but test the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=: you should get an error because csv2ods is not installed. Follow the installation instructions and try again the command. A ods file should be generated in your /tmp/test directory. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25024 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25024&action=edit Bug 11603: Refactoring A lot of code is duplicated for the 3 supported formats html, csv and ods. This patch refactores some of the code and makes it more readable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25640 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25640&action=edit Bug 11603: Fix delimiter on launching csv2ods For instance, if the delimiter is ';', quote should be put around. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 25642 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25642&action=edit Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |BLOCKED --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- This patch is blocked by bug 11679. The ods generation should be rewritten using OpenOffice::OODoc. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25021|0 |1 is obsolete| | Attachment #25022|0 |1 is obsolete| | Attachment #25023|0 |1 is obsolete| | Attachment #25024|0 |1 is obsolete| | Attachment #25640|0 |1 is obsolete| | Attachment #25642|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 30980 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30980&action=edit Bug 11603: Preparation step, cleaning up This patch refactores and adds some good practices: - use Modern::Perl - use Pod::Usage - add POD -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 30981 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30981&action=edit Bug 11603: Gather print notices - add a csv parameter This patch adds: - the ability to generate a csv file instead of a html file. - a letter_code parameter.
From now you are able to generate a csv file for print notices.
Imagine a template notice defined as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> You would like to generate a csv file and not a html file. Test plan: - define your OVERDUE notice for the print template as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> - define overdues rules for a patron category - check 2 items out using a due date in order to generate the overdue notices - check these 2 items in - launch the overdue_notices script - the message_queue table should now contain 2 new entries - launch the gather_print_notices cronjob with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE --letter_code=CHECKIN you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE -d=: will produce 1 csv file in your /tmp/test directory - verify the csv file is correct and contain only 1 csv header column. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 30982 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30982&action=edit Bug 11603: Gather print notices - add a ods parameter This patch adds: - the ability to generate an ods file
From now you are able to generate a ods file for print notices.
You would like to generate a csv file and not a html file. Test plan: - same as previous patch but test the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=: you should get an error because csv2ods is not installed. Follow the installation instructions and try again the command. A ods file should be generated in your /tmp/test directory. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 30983 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30983&action=edit Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #12 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Jonathan Druart from comment #7)
This patch is blocked by bug 11679. The ods generation should be rewritten using OpenOffice::OODoc.
Done in the last patch set. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Larry Baerveldt <larry@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=11678 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Larry Baerveldt <larry@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12810 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Blocks| |12810 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matthias.meusburger@biblibr | |e.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr --- Comment #13 from Frédéric Demians <frederic@tamil.fr> --- Thank you so much Jonathan for pushing to a better handling of print messages. Isn't there something that could be improve conceptually or from an architectural perspective? (always possible of course :-) On the one hand, there is C4::Letters module, and on the other hand process_message_queue.pl and gather_print_notices.pl using these module. Both .pl scripts are doing the same thing: gathering messages from the queue, and process them (send them, and switch there status from pending to sent or failed). For process_message_queue.pl, there is just one call to C4::Letter::SendQueuedMessages. When gather_print_notices.pl do all kind of processing, and then call C4::Letter internal function like _set_message_status. Shouldn't be logical just to merge both .pl scripts, and put all code in SendQueueMessage? SendQueueMessage interface could be extended with more parameters. For example: SendQueueMessage({ mtt => 'print', split => '0|1', dir => '/tmp', email_to => 'a@a.fr', format => 'html|csv', groupby => ['branch', 'letter'] }); -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Frédéric Demians from comment #13)
Thank you so much Jonathan for pushing to a better handling of print messages.
Isn't there something that could be improve conceptually or from an architectural perspective? (always possible of course :-)
Yes of course, and that was the idea. But as you can see, I have submitted this bug and bug 11678 1 year ago and nothing has moved yet... All should be done with small steps, and these 2 bugs are 2 steps. The idea is to have only 1 script to sent notices, I would also see misc/cronjobs/printoverdues.sh merged in it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #15 from Frédéric Demians <frederic@tamil.fr> --- It doesn't work if --letter_code parameter isn't given to the script. There is an encoding problem with html output. I get warnings about wide character and the result isn't utf8 encoded. Maybe '>:encoding(utf8)' is required. It would be nice to have a --send|--nosend, defaulted to --nosend, in order to control whether the messages status is changed from 'pending' to 'sent'. This would ease testing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #16 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 37799 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37799&action=edit Bug 11603: Fix encoding issues (bug 11944 is now pushed) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #17 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Frédéric Demians from comment #15)
It doesn't work if --letter_code parameter isn't given to the script.
What do you mean? If you use --csv or --ods, you have to provide a letter_code, otherwise generating a csv file does not have sense.
There is an encoding problem with html output. I get warnings about wide character and the result isn't utf8 encoded. Maybe '>:encoding(utf8)' is required.
Should be fixed with the last patch, please retest html, csv and ods.
It would be nice to have a --send|--nosend, defaulted to --nosend, in order to control whether the messages status is changed from 'pending' to 'sent'. This would ease testing.
Sorry but I don't plan to provide anything else than bug fixes until it's pushed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #18 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Jonathan Druart from comment #17)
It doesn't work if --letter_code parameter isn't given to the script.
What do you mean? If you use --csv or --ods, you have to provide a letter_code, otherwise generating a csv file does not have sense.
It doesn't work with --html. This produces no html file: ./gather_print_notices.pl -s --html <mydir> This works properly: ./gather_print_notices.pl -s --html <mydir> --letter_code XXX I will fix that.
Should be fixed with the last patch, please retest html, csv and ods.
It works. Thanks.
It would be nice to have a --send|--nosend, defaulted to --nosend, in order to control whether the messages status is changed from 'pending' to 'sent'. This would ease testing.
Sorry but I don't plan to provide anything else than bug fixes until it's pushed.
No demand, no offense :-) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #19 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Frédéric Demians from comment #18)
(In reply to Jonathan Druart from comment #17)
It doesn't work if --letter_code parameter isn't given to the script.
What do you mean? If you use --csv or --ods, you have to provide a letter_code, otherwise generating a csv file does not have sense.
It doesn't work with --html. This produces no html file:
./gather_print_notices.pl -s --html <mydir>
This works properly:
./gather_print_notices.pl -s --html <mydir> --letter_code XXX
I will fix that.
Ha yes, because of the "filter by letter_code" in any case :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #20 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37812 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37812&action=edit Bug 11603 Add --send|--nosend, fix stuf Fix --html without --letter_code Fix --ods which was producing a 2 lines ods file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37799|0 |1 is obsolete| | --- Comment #21 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37813 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37813&action=edit [SIGNED-OFF] Bug 11603: Fix encoding issues (bug 11944 is now pushed) Signed-off-by: Frederic Demians <f.demians@tamil.fr> No more encoding issue with html file, no problem with csv|ods -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30983|0 |1 is obsolete| | --- Comment #22 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37814 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37814&action=edit [SIGNED-OFF] Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30982|0 |1 is obsolete| | --- Comment #23 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37815 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37815&action=edit [SIGNED-OFF] Bug 11603: Gather print notices - add a ods parameter This patch adds: - the ability to generate an ods file
From now you are able to generate a ods file for print notices.
You would like to generate a csv file and not a html file. Test plan: - same as previous patch but test the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=: you should get an error because csv2ods is not installed. Follow the installation instructions and try again the command. A ods file should be generated in your /tmp/test directory. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30981|0 |1 is obsolete| | --- Comment #24 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37816 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37816&action=edit [SIGNED-OFF] Bug 11603: Gather print notices - add a csv parameter This patch adds: - the ability to generate a csv file instead of a html file. - a letter_code parameter.
From now you are able to generate a csv file for print notices.
Imagine a template notice defined as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> You would like to generate a csv file and not a html file. Test plan: - define your OVERDUE notice for the print template as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> - define overdues rules for a patron category - check 2 items out using a due date in order to generate the overdue notices - check these 2 items in - launch the overdue_notices script - the message_queue table should now contain 2 new entries - launch the gather_print_notices cronjob with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE --letter_code=CHECKIN you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE -d=: will produce 1 csv file in your /tmp/test directory - verify the csv file is correct and contain only 1 csv header column. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30980|0 |1 is obsolete| | --- Comment #25 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37817 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37817&action=edit [SIGNED-OFF] Bug 11603: Preparation step, cleaning up This patch refactores and adds some good practices: - use Modern::Perl - use Pod::Usage - add POD Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #26 from Frédéric Demians <frederic@tamil.fr> --- For me, it functional, well documented, and add a way to do something worthwhile with 'print' notifications. I've tested all script options with success producing usable HTML, CSV, and OOffice files. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #27 from Jonathan Druart <jonathan.druart@biblibre.com> --- Thanks Frédéric. There is something wrong the the patches order. I don't know how you did that but they are in the wrong order :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37817|0 |1 is obsolete| | --- Comment #28 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37829 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37829&action=edit [SIGNED-OFF] Bug 11603: Preparation step, cleaning up This patch refactores and adds some good practices: - use Modern::Perl - use Pod::Usage - add POD Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37816|0 |1 is obsolete| | --- Comment #29 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37830 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37830&action=edit [SIGNED-OFF] Bug 11603: Gather print notices - add a csv parameter This patch adds: - the ability to generate a csv file instead of a html file. - a letter_code parameter.
From now you are able to generate a csv file for print notices.
Imagine a template notice defined as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> You would like to generate a csv file and not a html file. Test plan: - define your OVERDUE notice for the print template as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> - define overdues rules for a patron category - check 2 items out using a due date in order to generate the overdue notices - check these 2 items in - launch the overdue_notices script - the message_queue table should now contain 2 new entries - launch the gather_print_notices cronjob with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE --letter_code=CHECKIN you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE -d=: will produce 1 csv file in your /tmp/test directory - verify the csv file is correct and contain only 1 csv header column. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37815|0 |1 is obsolete| | --- Comment #30 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37831 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37831&action=edit [SIGNED-OFF] Bug 11603: Gather print notices - add a ods parameter This patch adds: - the ability to generate an ods file
From now you are able to generate a ods file for print notices.
You would like to generate a csv file and not a html file. Test plan: - same as previous patch but test the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=: you should get an error because csv2ods is not installed. Follow the installation instructions and try again the command. A ods file should be generated in your /tmp/test directory. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37814|0 |1 is obsolete| | --- Comment #31 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37832 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37832&action=edit [SIGNED-OFF] Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37813|0 |1 is obsolete| | --- Comment #32 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37833 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37833&action=edit [SIGNED-OFF] Bug 11603: Fix encoding issues (bug 11944 is now pushed) Signed-off-by: Frederic Demians <f.demians@tamil.fr> No more encoding issue with html file, no problem with csv|ods -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37812|0 |1 is obsolete| | --- Comment #33 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37834 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37834&action=edit Bug 11603 Add --send|--nosend, fix stuf Fix --html without --letter_code Fix --ods which was producing a 2 lines ods file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #34 from Frédéric Demians <frederic@tamil.fr> --- (In reply to Jonathan Druart from comment #27)
Thanks Frédéric. There is something wrong the the patches order. I don't know how you did that but they are in the wrong order :)
Sorry. I git bz on me. I verified that it's fixed now. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #35 from Frédéric Demians <frederic@tamil.fr> --- Created attachment 37837 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37837&action=edit Bug 11678: Gather print notices: add --email parameter This patch add the ability to send generated files by email. You can specify several emails. Test plan: - same as Bug 11603 - call the script misc/cronjobs/gather_print_notices.pl with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --ods --html --letter_code=CHECKIN -d=: --email="email_one@example.org" --email="email_two@example.org" Signed-off-by: Frederic Demians <f.demians@tamil.fr> - Works as desribed. Rebased upon bug-11603. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37837|0 |1 is obsolete| | --- Comment #36 from Frédéric Demians <frederic@tamil.fr> --- Comment on attachment 37837 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37837 Bug 11678: Gather print notices: add --email parameter Wrong patch attachment! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #37 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38381 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38381&action=edit Bug 11603: Some minor documentation changes -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #38 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I like this! (But need a bit more time to play with it :( ) Some first notes from reading the docs (yay!) and code: 1) I see there are 2 copyright statements and licenses, one at the top and one at the bottom. Should this be cleaned up? 2) Is this statement about the file name still true? The generated filename will be holdnotices-TODAY.[csv|html|ods] or holdnotices-TODAY-BRANCHCODE.[csv|html|ods] if the --split parameter is given. 3) I have attached some suggestions for the documentation - please take a look and obsolete if you don't agree :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #39 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38385 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38385&action=edit Bug 11603: Preparation step, cleaning up This patch refactores and adds some good practices: - use Modern::Perl - use Pod::Usage - add POD Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #40 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38386 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38386&action=edit Bug 11603: Gather print notices - add a csv parameter This patch adds: - the ability to generate a csv file instead of a html file. - a letter_code parameter.
From now you are able to generate a csv file for print notices.
Imagine a template notice defined as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> You would like to generate a csv file and not a html file. Test plan: - define your OVERDUE notice for the print template as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> - define overdues rules for a patron category - check 2 items out using a due date in order to generate the overdue notices - check these 2 items in - launch the overdue_notices script - the message_queue table should now contain 2 new entries - launch the gather_print_notices cronjob with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE --letter_code=CHECKIN you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE -d=: will produce 1 csv file in your /tmp/test directory - verify the csv file is correct and contain only 1 csv header column. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #41 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38387 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38387&action=edit Bug 11603: Gather print notices - add a ods parameter This patch adds: - the ability to generate an ods file
From now you are able to generate a ods file for print notices.
You would like to generate a csv file and not a html file. Test plan: - same as previous patch but test the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=: you should get an error because csv2ods is not installed. Follow the installation instructions and try again the command. A ods file should be generated in your /tmp/test directory. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #42 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38388 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38388&action=edit Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. Signed-off-by: Frederic Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #43 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38389 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38389&action=edit Bug 11603: Fix encoding issues (bug 11944 is now pushed) Signed-off-by: Frederic Demians <f.demians@tamil.fr> No more encoding issue with html file, no problem with csv|ods -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37834|0 |1 is obsolete| | --- Comment #44 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38390 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38390&action=edit Bug 11603 Add --send|--nosend, fix stuf Fix --html without --letter_code Fix --ods which was producing a 2 lines ods file -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38381|0 |1 is obsolete| | --- Comment #45 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38391 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38391&action=edit Bug 11603: Some minor documentation changes Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #46 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38392 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38392&action=edit Bug 11603: (follow-up) pod The filenames will change -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37829|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=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37830|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=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37831|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=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37832|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=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #37833|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=11603 --- Comment #47 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Katrin Fischer from comment #38)
I like this! (But need a bit more time to play with it :( )
Some first notes from reading the docs (yay!) and code:
1) I see there are 2 copyright statements and licenses, one at the top and one at the bottom. Should this be cleaned up?
It depends on how you have fixed the first conflict :)
2) Is this statement about the file name still true? The generated filename will be holdnotices-TODAY.[csv|html|ods] or holdnotices-TODAY-BRANCHCODE.[csv|html|ods] if the --split parameter is given.
Fixed
3) I have attached some suggestions for the documentation - please take a look and obsolete if you don't agree :)
Ok for me, thanks! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #48 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 1) Regression test Change of the file name when no options specified but the directory: From: holdnotices-<date>.html ToL notices_hold-<date>.html As by default all notices (including overdues) are in the file, maybe we could rename it to be more general just: notices_<date>.html? (trivial) 2) -s splits by branch The output is identical. 3) --nosend works - helpful in testing! 4) --letter_code generates a nicely named file with only those notices! 5) --ods creates a warn: Use of uninitialized value in lc at /usr/share/perl5/OpenOffice/OODoc/File.pm line 378. 6) --csv This one is giving me some trouble: First I thought it was the concatenation: cardnumber:patron:email:item 1:Koha <borrowers.surname>>:patron@localhost: But this is also not giving all data: cardnumber:patron:patron:email:item 1:Koha:<borrowers.surname>>:patron@localhost: Barcode and surname are missing, but set in the database. We are pretty close here - it's a great enhancement. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #49 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38403 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38403&action=edit Bug 11603: Change the output filenames The output filename is notices_all_<date>.[html|csv|ods] if no letter_code parameter is given. If 1 is given: notices_<letter_code>_<date>.[html|csv|ods] If 1+ are given: noties_<letter_code1>_..._<letter_codeN>_<date>.[html|csv|ods] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #50 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #48)
1) File names make sense now.
6) --csv This one is giving me some trouble:
This is solved, I had an error in my thinking about the template - using <<items.barcode>> in ODUE doesn't work without <item></item>. The remaining problem is now with the ods export, working on it with Joubu:
5) --ods creates a warn: Use of uninitialized value in lc at /usr/share/perl5/OpenOffice/OODoc/File.pm line 378.
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA 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=11603 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38385|0 |1 is obsolete| | Attachment #38386|0 |1 is obsolete| | Attachment #38387|0 |1 is obsolete| | Attachment #38388|0 |1 is obsolete| | Attachment #38389|0 |1 is obsolete| | Attachment #38390|0 |1 is obsolete| | Attachment #38391|0 |1 is obsolete| | Attachment #38392|0 |1 is obsolete| | Attachment #38403|0 |1 is obsolete| | --- Comment #51 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38411 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38411&action=edit [PASED QA] Bug 11603: Preparation step, cleaning up This patch refactores and adds some good practices: - use Modern::Perl - use Pod::Usage - add POD Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #52 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38412 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38412&action=edit [PASSED QA] Bug 11603: Gather print notices - add a csv parameter This patch adds: - the ability to generate a csv file instead of a html file. - a letter_code parameter.
From now you are able to generate a csv file for print notices.
Imagine a template notice defined as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> You would like to generate a csv file and not a html file. Test plan: - define your ODUE notice for the print template as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <<borrowers.surname>>:<<borrowers.email>>:<item><<items.barcode>></item> - define overdues rules for a patron category - check 2 items out using a due date in order to generate the overdue notices - check these 2 items in - launch the overdue_notices script - the message_queue table should now contain 2 new entries - launch the gather_print_notices cronjob with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE --letter_code=CHECKIN you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE -d=: will produce 1 csv file in your /tmp/test directory - verify the csv file is correct and contain only 1 csv header column. Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> QA note: Keep in mind that you can use all placeholders for the csv that you can use for the normal templates. If you normally get the item information from <item></item> you need to use that. If you can use <<item.barcode>> directly, you can also do so in the csv. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #53 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38413 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38413&action=edit [PASSED QA] Bug 11603: Gather print notices - add a ods parameter This patch adds: - the ability to generate an ods file
From now you are able to generate a ods file for print notices.
You would like to generate a csv file and not a html file. Test plan: - same as previous patch but test the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=: you should get an error because csv2ods is not installed. Follow the installation instructions and try again the command. A ods file should be generated in your /tmp/test directory. Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #54 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38414 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38414&action=edit [PASSED QA] Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #55 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38415 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38415&action=edit [PASSED QA] Bug 11603: Fix encoding issues (bug 11944 is now pushed) Signed-off-by: Frederic Demians <f.demians@tamil.fr> No more encoding issue with html file, no problem with csv|ods Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #56 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38416 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38416&action=edit [PASSED QA] Bug 11603 Add --send|--nosend, fix stuf Fix --html without --letter_code Fix --ods which was producing a 2 lines ods file Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #57 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38417 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38417&action=edit Bug 11603: Some minor documentation changes Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #58 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38418 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38418&action=edit [PASSED QA] Bug 11603: (follow-up) pod The filenames will change Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #59 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 38419 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38419&action=edit [PASSED QA] Bug 11603: Change the output filenames The output filename is notices_all_<date>.[html|csv|ods] if no letter_code parameter is given. If 1 is given: notices_<letter_code>_<date>.[html|csv|ods] If 1+ are given: noties_<letter_code1>_..._<letter_codeN>_<date>.[html|csv|ods] Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #60 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The warn only appeared on my system, but the file was still created. For me this is not a blocker currently. This patch is a big improvement over the existing script, while I couldn't detect any regressions. It adds useful options. The file name changes slightly, but this is a fix to a bug - the file doesn't only include holds messages nowadays and hasn't for quite a while. The file name properly reflects that now. (bug 12810) There seem to be some issues in our way to enqueue messages and in determining the mtt = print - but they are outside the scope of this script, that just deals with the results of the processes done before. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply CC| |tomascohen@gmail.com --- Comment #61 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Can someone rebase this one ASAP? I'm sorry... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38411|0 |1 is obsolete| | Attachment #38412|0 |1 is obsolete| | Attachment #38413|0 |1 is obsolete| | Attachment #38414|0 |1 is obsolete| | Attachment #38415|0 |1 is obsolete| | Attachment #38416|0 |1 is obsolete| | Attachment #38417|0 |1 is obsolete| | Attachment #38418|0 |1 is obsolete| | Attachment #38419|0 |1 is obsolete| | --- Comment #62 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39033 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39033&action=edit Bug 11603: Preparation step, cleaning up This patch refactores and adds some good practices: - use Modern::Perl - use Pod::Usage - add POD Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #63 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39034 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39034&action=edit Bug 11603: Gather print notices - add a csv parameter This patch adds: - the ability to generate a csv file instead of a html file. - a letter_code parameter.
From now you are able to generate a csv file for print notices.
Imagine a template notice defined as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <borrowers.surname>>:<<borrowers.email>>:<<items.barcode>> You would like to generate a csv file and not a html file. Test plan: - define your ODUE notice for the print template as: cardnumber:patron:email:item <<borrowers.cardnumber>>:<<borrowers.firstname>> <<borrowers.surname>>:<<borrowers.email>>:<item><<items.barcode>></item> - define overdues rules for a patron category - check 2 items out using a due date in order to generate the overdue notices - check these 2 items in - launch the overdue_notices script - the message_queue table should now contain 2 new entries - launch the gather_print_notices cronjob with the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE --letter_code=CHECKIN you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv you should get an error perl misc/cronjobs/gather_print_notices.pl /tmp/test --csv --letter_code=OVERDUE -d=: will produce 1 csv file in your /tmp/test directory - verify the csv file is correct and contain only 1 csv header column. Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> QA note: Keep in mind that you can use all placeholders for the csv that you can use for the normal templates. If you normally get the item information from <item></item> you need to use that. If you can use <<item.barcode>> directly, you can also do so in the csv. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #64 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39035 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39035&action=edit Bug 11603: Gather print notices - add a ods parameter This patch adds: - the ability to generate an ods file
From now you are able to generate a ods file for print notices.
You would like to generate a csv file and not a html file. Test plan: - same as previous patch but test the following parameters: perl misc/cronjobs/gather_print_notices.pl /tmp/test --ods --letter_code=OVERDUE -d=: you should get an error because csv2ods is not installed. Follow the installation instructions and try again the command. A ods file should be generated in your /tmp/test directory. Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #65 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39036 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39036&action=edit Bug 11603: If a letter code is given, filenames should contain it If you choose to generate print notices for a specific letter code, the generated files should be distinct. The use case is: you want to process print notice for letter codes: overdue1, overdue2 and overdue3. The cronjobs will be: perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue1 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue2 --csv --ods --html --delimiter=";" perl misc/cronjobs/gather_print_notices.pl /tmp --letter_code=overdue3 --csv --ods --html --delimiter=";" without this patch, the 2 first files will be erased. Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #66 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39037 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39037&action=edit Bug 11603: Fix encoding issues (bug 11944 is now pushed) Signed-off-by: Frederic Demians <f.demians@tamil.fr> No more encoding issue with html file, no problem with csv|ods Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #67 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39038 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39038&action=edit Bug 11603 Add --send|--nosend, fix stuf Fix --html without --letter_code Fix --ods which was producing a 2 lines ods file Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #68 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39039 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39039&action=edit Bug 11603: Some minor documentation changes Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #69 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39040 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39040&action=edit Bug 11603: (follow-up) pod The filenames will change Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 --- Comment #70 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 39041 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39041&action=edit Bug 11603: Change the output filenames The output filename is notices_all_<date>.[html|csv|ods] if no letter_code parameter is given. If 1 is given: notices_<letter_code>_<date>.[html|csv|ods] If 1+ are given: noties_<letter_code1>_..._<letter_codeN>_<date>.[html|csv|ods] Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #71 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Good job Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11603 Michael Kuhn <mik@adminkuhn.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mik@adminkuhn.ch -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org