From 7ee84ba5cb15b3bd99b0374417f0e4e9d620804b Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Fri, 5 Dec 2008 15:11:14 -0600 Subject: [PATCH] bug 2848 [2/2]: Letters for holds notifications (DB rev 005) This adds the necessary SQL for holds notifications to work. Signed-off-by: Galen Charlton --- .../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 b2e8bba793..ec9f84c05a 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 <> items due'), ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <> <>,\r\n\r\nThe following item will be due soon:\r\n\r\n<>'), ('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <> items due soon'), -('circulation','EVENT','Upcoming Library Event','Upcoming Library Event','Dear <> <>,\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 <> <>,\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 <>', 'Dear <> <>,\r\n\r\nYou have a hold available for pickup as of <>:\r\n\r\nTitle: <>\r\nAuthor: <>\r\nCopy: <>\r\nLocation: <>\r\n<>\r\n<>\r\n<>'); 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 3d74c43696..8f89ff7250 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 e713319d26..bc796dc22e 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 dd741b1ce2..6c14e974dd 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 <>', 'Dear <> <>,\r\n\r\nYou have a hold available for pickup as of <>:\r\n\r\nTitle: <>\r\nAuthor: <>\r\nCopy: <>\r\nLocation: <>\r\n<>\r\n<>\r\n<>') + "); + $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 7671aa5b5d..a6eaa26f39 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 -- 2.39.5