@@ -, +, @@ Update database ArticleRequestsMandatoryFields ArticleRequestsMandatoryFieldsItemsOnly ArticleRequestsMandatoryFieldsRecordOnly --- installer/data/mysql/atomicupdate/bug_14610.sql | 42 ++++++++++++++++++++++ .../data/mysql/en/mandatory/sample_notices.sql | 7 ++++ installer/data/mysql/kohastructure.sql | 33 +++++++++++++++++ installer/data/mysql/sysprefs.sql | 4 +++ 4 files changed, 86 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_14610.sql --- a/installer/data/mysql/atomicupdate/bug_14610.sql +++ a/installer/data/mysql/atomicupdate/bug_14610.sql @@ -0,0 +1,42 @@ +ALTER TABLE `issuingrules` ADD `article_requests` ENUM( 'no', 'yes', 'bib_only', 'item_only' ) NOT NULL DEFAULT 'no'; + +INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) VALUES + ('ArticleRequests', '1', NULL, 'Enables the article request feature', 'YesNo'), + ('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'), + ('ArticleRequestsMandatoryFieldsItemsOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''item_only''', 'multiple'), + ('ArticleRequestsMandatoryFieldsRecordOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''bib_only''', 'multiple'); + +CREATE TABLE IF NOT EXISTS `article_requests` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `borrowernumber` int(11) NOT NULL, + `biblionumber` int(11) NOT NULL, + `itemnumber` int(11) DEFAULT NULL, + `branchcode` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, + `title` text, + `author` text, + `volume` text, + `issue` text, + `date` text, + `pages` text, + `chapters` text, + `status` enum('OPEN','PROCESSING','COMPLETED','CANCELED') NOT NULL DEFAULT 'OPEN', + `notes` text, + `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `updated_on` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `borrowernumber` (`borrowernumber`), + KEY `biblionumber` (`biblionumber`), + KEY `itemnumber` (`itemnumber`), + KEY `branchcode` (`branchcode`), + CONSTRAINT `article_requests_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `article_requests_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `article_requests_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB; + +INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES +('circulation', 'AR_CANCELED', '', 'Article Request - Email - Canceled', 0, 'Article Request Canceled', '<> <> (<>)\r\n\r\nYour request for an article from <> (<>) has been canceled for the following reason:\r\n\r\n<>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'email'), +('circulation', 'AR_COMPLETED', '', 'Article Request - Email - Completed', 0, 'Article Request Completed', '<> <> (<>)\r\n\r\nWe are have completed your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nYou may pick your article up at <>.\r\n\r\nThank you!', 'email'), +('circulation', 'AR_OPEN', '', 'Article Request - Email - Open', 0, 'Article Request Recieved', '<> <> (<>)\r\n\r\nWe have received your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\n\r\nThank you!', 'email'), +('circulation', 'AR_PRINT', '', 'Article Request - Print Slip', 0, 'Test', 'Article Request:\r\n\r\n<> <> (<>)\r\n\r\nTitle: <>\r\nBarcode: <>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'print'), +('circulation', 'AR_PROCESSING', '', 'Article Request - Email - Processing', 0, 'Article Request Processing', '<> <> (<>)\r\n\r\nWe are now processing your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nThank you!', 'email'); --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ a/installer/data/mysql/en/mandatory/sample_notices.sql @@ -166,3 +166,10 @@ VALUES ( 'circulation', 'OVERDUES_SLIP', '', 'Overdues Slip', '0', 'OVERDUES_SLI INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type) VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','\r\n

This email has been sent in response to your password recovery request for the account <>.\r\n

\r\n

\r\nYou can now create your new password using the following link:\r\n
>\"><>\r\n

\r\n

This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.

\r\n

Thank you.

\r\n\r\n','email' ); + +INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES +('circulation', 'AR_CANCELED', '', 'Article Request - Email - Canceled', 0, 'Article Request Canceled', '<> <> (<>)\r\n\r\nYour request for an article from <> (<>) has been canceled for the following reason:\r\n\r\n<>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'email'), + ('circulation', 'AR_COMPLETED', '', 'Article Request - Email - Completed', 0, 'Article Request Completed', '<> <> (<>)\r\n\r\nWe are have completed your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nYou may pick your article up at <>.\r\n\r\nThank you!', 'email'), + ('circulation', 'AR_OPEN', '', 'Article Request - Email - Open', 0, 'Article Request Recieved', '<> <> (<>)\r\n\r\nWe have received your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\n\r\nThank you!', 'email'), + ('circulation', 'AR_PRINT', '', 'Article Request - Print Slip', 0, 'Test', 'Article Request:\r\n\r\n<> <> (<>)\r\n\r\nTitle: <>\r\nBarcode: <>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'print'), + ('circulation', 'AR_PROCESSING', '', 'Article Request - Email - Processing', 0, 'Article Request Processing', '<> <> (<>)\r\n\r\nWe are now processing your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nThank you!', 'email'); --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -3622,6 +3622,39 @@ CREATE TABLE audio_alerts ( KEY precedence (precedence) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +-- +-- Table structure for table 'article_requests' +-- + +CREATE TABLE `article_requests` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `borrowernumber` int(11) NOT NULL, + `biblionumber` int(11) NOT NULL, + `itemnumber` int(11) DEFAULT NULL, + `branchcode` varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, + `title` text, + `author` text, + `volume` text, + `issue` text, + `date` text, + `pages` text, + `chapters` text, + `status` enum('OPEN','PROCESSING','COMPLETED','CANCELED') NOT NULL DEFAULT 'OPEN', + `notes` text, + `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `updated_on` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `borrowernumber` (`borrowernumber`), + KEY `biblionumber` (`biblionumber`), + KEY `itemnumber` (`itemnumber`), + KEY `branchcode` (`branchcode`), + CONSTRAINT `article_requests_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `article_requests_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `article_requests_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +>>>>>>> Bug 14610 - Add ability to place article requests in Koha - Update database + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -43,6 +43,10 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'), ('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',''), ('AudioAlerts','0','','Enable circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet.','YesNo'), +('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'), +('ArticleRequestsMandatoryFields', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''yes''', 'multiple'), +('ArticleRequestsMandatoryFieldsItemsOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''item_only''', 'multiple'), +('ArticleRequestsMandatoryFieldsRecordOnly', '', NULL, 'Comma delimited list of required fields for bibs where article requests rule = ''bib_only''', 'multiple'), ('AuthDisplayHierarchy','0','','Display authority hierarchies','YesNo'), ('AuthoritiesLog','1',NULL,'If ON, log edit/create/delete actions on authorities.','YesNo'), ('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'), --