From 9d0284f79d9b0f56b0762a7ebe4012454827f5a8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 15 Jan 2018 12:19:08 -0300 Subject: [PATCH] Bug 18915: DBRev 17.12.00.005 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- ...g_18915_-_modifying_patron_note_notice.sql | 4 ---- installer/data/mysql/updatedatabase.pl | 23 ++++++++++++++++++- 3 files changed, 23 insertions(+), 6 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql diff --git a/Koha.pm b/Koha.pm index 1179356441..0287f558ed 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 = "17.12.00.004"; +$VERSION = "17.12.00.005"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql b/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql deleted file mode 100644 index 8fd6b6e974..0000000000 --- a/installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql +++ /dev/null @@ -1,4 +0,0 @@ --- For installations having the note already -UPDATE letter SET code = 'CHECKOUT_NOTE', name = 'Checkout note on item set by patron', title = 'Checkout note', content = REPLACE(content, "<>", "<>") WHERE code = 'PATRON_NOTE'; --- For installations coming from 17.11 -INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation', 'CHECKOUT_NOTE', '', 'Checkout note on item set by patron', '0', 'Checkout note', '<> <> has added a note to the item <> - <> (<>).','email'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2a4541b143..78ab704b7e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -15186,7 +15186,28 @@ if( CheckVersion( $DBversion ) ) { }); SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 19278: Add a configurable default page size for REST endpoints)\n"; + print "Upgrade to $DBversion done (Bug 19278 - Add a configurable default page size for REST endpoints)\n"; +} + +$DBversion = '17.12.00.005'; +if( CheckVersion( $DBversion ) ) { + # For installations having the note already + $dbh->do(q{ + UPDATE letter + SET code = 'CHECKOUT_NOTE', + name = 'Checkout note on item set by patron', + title = 'Checkout note', + content = REPLACE(content, "<>", "<>") + WHERE code = 'PATRON_NOTE' + }); + # For installations coming from 17.11 + $dbh->do(q{ + INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) + VALUES ('circulation', 'CHECKOUT_NOTE', '', 'Checkout note on item set by patron', '0', 'Checkout note', '<> <> has added a note to the item <> - <> (<>).','email') + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18915 - Correct CHECKOUT_NOTE notice template)\n"; } # DEVELOPER PROCESS, search for anything to execute in the db_update directory -- 2.39.5