@@ -, +, @@ 1 - Apply patches 2 - Update database 3 - Ensure EnhancedMessagingPreferences and EnhancedMessagingPreferencesOPAC are enabled 4 - View a patron and note new messaging preference 5 - Confirm same on the opac for a patron account 6 - All transports should be disabled by default 7 - Place a hold for the patron and check it in to confirm 8 - Run hold reminder script perl misc/cronjobs/holds_reminder.pl -v -c 9 - No message should be queued for patron perl misc/cronjobs/holds_reminder.pl -v -c -mtt=print --- ...28153_add_holdreminder_notice_preference.perl | 16 ++++++++++++++++ .../en/includes/messaging-preference-form.inc | 1 + .../bootstrap/en/modules/opac-messaging.tt | 1 + misc/cronjobs/holds/holds_reminder.pl | 6 +++--- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_28153_add_holdreminder_notice_preference.perl --- a/installer/data/mysql/atomicupdate/bug_28153_add_holdreminder_notice_preference.perl +++ a/installer/data/mysql/atomicupdate/bug_28153_add_holdreminder_notice_preference.perl @@ -0,0 +1,16 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ + INSERT IGNORE INTO `message_attributes` + (`message_attribute_id`, message_name, `takes_days`) + VALUES (10, 'Hold_Reminder', 0) + }); + $dbh->do( q{ + INSERT IGNORE INTO `message_transports` + (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) + VALUES (10, 'email', 0, 'circulation', 'HOLD_REMINDER'), + (10, 'sms', 0, 'circulation', 'HOLD_REMINDER'), + (10, 'phone', 0, 'circulation', 'HOLD_REMINDER') + }); + NewVersion( $DBversion, 28153, "Add Hold reminder messaging preference"); +} --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -19,6 +19,7 @@ [% IF ( messaging_preference.Item_Due ) %]Item due [% ELSIF ( messaging_preference.Advance_Notice ) %]Advance notice [% ELSIF ( messaging_preference.Hold_Filled ) %]Hold filled + [% ELSIF ( messaging_preference.Hold_Reminder ) %]Hold reminder [% ELSIF ( messaging_preference.Item_Check_in ) %]Item check-in [% ELSIF ( messaging_preference.Item_Checkout ) %] [% IF Koha.Preference( 'RenewalSendNotice' ) %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -62,6 +62,7 @@ [% IF ( messaging_preference.Item_Due ) %]Item due [% ELSIF ( messaging_preference.Advance_Notice ) %]Advance notice [% ELSIF ( messaging_preference.Hold_Filled ) %]Hold filled + [% ELSIF ( messaging_preference.Hold_Reminder ) %]Hold reminder [% ELSIF ( messaging_preference.Item_Check_in ) %]Item check-in [% ELSIF ( messaging_preference.Item_Checkout ) %] [% IF Koha.Preference( 'RenewalSendNotice' ) %] --- a/misc/cronjobs/holds/holds_reminder.pl +++ a/misc/cronjobs/holds/holds_reminder.pl @@ -61,7 +61,7 @@ holds_reminder.pl -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 + -mtt type of messages to send, default is to use patrons messaging preferences for Hold reminder populating this will force send even if patron has not chosen to receive hold notices email and sms will fallback to print if borrower does not have an address/phone -date Send notices as would have been sent on a specific date @@ -265,8 +265,8 @@ foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP my %done; # If passed message transports we force use those, otherwise we will use the patrons preferences - # for the 'Hold_Filled' notice - my $sending_params = @mtts ? { message_transports => \@mtts } : { message_name => "Hold_Filled" }; + # for the 'Hold_Reminder' notice + my $sending_params = @mtts ? { message_transports => \@mtts } : { message_name => "Hold_Reminder" }; my %patrons; --