From 35627cb5006814db8caa76c0dd3801e45a1e71b2 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 16 Mar 2021 10:18:38 -0300 Subject: [PATCH] Bug 18532: (follow-up) Fix atomic update Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug-18532.perl | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug-18532.perl b/installer/data/mysql/atomicupdate/bug-18532.perl index 9daf0a5284..57867e45bb 100644 --- a/installer/data/mysql/atomicupdate/bug-18532.perl +++ b/installer/data/mysql/atomicupdate/bug-18532.perl @@ -8,14 +8,26 @@ if( CheckVersion( $DBversion ) ) { There were [% error %] items that were not renewed. [% END %] [% IF success %] - There were [% success %] items that where renewed. + There were [% success %] items that were renewed. [% END %] [% FOREACH checkout IN checkouts %] [% checkout.item.biblio.title %] : [% checkout.item.barcode %] [% IF !checkout.auto_renew_error %] was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] - [% ELSE %] - was not renewed with error: [% checkout.auto_renew_error %] + [% ELSIF checkout.auto_renew_error == 'too_many' %] + You have reached the maximum number of checkouts possible. + [% ELSIF checkout.auto_renew_error == 'on_reserve' %] + This item is on hold for another patron. + [% ELSIF checkout.auto_renew_error == 'restriction' %] + You are currently restricted. + [% ELSIF checkout.auto_renew_error == 'overdue' %] + You have overdue items. + [% ELSIF checkout.auto_renew_error == 'auto_too_late' %] + It's too late to renew this item. + [% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] + Your total unpaid fines are too high. + [% ELSIF checkout.auto_renew_error == 'too_unseen' %] + This item must be renewed at the library. [% END %] [% END %] ", 'email'); @@ -24,27 +36,16 @@ if( CheckVersion( $DBversion ) ) { $dbh->do( q{ INSERT IGNORE INTO `message_attributes` (`message_attribute_id`, message_name, `takes_days`) - VALUES (7, 'Auto_Renewals', 0) + VALUES (9, 'Auto_Renewals', 0) }); $dbh->do( q{ INSERT IGNORE INTO `message_transports` (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) - VALUES (7, 'email', 0, 'circulation', 'AUTO_RENEWALS'), - (7, 'sms', 0, 'circulation', 'AUTO_RENEWALS'), - (7, 'email', 1, 'circulation', 'AUTO_RENEWALS_DGST'), - (7, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST') - }); - - $dbh->do( q{ - insert into borrower_message_transport_preferences (borrower_message_preference_id, message_transport_type) - select p.borrower_message_preference_id, 'email' - from borrower_message_preferences p - left join - borrower_message_transport_preferences t - on p.borrower_message_preference_id = t.borrower_message_preference_id - where p.message_attribute_id = 7 - and t.borrower_message_preference_id is null; + VALUES (9, 'email', 0, 'circulation', 'AUTO_RENEWALS'), + (9, 'sms', 0, 'circulation', 'AUTO_RENEWALS'), + (9, 'email', 1, 'circulation', 'AUTO_RENEWALS_DGST'), + (9, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST') }); $dbh->do(q{ -- 2.25.0