From 5b9490b9fdc1af127851b12f0356e180ba635541 Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Thu, 22 Sep 2016 16:20:14 +0200 Subject: [PATCH] Bug 7317: Add SQL templates & sysprefs. * installer/data/mysql/atomicupdate/ill_tables.sql: New file. * installer/data/mysql/kohastructure.sql: Add tables. * installer/data/mysql/sysprefs.sql: Add sysprefs. * installer/data/mysql/userflags.sql: Add userflags. * koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref: Add sysprefs to UI. --- installer/data/mysql/atomicupdate/ill_tables.sql | 52 ++++++++++++++++++++++ installer/data/mysql/kohastructure.sql | 49 ++++++++++++++++++++ installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/userflags.sql | 3 +- .../prog/en/modules/admin/preferences/admin.pref | 8 ++++ 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/ill_tables.sql diff --git a/installer/data/mysql/atomicupdate/ill_tables.sql b/installer/data/mysql/atomicupdate/ill_tables.sql new file mode 100644 index 0000000000..a2b9701022 --- /dev/null +++ b/installer/data/mysql/atomicupdate/ill_tables.sql @@ -0,0 +1,52 @@ +-- ILL Requests + +CREATE TABLE illrequests ( + illrequest_id serial PRIMARY KEY, -- ILL request number + borrowernumber integer DEFAULT NULL, -- Patron associated with request + biblio_id integer DEFAULT NULL, -- Potential bib linked to request + branchcode varchar(50) NOT NULL, -- The branch associated with the request + status varchar(50) DEFAULT NULL, -- Current Koha status of request + placed date DEFAULT NULL, -- Date the request was placed + replied date DEFAULT NULL, -- Last API response + updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request + ON UPDATE CURRENT_TIMESTAMP, + completed date DEFAULT NULL, -- Date the request was completed + medium varchar(30) DEFAULT NULL, -- The Koha request type + accessurl varchar(500) DEFAULT NULL, -- Potential URL for accessing item + cost varchar(20) DEFAULT NULL, -- Cost of request + notesopac text DEFAULT NULL, -- Patron notes attached to request + notesstaff text DEFAULT NULL, -- Staff notes attached to request + orderid varchar(50) DEFAULT NULL, -- Backend id attached to request + backend varchar(20) DEFAULT NULL, -- The backend used to create request + CONSTRAINT `illrequests_bnfk` + FOREIGN KEY (`borrowernumber`) + REFERENCES `borrowers` (`borrowernumber`) + ON UPDATE CASCADE ON DELETE CASCADE, + CONSTRAINT `illrequests_bcfk_2` + FOREIGN KEY (`branchcode`) + REFERENCES `branches` (`branchcode`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- ILL Request Attributes + +CREATE TABLE illrequestattributes ( + illrequest_id bigint(20) unsigned NOT NULL, -- ILL request number + type varchar(200) NOT NULL, -- API ILL property name + value text NOT NULL, -- API ILL property value + PRIMARY KEY (`illrequest_id`,`type`), + CONSTRAINT `illrequestattributes_ifk` + FOREIGN KEY (illrequest_id) + REFERENCES `illrequests` (`illrequest_id`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- System preferences + +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES + ('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'); + +-- Userflags + +INSERT INTO userflags (bit,flag,flagdesc,defaulton) +VALUES (21,'ill','The Interlibrary Loans Module',0); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 94ef125881..7b761f57ae 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4089,6 +4089,55 @@ CREATE TABLE IF NOT EXISTS club_fields ( CONSTRAINT club_fields_ibfk_4 FOREIGN KEY (club_id) REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +-- +-- Table structure for table `illrequests` +-- + +DROP TABLE IF EXISTS `illrequests`; +CREATE TABLE illrequests ( + illrequest_id serial PRIMARY KEY, -- ILL request number + borrowernumber integer DEFAULT NULL, -- Patron associated with request + biblio_id integer DEFAULT NULL, -- Potential bib linked to request + branchcode varchar(50) NOT NULL, -- The branch associated with the request + status varchar(50) DEFAULT NULL, -- Current Koha status of request + placed date DEFAULT NULL, -- Date the request was placed + replied date DEFAULT NULL, -- Last API response + updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request + ON UPDATE CURRENT_TIMESTAMP, + completed date DEFAULT NULL, -- Date the request was completed + medium varchar(30) DEFAULT NULL, -- The Koha request type + accessurl varchar(500) DEFAULT NULL, -- Potential URL for accessing item + cost varchar(20) DEFAULT NULL, -- Cost of request + notesopac text DEFAULT NULL, -- Patron notes attached to request + notesstaff text DEFAULT NULL, -- Staff notes attached to request + orderid varchar(50) DEFAULT NULL, -- Backend id attached to request + backend varchar(20) DEFAULT NULL, -- The backend used to create request + CONSTRAINT `illrequests_bnfk` + FOREIGN KEY (`borrowernumber`) + REFERENCES `borrowers` (`borrowernumber`) + ON UPDATE CASCADE ON DELETE CASCADE, + CONSTRAINT `illrequests_bcfk_2` + FOREIGN KEY (`branchcode`) + REFERENCES `branches` (`branchcode`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Table structure for table `illrequestattributes` +-- + +DROP TABLE IF EXISTS `illrequestattributes`; +CREATE TABLE illrequestattributes ( + illrequest_id bigint(20) unsigned NOT NULL, -- ILL request number + type varchar(200) NOT NULL, -- API ILL property name + value text NOT NULL, -- API ILL property value + PRIMARY KEY (`illrequest_id`,`type`), + CONSTRAINT `illrequestattributes_ifk` + FOREIGN KEY (illrequest_id) + REFERENCES `illrequests` (`illrequest_id`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + /*!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/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 3e0f93b13d..f514c3c7f6 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -193,6 +193,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('IDreamBooksResults','0','','Display IDreamBooks.com rating in search results','YesNo'), ('IDreamBooksReviews','0','','Display book review snippets from IDreamBooks.com','YesNo'), ('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'), +('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'), ('ILS-DI','0','','Enables ILS-DI services at OPAC.','YesNo'), ('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'), ('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'), diff --git a/installer/data/mysql/userflags.sql b/installer/data/mysql/userflags.sql index cf2adff28a..854e88278b 100644 --- a/installer/data/mysql/userflags.sql +++ b/installer/data/mysql/userflags.sql @@ -18,5 +18,6 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES (18,'coursereserves','Course reserves',0), (19, 'plugins', 'Koha plugins', '0'), (20, 'lists', 'Lists', 0), -(21, 'clubs', 'Patron clubs', '0') +(21, 'clubs', 'Patron clubs', '0'), +(22,'ill','The Interlibrary Loans Module',0) ; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index ab8cfa5c84..ae4e693dbc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -65,6 +65,14 @@ Administration: choices: yes: "The logged-in library" no: "All libraries" + Interlibrary Loans: + - + - pref: ILLModule + default: 0 + choices: + yes: Enable + no: Disable + - the interlibrary loans module (master switch). Login options: - - "Inactivity timeout in seconds to automatically log out users: " -- 2.12.2