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 <magnus@libriotech.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Alex Sassmannshausen 2016-09-22 16:20:14 +02:00 committed by Jonathan Druart
parent 1415176902
commit 4a1ff8534a
5 changed files with 121 additions and 1 deletions

View file

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

View file

@ -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 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; ) 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 */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

View file

@ -200,6 +200,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('IDreamBooksResults','0','','Display IDreamBooks.com rating in search results','YesNo'), ('IDreamBooksResults','0','','Display IDreamBooks.com rating in search results','YesNo'),
('IDreamBooksReviews','0','','Display book review snippets from IDreamBooks.com','YesNo'), ('IDreamBooksReviews','0','','Display book review snippets from IDreamBooks.com','YesNo'),
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','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','0','','Enables ILS-DI services at OPAC.','YesNo'),
('ILS-DI:AuthorizedIPs','','Restricts usage of ILS-DI to some IPs','.','Free'), ('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'), ('ImageLimit','5','','Limit images stored in the database by the Patron Card image manager to this number.','Integer'),

View file

@ -18,5 +18,6 @@ INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES
(18,'coursereserves','Course reserves',0), (18,'coursereserves','Course reserves',0),
(19, 'plugins', 'Koha plugins', '0'), (19, 'plugins', 'Koha plugins', '0'),
(20, 'lists', 'Lists', 0), (20, 'lists', 'Lists', 0),
(21, 'clubs', 'Patron clubs', '0') (21, 'clubs', 'Patron clubs', '0'),
(22,'ill','The Interlibrary Loans Module',0)
; ;

View file

@ -65,6 +65,19 @@ Administration:
choices: choices:
yes: "The logged-in library" yes: "The logged-in library"
no: "All libraries" 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: Login options:
- -
- "Inactivity timeout in seconds to automatically log out users: " - "Inactivity timeout in seconds to automatically log out users: "