This patch removes C4::Dates from following files:
- misc/cronjobs/batch_anonymise.pl
- misc/cronjobs/cleanup_database.pl
- misc/cronjobs/gather_print_notices.pl
- misc/cronjobs/serialsUpdate.pl
- misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl
- misc/cronjobs/overdue_notices.pl
- misc/cronjobs/staticfines.pl
To test:
- Carefully review code changes.
- Verify that the cronjobs behave as before.
Amended to make patch apply and follwoing comments on IRC by putti
http://irc.koha-community.org/koha/2015-11-06#i_1752803
(misc/cronjobs/gather_print_notices.pl is using still C4::Dates, line 84)
6.11.2015 /mv
Signed-off-by: Zeno Tajoli <z.tajoli@cineca.it>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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.
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This patch adds information about cron jobs performed and make it viewable
under Home > Tools > Logs ("Browse system logs")
To test:
Apply patch
- Got to system preferences and set 'CronjobLog' to: [Log] information from
cron jobs.
- Run some cron jobs
- Go to Home > Tools > Logs
- Verify that you have a selection 'Cron jobs' in drop-down 'Module'. Select it
with Action "All" and Submit.
- Output should show Date/time and info about Cron jobs
Rebased to work on top of Bug 6911 (conflict in viewlog.tt) /MV
Rebased after applying patch for Bug 6911 /MV
Conflicts resolved:
misc/cronjobs/overdue_notices.pl
misc/cronjobs/cleanup_database.pl
Signed-off-by: Frederic Demians <f.demians@tamil.fr>
- Merge both patches, and fix updatedatabase.pl
- Works as described. Provide intersting feedback from cronjob scripts.
--
Modified version taking in account syspref CronJobLog. Handling simplified by introducing a convenience sub cronlogaction in C4/Log.pm /MV
Amended to take in account comments #11, #12, #13 /MV
http://bugs.koha-community.org/show_bug.cgi?id=13899
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Chris Nighswonger <cnighswonger@foundations.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
http://bugs.koha-community.org/show_bug.cgi?id=9987
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Since we switched to Template Toolkit we don't need to stick with the
sufix we used for HTML::Template::Pro.
This patch changes the occurences of '.tmpl' in favour of '.tt'.
To test:
- Apply the patch
- Install koha, and verify that every page can be accesed
Regards
To+
P.S. a followup will remove the glue code.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Problem:
If you tell gather_print_notices.pl to write output to a location
you do not have write access to, it will silently fail to write the
data, but still mark unsent messages as sent.
Solution:
This patch adds two lines of defense:
1. Check that the location given for the output is writable
2. use "open() or die" instead of just "open()" when writing the
output
The first measure should catch most of the potential errors, but
I guess a directory can be writable, but the open() still can fail
because the disk is full or something similar.
To test:
- Make sure you have some unsent messages in the message_queue table,
that do not have an email adress
- Apply the patch
- Run the script, pointing at a location you do not have access to
write to. Check that the script exits with an appropriate error
message, and that the unsent messages are still unsent. Do this
both with and without the -s option.
- To fake passing the first line of defence, comment out line 62
and put this in instead:
if ( !$output_directory || !-d $output_directory ) {
- Run the script again as above, check you get an appropriate
error and that the message queue is not touched
- Reset line 62 to how it was
- Run the script against a directory you do have access to write to
and check that output is produced as expected and that messages
are marked as sent
- Sign off
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Works as described.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This patch replaces carriage return with <br /> in the content of
hold notices for printing. This is necessary to convert html file
into well formatted pdf file.
Test plan :
- check in an item reserved by a borrower
that has not activated email notification
- verify in message_queue table that you've got a
new HOLD_PRINT notice with status 'pending'
- run gather_print_notices.pl <directory>
Without the patch, the script generates a html file without <br /> tags.
If you run printoverdues.sh <directory>, the text in the resulting PDF
file is all on one line
With the patch, the script generates a html file with <br/> tags and
the PDF file created by printoverdues.sh is well formatted.
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
$OUTPUT being used but not being declared.
When trying to run this script I gat a nasty:
15:42 ~/koha.dev/koha-community (new/bug_8063 $%)$ ./misc/cronjobs/gather_print_notices.pl
Global symbol "$OUTPUT" requires explicit package name at ./misc/cronjobs/gather_print_notices.pl line 81.
Global symbol "$OUTPUT" requires explicit package name at ./misc/cronjobs/gather_print_notices.pl line 95.
Global symbol "$OUTPUT" requires explicit package name at ./misc/cronjobs/gather_print_notices.pl line 102.
Global symbol "$OUTPUT" requires explicit package name at ./misc/cronjobs/gather_print_notices.pl line 106.
Global symbol "$OUTPUT" requires explicit package name at ./misc/cronjobs/gather_print_notices.pl line 120.
Global symbol "$OUTPUT" requires explicit package name at ./misc/cronjobs/gather_print_notices.pl line 127.
Execution of ./misc/cronjobs/gather_print_notices.pl aborted due to compilation errors.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Before the patch:
$perl -wc ./misc/cronjobs/gather_print_notices.pl
Global symbol "$OUTPUT" requires explicit package name at
[...]./misc/cronjobs/gather_print_notices.pl line 81.
./misc/cronjobs/gather_print_notices.pl had compilation errors.
With this patch:
$perl -wc ./misc/cronjobs/gather_print_notices.pl
./misc/cronjobs/gather_print_notices.pl syntax OK
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Adds the option -s/--split to enable notices to be separated
into different files by borrower home library.
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Branches can have their own version of notices - added branchcode to
letter table.
Support html notices - added is_html to letter table.
Support for borrower attributes in templates.
GetPreparedletter() is the interface for compiling letters (notices).
Sysprefs for notice and slips stylesheets
Added TRANSFERSLIP to the letters
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This patch solves the situation that news is in another language than
the Koha interface AND makes that themelanguage routine is always called
the same way in order to prevent mixed display.
It fixes also a bug related to language preselection based on web
browser prefered language.
September 9: Adjusted with input of Frederic Demians.
Septembre 10: Avoid circular dependency, as pointed by Chris Cormack.
Templates related functions are moved from C4::Output to C4::Templates
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Adds a conditional around the opening and closing of STYLESHEET, testing on whether the $stylesheet variable is set
or not.
Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This is done by saving the notices in the message_queue table with
type 'print'. The notices are generated from a notice named
HOLD_PRINT. At the end of the day, they are dumped to an HTML file and
marked as sent by a new cronjob.
This setup is intended to be temporary; modules/batch/ shouldn't be around
forever.
Mandatory SQL:
INSERT INTO message_transport_types (message_transport_type) values ('print');