From e01bff1135dfdb01bfcc4a515020eb409a67ad15 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 16 Mar 2021 16:07:37 +0100 Subject: [PATCH] Bug 18532: DBRev 20.12.00.024 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug-18532.perl | 57 ------------------ installer/data/mysql/updatedatabase.pl | 58 +++++++++++++++++++ 3 files changed, 59 insertions(+), 58 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug-18532.perl diff --git a/Koha.pm b/Koha.pm index 50afbfa667..6469513fe7 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "20.12.00.023"; +$VERSION = "20.12.00.024"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug-18532.perl b/installer/data/mysql/atomicupdate/bug-18532.perl deleted file mode 100644 index 57867e45bb..0000000000 --- a/installer/data/mysql/atomicupdate/bug-18532.perl +++ /dev/null @@ -1,57 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - # you can use $dbh here like: - $dbh->do( q{ - INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)', - "Dear [% borrower.firstname %] [% borrower.surname %], - [% IF error %] - There were [% error %] items that were not renewed. - [% END %] - [% IF success %] - 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%] - [% 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'); - }); - - $dbh->do( q{ - INSERT IGNORE INTO `message_attributes` - (`message_attribute_id`, message_name, `takes_days`) - 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 (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{ - INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) - VALUES ('AutoRenewalNotices','cron','cron|preferences|never','How should Koha determine whether to end autorenewal notices','Choice') - }); - - NewVersion( $DBversion, 18532, 'Messaging preferences for auto renewals' ); -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a531cfcd62..126e9bbce1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -23670,6 +23670,64 @@ if( CheckVersion( $DBversion ) ) { NewVersion( $DBversion, 27652, "Separate values for OPACHoldsIfAvailableAtPickupExceptions and BatchCheckoutsValidCategories with comma"); } +$DBversion = '20.12.00.024'; +if( CheckVersion( $DBversion ) ) { + + $dbh->do( q{ + INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)', + "Dear [% borrower.firstname %] [% borrower.surname %], + [% IF error %] + There were [% error %] items that were not renewed. + [% END %] + [% IF success %] + 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%] + [% 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'); + }); + + $dbh->do( q{ + INSERT IGNORE INTO `message_attributes` + (`message_attribute_id`, message_name, `takes_days`) + 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 (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{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) + VALUES ('AutoRenewalNotices','cron','cron|preferences|never','How should Koha determine whether to end autorenewal notices','Choice') + }); + + NewVersion( $DBversion, 18532, 'Messaging preferences for auto renewals' ); +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5