[Koha-patches] [PATCH] Letters for holds notifications

Galen Charlton galen.charlton at liblime.com
Fri Dec 5 16:31:10 CET 2008


From: Jesse Weaver <jesse.weaver at liblime.com>

This adds the necessary SQL for holds notifications to work.

Signed-off-by: Galen Charlton <galen.charlton at liblime.com>
---
 .../data/mysql/en/optional/sample_notices.sql      |    3 ++-
 .../optional/sample_notices_message_attributes.sql |    3 ++-
 .../optional/sample_notices_message_transports.sql |    5 +++--
 installer/data/mysql/updatedatabase.pl             |   14 ++++++++++++++
 kohaversion.pl                                     |    2 +-
 5 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/installer/data/mysql/en/optional/sample_notices.sql b/installer/data/mysql/en/optional/sample_notices.sql
index b2e8bba..ec9f84c 100644
--- a/installer/data/mysql/en/optional/sample_notices.sql
+++ b/installer/data/mysql/en/optional/sample_notices.sql
@@ -9,4 +9,5 @@ VALUES
 ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'),
 ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<items.content>>'),
 ('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
-('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.');
+('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThis is a reminder of an upcoming library event in which you have expressed interest.'),
+('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>');
diff --git a/installer/data/mysql/en/optional/sample_notices_message_attributes.sql b/installer/data/mysql/en/optional/sample_notices_message_attributes.sql
index 3d74c43..8f89ff7 100644
--- a/installer/data/mysql/en/optional/sample_notices_message_attributes.sql
+++ b/installer/data/mysql/en/optional/sample_notices_message_attributes.sql
@@ -3,5 +3,6 @@ insert into `message_attributes`
 values
 (1, 'Item DUE', 0),
 (2, 'Advance Notice', 1),
-(3, 'Upcoming Events', 1);
+(3, 'Upcoming Events', 1),
+(4, 'Hold Filled', 0);
 
diff --git a/installer/data/mysql/en/optional/sample_notices_message_transports.sql b/installer/data/mysql/en/optional/sample_notices_message_transports.sql
index e713319..bc796dc 100644
--- a/installer/data/mysql/en/optional/sample_notices_message_transports.sql
+++ b/installer/data/mysql/en/optional/sample_notices_message_transports.sql
@@ -6,9 +6,10 @@ values
 (2, 'email', 0, 'circulation', 'PREDUE'),
 (2, 'email', 1, 'circulation', 'PREDUEDGST'),
 (3, 'email', 0, 'circulation', 'EVENT'),
+(4, 'email', 0, 'reserves',    'HOLD'),
 (1, 'sms',   0, 'circulation', 'DUE'),
 (1, 'sms',   1, 'circulation', 'DUEDGST'),
 (2, 'sms',   0, 'circulation', 'PREDUE'),
 (2, 'sms',   1, 'circulation', 'PREDUEDGST'),
-(3, 'sms',   0, 'circulation', 'EVENT');
-
+(3, 'sms',   0, 'circulation', 'EVENT'),
+(4, 'sms',   0, 'reserves',    'HOLD');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 9cb957a..64c6168 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2046,6 +2046,20 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     print "Upgrade to $DBversion done (added OPACDisplayRequestPriority system preference)\n";
     SetVersion ($DBversion);
 }
+
+$DBversion = '3.01.00.005';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("
+        INSERT INTO `letter` (module, code, name, title, content)
+        VALUES('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>')
+    ");
+    $dbh->do("INSERT INTO `message_attributes` (message_attribute_id, message_name, takes_days) values(4, 'Hold Filled', 0)");
+    $dbh->do("INSERT INTO `message_transports` (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) values(4, 'sms', 0, 'reserves', 'HOLD')");
+    $dbh->do("INSERT INTO `message_transports` (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) values(4, 'email', 0, 'reserves', 'HOLD')");
+    print "Upgrade to $DBversion done (Add letter for holds notifications)\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
diff --git a/kohaversion.pl b/kohaversion.pl
index 7671aa5..a6eaa26 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.004';
+    our $VERSION = '3.01.00.005';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.5.5.GIT




More information about the Koha-patches mailing list