Bug 18915: DBRev 17.12.00.005
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 15 Jan 2018 15:19:08 +0000 (12:19 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 15 Jan 2018 15:22:15 +0000 (12:22 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha.pm
installer/data/mysql/atomicupdate/bug_18915_-_modifying_patron_note_notice.sql [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 1179356..0287f55 100644 (file)
--- 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 (file)
index 8fd6b6e..0000000
+++ /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, "<<biblio.item>>", "<<biblio.title>>") 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', '<<borrowers.firstname>> <<borrowers.surname>> has added a note to the item <<biblio.title>> - <<biblio.author>> (<<biblio.biblionumber>>).','email');
index 2a4541b..78ab704 100755 (executable)
@@ -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, "<<biblio.item>>", "<<biblio.title>>")
+        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', '<<borrowers.firstname>> <<borrowers.surname>> has added a note to the item <<biblio.title>> - <<biblio.author>> (<<biblio.biblionumber>>).','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