From 75f3cca1382b1d7870c77255ee052b12b47f4ad4 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 7 Jun 2019 14:54:42 +0100 Subject: [PATCH] Bug 22566: Fix malformed notice for stockrotation The default notice for stockrotation was malformed. This patch replaces it with a working one. Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/bug_22566.perl | 7 ++++++ .../mysql/en/mandatory/sample_notices.sql | 22 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_22566.perl diff --git a/installer/data/mysql/atomicupdate/bug_22566.perl b/installer/data/mysql/atomicupdate/bug_22566.perl new file mode 100644 index 0000000000..5bf4f4a0de --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_22566.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{UPDATE letter SET content = 'Stockrotation report for [% name %]:\r\n\r\n[%- IF items.size -%]\r\n[% items.size %] items to be processed for this branch.\r\n[%- ELSE -%]\r\nNo items to be processed for this branch\r\n[%- END -%]\r\n\r\n\r\n[%- FOREACH item IN items -%]\r\n[% IF item.reason != ''in-demand'' %]\r\nTitle: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent Library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n[% END %]\r\n[%- END -%]' WHERE code = 'SR_SLIP'}); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; +} diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 6d676e73e6..e1311e41c3 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -315,4 +315,24 @@ INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, ', 'print', 'default'); INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES -('circulation', 'SR_SLIP', '', 'Stock rotation slip', 0, 'Stock rotation report', 'Stock rotation report for [% branch.name %]:\r\n\r\n[% IF branch.items.size %][% branch.items.size %] items to be processed for this branch.\r\n[% ELSE %]No items to be processed for this branch\r\n[% END %][% FOREACH item IN branch.items %][% IF item.reason != \'in-demand\' %]Title: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n\r\n[% END %][% END %]', 'email'); +('circulation', 'SR_SLIP', '', 'Stock rotation slip', 0, 'Stock rotation report', 'Stockrotation report for [% name %]: + +[%- IF items.size -%] +[% items.size %] items to be processed for this branch. +[%- ELSE -%] +No items to be processed for this branch +[%- END -%] + + +[%- FOREACH item IN items -%] +[% IF item.reason != ''in-demand'' %] +Title: [% item.title %] +Author: [% item.author %] +Callnumber: [% item.callnumber %] +Location: [% item.location %] +Barcode: [% item.barcode %] +On loan?: [% item.onloan %] +Status: [% item.reason %] +Current Library: [% item.branch.branchname %] [% item.branch.branchcode %] +[% END %] +[%- END -%]', 'email'); -- 2.20.1