From 23026217020f44114fb5ac030c985dc0b3a31a40 Mon Sep 17 00:00:00 2001 From: John Beppu Date: Tue, 3 Feb 2009 16:01:58 -0600 Subject: [PATCH] Schema Changes for Email Checkout Slips - new table, item_circulation_alert_preferences - new data: - letter -- 2 new templates - message_transport_types -- feed - message_attributes -- Item Check-in and Item Checkout - message_transports -- for each attribute and for each transport_type... Signed-off-by: Daniel Sweeney Signed-off-by: Galen Charlton --- .../en/mandatory/message_transport_types.sql | 3 +- .../data/mysql/en/optional/sample_notices.sql | 4 +- .../sample_notices_message_attributes.sql | 4 +- .../sample_notices_message_transports.sql | 8 +++- .../1-Obligatoire/message_transport_types.sql | 6 +++ .../1-Obligatoire/message_transport_types.txt | 2 + .../mysql/fr-FR/2-Optionel/sample_notices.sql | 15 ++++++++ .../mysql/fr-FR/2-Optionel/sample_notices.txt | 1 + .../sample_notices_message_attributes.sql | 10 +++++ .../sample_notices_message_attributes.txt | 2 + .../sample_notices_message_transports.sql | 21 +++++++++++ .../sample_notices_message_transports.txt | 3 ++ installer/data/mysql/kohastructure.sql | 15 ++++++++ installer/data/mysql/updatedatabase.pl | 37 +++++++++++++++++++ kohaversion.pl | 2 +- 15 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.sql create mode 100644 installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.txt create mode 100644 installer/data/mysql/fr-FR/2-Optionel/sample_notices.sql create mode 100644 installer/data/mysql/fr-FR/2-Optionel/sample_notices.txt create mode 100644 installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql create mode 100644 installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.txt create mode 100644 installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql create mode 100644 installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.txt diff --git a/installer/data/mysql/en/mandatory/message_transport_types.sql b/installer/data/mysql/en/mandatory/message_transport_types.sql index 517f5cc96c..e8c0027354 100644 --- a/installer/data/mysql/en/mandatory/message_transport_types.sql +++ b/installer/data/mysql/en/mandatory/message_transport_types.sql @@ -2,4 +2,5 @@ INSERT INTO message_transport_types (message_transport_type) values ('email'), -('sms'); +('sms') +('feed'); diff --git a/installer/data/mysql/en/optional/sample_notices.sql b/installer/data/mysql/en/optional/sample_notices.sql index ec9f84c05a..ad414b080d 100644 --- a/installer/data/mysql/en/optional/sample_notices.sql +++ b/installer/data/mysql/en/optional/sample_notices.sql @@ -10,4 +10,6 @@ VALUES ('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.'), -('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<>'); +('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<>'), +('circulation','CHECKINDGST','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n<>'), +('circulation','CHECKOUTDGST','Item Check-out (Digest)','Checkouts','The following items have been checked out:\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 8f89ff7250..5d1ecb6234 100644 --- a/installer/data/mysql/en/optional/sample_notices_message_attributes.sql +++ b/installer/data/mysql/en/optional/sample_notices_message_attributes.sql @@ -4,5 +4,7 @@ values (1, 'Item DUE', 0), (2, 'Advance Notice', 1), (3, 'Upcoming Events', 1), -(4, 'Hold Filled', 0); +(4, 'Hold Filled', 0), +(5, 'Item Check-in', 0), +(6, 'Item Checkout', 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 bc796dc22e..b9d9f90439 100644 --- a/installer/data/mysql/en/optional/sample_notices_message_transports.sql +++ b/installer/data/mysql/en/optional/sample_notices_message_transports.sql @@ -12,4 +12,10 @@ values (2, 'sms', 0, 'circulation', 'PREDUE'), (2, 'sms', 1, 'circulation', 'PREDUEDGST'), (3, 'sms', 0, 'circulation', 'EVENT'), -(4, 'sms', 0, 'reserves', 'HOLD'); +(4, 'sms', 0, 'reserves', 'HOLD'), +(5, 'email', 1, 'circulation', 'CHECKINDGST'), +(5, 'sms', 1, 'circulation', 'CHECKINDGST'), +(5, 'feed', 1, 'circulation', 'CHECKINDGST'), +(6, 'email', 1, 'circulation', 'CHECKOUTDGST'), +(6, 'sms', 1, 'circulation', 'CHECKOUTDGST'), +(6, 'feed', 1, 'circulation', 'CHECKOUTDGST'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.sql b/installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.sql new file mode 100644 index 0000000000..e8c0027354 --- /dev/null +++ b/installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.sql @@ -0,0 +1,6 @@ +INSERT INTO message_transport_types +(message_transport_type) +values +('email'), +('sms') +('feed'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.txt b/installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.txt new file mode 100644 index 0000000000..3a8926afc5 --- /dev/null +++ b/installer/data/mysql/fr-FR/1-Obligatoire/message_transport_types.txt @@ -0,0 +1,2 @@ +defines default message tranports for email, and sms. + diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_notices.sql new file mode 100644 index 0000000000..ad414b080d --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices.sql @@ -0,0 +1,15 @@ +INSERT INTO `letter` +(module, code, name, title, content) +VALUES +('circulation','ODUE','Overdue Notice','Item Overdue','Dear <> <>,\r\n\r\nAccording to our current records, you have items that are overdue.Your library does not charge late fines, but please return orrenew them as soon as possible.\r\n\r\n<><><><><><><>If you have registered a password with the library, you may use it withyour library card number to renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned. The following item is currently overdue:\r\n\r\n<>'), +('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<>\r\n<>\r\n<>\r\n<>\r\n<>\r\n<>\r\n\r\nOrdernumber <> (<>) (<> ordered) ($<> each) has not been received.'), +('serial','RLIST','Routing List','Serial is now available','<> <>,\r\n\r\nThe following issue is now available:\r\n\r\n<>\r\n\r\nPlease pick it up at your convenience.'), +('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <> <> <>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <>\r\nPassword: <>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin@yoursite.org'), +('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <> <>,\r\n\r\nThe following item is now due:\r\n\r\n<>'), +('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.'), +('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<>'), +('circulation','CHECKINDGST','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n<>'), +('circulation','CHECKOUTDGST','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n<>'); diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices.txt b/installer/data/mysql/fr-FR/2-Optionel/sample_notices.txt new file mode 100644 index 0000000000..82e2ff84d6 --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices.txt @@ -0,0 +1 @@ +Sample Notices diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql new file mode 100644 index 0000000000..5d1ecb6234 --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.sql @@ -0,0 +1,10 @@ +insert into `message_attributes` +(`message_attribute_id`, message_name, `takes_days`) +values +(1, 'Item DUE', 0), +(2, 'Advance Notice', 1), +(3, 'Upcoming Events', 1), +(4, 'Hold Filled', 0), +(5, 'Item Check-in', 0), +(6, 'Item Checkout', 0); + diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.txt b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.txt new file mode 100644 index 0000000000..770bcac2b5 --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_attributes.txt @@ -0,0 +1,2 @@ +defines default messages for items due, advance notices, and upcoming library events. + diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql new file mode 100644 index 0000000000..b9d9f90439 --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.sql @@ -0,0 +1,21 @@ +insert into `message_transports` +(`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) +values +(1, 'email', 0, 'circulation', 'DUE'), +(1, 'email', 1, 'circulation', 'DUEDGST'), +(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'), +(4, 'sms', 0, 'reserves', 'HOLD'), +(5, 'email', 1, 'circulation', 'CHECKINDGST'), +(5, 'sms', 1, 'circulation', 'CHECKINDGST'), +(5, 'feed', 1, 'circulation', 'CHECKINDGST'), +(6, 'email', 1, 'circulation', 'CHECKOUTDGST'), +(6, 'sms', 1, 'circulation', 'CHECKOUTDGST'), +(6, 'feed', 1, 'circulation', 'CHECKOUTDGST'); diff --git a/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.txt b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.txt new file mode 100644 index 0000000000..18e3431361 --- /dev/null +++ b/installer/data/mysql/fr-FR/2-Optionel/sample_notices_message_transports.txt @@ -0,0 +1,3 @@ +Defines default message transports for sending item due messages, +advance notice messages, and library event messages through email +and SMS. diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 670539ab3a..1678aaf006 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2339,6 +2339,21 @@ CREATE TABLE branch_transfer_limits ( PRIMARY KEY (limitId) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- +-- Table structure for table `item_circulation_alert_preferences` +-- + +DROP TABLE IF EXISTS `item_circulation_alert_preferences`; +CREATE TABLE `item_circulation_alert_preferences` ( + `id` int(11) NOT NULL auto_increment, + `branchcode` varchar(10) NOT NULL, + `categorycode` varchar(10) NOT NULL, + `item_type` varchar(10) NOT NULL, + `is_enabled` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `branchcode` (`branchcode`,`categorycode`,`item_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a819f8fdb3..87c7283885 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2120,6 +2120,43 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'circulate_remaining_permissions', 'Remaining circulation permissions')"); $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ( 1, 'override_renewals', 'Override blocked renewals')"); print "Upgrade to $DBversion done (added subpermissions for circulate permission)\n"; +} + +$DBversion = '3.01.00.016'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do(" + CREATE TABLE item_circulation_alert_preferences ( + id int(11) AUTO_INCREMENT, + branchcode varchar(10) NOT NULL, + categorycode varchar(10) NOT NULL, + item_type varchar(10) NOT NULL, + is_enabled tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (id), + KEY (branchcode, categorycode, item_type) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + "); + $dbh->do(q{ + INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES + ('circulation','CHECKINDGST','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n<>'); + }); + $dbh->do(q{ + INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES + ('circulation','CHECKOUTDGST','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n<>'); + }); + + $dbh->do(q{INSERT INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (5, 'Item Check-in', 0);}); + $dbh->do(q{INSERT INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (6, 'Item Checkout', 0);}); + + $dbh->do(q{INSERT INTO message_transport_types (message_transport_type) VALUES ('feed');}); + + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'email', 1, 'circulation', 'CHECKINDGST');}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'sms', 1, 'circulation', 'CHECKINDGST');}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (5, 'feed', 1, 'circulation', 'CHECKINDGST');}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'email', 1, 'circulation', 'CHECKOUTDGST');}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'sms', 1, 'circulation', 'CHECKOUTDGST');}); + $dbh->do(q{INSERT INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code) VALUES (6, 'feed', 1, 'circulation', 'CHECKOUTDGST');}); + + print "Upgrade to $DBversion done (data for Email Checkout Slips project)\n"; SetVersion ($DBversion); } diff --git a/kohaversion.pl b/kohaversion.pl index cc7bd5ba4d..fc73c47b48 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.01.00.012'; + our $VERSION = '3.01.00.016'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5