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 <galen.charlton@liblime.com>
This commit is contained in:
Jesse Weaver 2008-12-05 15:11:14 -06:00 committed by Galen Charlton
parent c9a50403e5
commit 7ee84ba5cb
5 changed files with 22 additions and 5 deletions

View file

@ -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>>');

View file

@ -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);

View file

@ -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');

View file

@ -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

View file

@ -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