From 4a1ff8534a1ddd54fdd6669ef8f8283af375c0b0 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. Signed-off-by: Magnus Enger Signed-off-by: Tomas Cohen Arazi Signed-off-by: Benjamin Rokseth Signed-off-by: Jonathan Druart --- .../data/mysql/atomicupdate/ill_tables.sql | 55 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 49 +++++++++++++++++ installer/data/mysql/sysprefs.sql | 2 + installer/data/mysql/userflags.sql | 3 +- .../en/modules/admin/preferences/admin.pref | 13 +++++ 5 files changed, 121 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..cab65f2a9e --- /dev/null +++ b/installer/data/mysql/atomicupdate/ill_tables.sql @@ -0,0 +1,55 @@ +-- 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'); + +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES + ('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'); + +-- Userflags + +INSERT INTO userflags (bit,flag,flagdesc,defaulton) +VALUES (22,'ill','The Interlibrary Loans Module',0); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 36481ad3f6..4f2bd983b5 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4126,6 +4126,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 51203f0842..e54e2ae15c 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -200,6 +200,8 @@ 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'), +('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'), ('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 2e8dce78da..d9d5e4932a 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,19 @@ 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). + - + - "Adding text will enable the copyright clearance stage in request creation. The text you enter will be the text displayed." + - pref: ILLModuleCopyrightClearance + type: textarea + class: long Login options: - - "Inactivity timeout in seconds to automatically log out users: " -- 2.39.5