From a351b2379b05cc66ff2b2481eae7b9f85c8c7f82 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 8 Apr 2021 14:43:10 +0000 Subject: [PATCH] Bug 15986: Add sample notice and use as default Signed-off-by: Jonathan Druart --- .../mysql/en/mandatory/sample_notices.yml | 11 ++++++++ misc/cronjobs/holds_reminder.pl | 25 ++++++++----------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index f61cd06100..bc21739ee2 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1233,6 +1233,17 @@ tables: content: - "A hold has been placed on the following item : <> (<>) by the user <> <> (<>)." + - module: reserves + code: HOLD_REMINDER + branchcode: "" + name: "Waiting hold reminder" + is_html: 0 + title: "You have waiting holds." + message_transport_type: email + lang: default + content: + - "Dear [% borrower.firstname %] [% borrower.surname %],\r\n\r\nThe follwing holds are waiting at [% branch.branchname %]:\r\n\\r\n[% FOREACH hold IN holds %]\r\n [% hold.biblio.title %] : waiting since [% hold.waitingdate %]\r\n[% END %]" + - module: serial code: SERIAL_ALERT branchcode: "" diff --git a/misc/cronjobs/holds_reminder.pl b/misc/cronjobs/holds_reminder.pl index f938d0b108..5089af631e 100755 --- a/misc/cronjobs/holds_reminder.pl +++ b/misc/cronjobs/holds_reminder.pl @@ -57,7 +57,7 @@ holds_reminder.pl -v verbose -n No email will be sent -days days waiting to deal with - -lettercode predefined notice to use + -lettercode predefined notice to use, default is HOLD_REMINDER -library only deal with holds from this library (repeatable : several libraries can be given) -holidays use the calendar to not count holidays as waiting days -mtt type of messages to send, default is to use patrons messaging preferences for Hold filled @@ -92,6 +92,10 @@ Optional parameter, number of days an items has been 'waiting' on hold to send a message for. If not included a notice will be sent to all patrons with waiting holds. +=item B<-lettercode> + +Optional parameter, choose a notice to use. Default is 'HOLD_REMINDER'. + =item B<-library> select notices for one specific library. Use the value in the @@ -134,7 +138,7 @@ of the notices sent to patrons. C - With no arguments the simple help is printed -C In this most basic usage all +C In this most basic usage all libraries are processed individually, and notices are prepared for all patrons with waiting holds for whom we have email addresses. Messages for those patrons for whom we have no email @@ -142,16 +146,15 @@ address are sent in a single attachment to the library administrator's email address, or to the address in the KohaAdminEmailAddress system preference. -C - sends no email and +C - sends no email and populates F with information about all waiting holds items. -C - prepare notices of +C - prepare notices of holds waiting for 2 weeks for the MAIN library. -C - prepare notices -of holds waiting for 2 weeks for the MAIN library and include all the -patron's waiting hold +C - prepare notices of +holds waiting for 2 weeks for the MAIN library. Use lettercode 'LATE_HOLDS' =cut @@ -185,13 +188,7 @@ GetOptions( pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; -if ( !$lettercode ) { - pod2usage({ - -exitval => 1, - -msg => qq{\nError: You must specify a lettercode to send reminders.\n}, - }); -} - +$lettercode ||= 'HOLD_REMINDER'; cronlogaction();