From c6367282dab65b788951d9bf10075503e8d12901 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 9 May 2017 21:16:05 +0000 Subject: [PATCH] Bug 15705 - DBRev 16.12.00.035 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_15705.sql | 23 ----------- installer/data/mysql/updatedatabase.pl | 41 +++++++++++++++++++ 3 files changed, 42 insertions(+), 24 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_15705.sql diff --git a/Koha.pm b/Koha.pm index 5bcdae9219..a1cce02491 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 = "16.12.00.034"; +$VERSION = "16.12.00.035"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_15705.sql b/installer/data/mysql/atomicupdate/bug_15705.sql deleted file mode 100644 index c6f8c17a13..0000000000 --- a/installer/data/mysql/atomicupdate/bug_15705.sql +++ /dev/null @@ -1,23 +0,0 @@ -ALTER TABLE issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew; -ALTER TABLE old_issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew; - -INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS', 'notification on auto renewing', 'Auto renewals', -"Dear [% borrower.firstname %] [% borrower.surname %], -[% IF checkout.auto_renew_error %] -The following item [% biblio.title %] has not been correctly renewed -[% IF checkout.auto_renew_error == 'too_many' %] -You have reach the maximum 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 overdues. -[% ELSIF checkout.auto_renew_error == 'auto_too_late' %] -It\'s too late to renew this checkout. -[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] -You have too much unpaid fines. -[% END %] -[% ELSE %] -The following item [% biblio.title %] has correctly been renewed and is now due [% checkout.date_due %] -[% END %]", 'email'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bd02784633..bba670f42d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14421,6 +14421,47 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 15582 - Ability to block auto renewals if the OPACFineNoRenewals amount is reached)\n"; } +$DBversion = '16.12.00.035'; +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'issues', 'auto_renew_error' ) ) { + $dbh->do(q{ + ALTER TABLE issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew; + }); + } + + if( !column_exists( 'old_issues', 'auto_renew_error' ) ) { + $dbh->do(q{ + ALTER TABLE old_issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew; + }); + } + + $dbh->do(q{ + INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS', 'notification on auto renewing', 'Auto renewals', +"Dear [% borrower.firstname %] [% borrower.surname %], +[% IF checkout.auto_renew_error %] +The following item [% biblio.title %] has not been correctly renewed +[% IF checkout.auto_renew_error == 'too_many' %] +You have reach the maximum 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 overdues. +[% ELSIF checkout.auto_renew_error == 'auto_too_late' %] +It\'s too late to renew this checkout. +[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] +You have too much unpaid fines. +[% END %] +[% ELSE %] +The following item [% biblio.title %] has correctly been renewed and is now due [% checkout.date_due %] +[% END %]", 'email'); + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 15705 - Notify the user on auto renewing)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5