From 6c0a8706dbe9bfa93aaacb3ca6c5426b285664ae Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 4 May 2017 13:21:17 -0400 Subject: [PATCH] Bug 15705: DB Changes - Add [old_]issues.auto_renew_error and the AUTO_RENEWALS notice Signed-off-by: Nick Clemens --- installer/data/mysql/atomicupdate/bug_15705.sql | 23 +++++++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_15705.sql diff --git a/installer/data/mysql/atomicupdate/bug_15705.sql b/installer/data/mysql/atomicupdate/bug_15705.sql new file mode 100644 index 0000000..35439f1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_15705.sql @@ -0,0 +1,23 @@ +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 %] as correctly been renewed. +[% END %]", 'email'); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 94ef125..7427693 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1751,6 +1751,7 @@ CREATE TABLE `issues` ( -- information related to check outs or issues `lastreneweddate` datetime default NULL, -- date the item was last renewed `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed `auto_renew` BOOLEAN default FALSE, -- automatic renewal + `auto_renew_error` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, -- automatic renewal error `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched `issuedate` datetime default NULL, -- date the item was checked out or issued `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag @@ -1781,6 +1782,7 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r `lastreneweddate` datetime default NULL, -- date the item was last renewed `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed `auto_renew` BOOLEAN default FALSE, -- automatic renewal + `auto_renew_error` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, -- automatic renewal error `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched `issuedate` datetime default NULL, -- date the item was checked out or issued `onsite_checkout` int(1) NOT NULL default 0, -- in house use flag -- 2.1.4