Bug 12648: Link patrons to an order - DB changes
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 24 Jul 2014 11:26:29 +0000 (13:26 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 11 Mar 2015 14:47:16 +0000 (11:47 -0300)
This patch inserts the new notification template into the letters table.
It also add the insert statements into the language specific files.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Amended patch: Add the kohastructure.sql changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/de-DE/mandatory/sample_notices.sql
installer/data/mysql/en/mandatory/sample_notices.sql
installer/data/mysql/es-ES/mandatory/sample_notices.sql
installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
installer/data/mysql/it-IT/necessari/notices.sql
installer/data/mysql/kohastructure.sql
installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql
installer/data/mysql/pl-PL/mandatory/sample_notices.sql
installer/data/mysql/ru-RU/mandatory/sample_notices.sql
installer/data/mysql/uk-UA/mandatory/sample_notices.sql
installer/data/mysql/updatedatabase.pl

index 01ae5d4..5afc419 100644 (file)
@@ -131,3 +131,6 @@ Wir möchten Sie darüber informieren, dass der Benutzer <<borrowers.firstname>>
 Vielen Dank,
 Ihr Biblioheksteam'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index 2281739..378be05 100644 (file)
@@ -142,3 +142,6 @@ Thank you.
 
 Your library.'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index b105f58..3d0ca99 100644 (file)
@@ -143,3 +143,7 @@ Thank you.
 
 Your library.'
 );
+
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index d66a2d4..9fd43a7 100644 (file)
@@ -145,3 +145,6 @@ Thank you.
 
 Your library.'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index 626f208..c74df45 100644 (file)
@@ -142,3 +142,6 @@ Grazie di tutto
 
 Lo staff della biblioteca.'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index 08ef9ee..5e04530 100644 (file)
@@ -3088,6 +3088,18 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items
   CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
+--
+-- Table structure for table `aqorderusers`
+--
+
+DROP TABLE IF EXISTS `aqorderusers`;
+CREATE TABLE aqorderusers (
+    ordernumber int(11) NOT NULL,
+    borrowernumber int(11) NOT NULL,
+    PRIMARY KEY (ordernumber, borrowernumber),
+    CONSTRAINT aqorderusers_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber) ON DELETE CASCADE ON UPDATE CASCADE,
+    CONSTRAINT aqorderusers_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
 --
 -- Table structure for table `aqorders_items`
index f1e8fb0..cb40756 100644 (file)
@@ -163,3 +163,6 @@ Thank you.
 
 Your library.'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index 2281739..378be05 100644 (file)
@@ -142,3 +142,6 @@ Thank you.
 
 Your library.'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index a8d3046..ff767c2 100644 (file)
@@ -145,3 +145,6 @@ Thank you.
 
 Your library.'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index db8976e..547a3f7 100644 (file)
@@ -144,3 +144,6 @@ Thank you.
 
 Your library.'
 );
+
+INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
index bd39629..184927d 100755 (executable)
@@ -9804,6 +9804,26 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q|
+        CREATE TABLE aqorderusers (
+            ordernumber int(11) NOT NULL,
+            borrowernumber int(11) NOT NULL,
+            PRIMARY KEY (ordernumber, borrowernumber),
+            CONSTRAINT aqorderusers_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber) ON DELETE CASCADE ON UPDATE CASCADE,
+            CONSTRAINT aqorderusers_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
+        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+    |);
+
+    $dbh->do(q|
+        INSERT INTO letter(module, code, branchcode, name, title, content, message_transport_type)
+        VALUES ('acquisition', 'ACQ_NOTIF_ON_RECEIV', '', 'Notification on receiving', 'Order received', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\n The order <<aqorders.ordernumber>> (<<biblio.title>>) has been received.\n\nYour library.', 'email')
+    |);
+    print "Upgrade to $DBversion done (Bug 12648: Add letter ACQ_NOTIF_ON_RECEIV )\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)