From d3032d9b0456fe152998ba1a8c0a2bc461fd1a73 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 17 Jul 2018 13:50:43 +0000 Subject: [PATCH] Bug 21082: Database updates Signed-off-by: Sandy Allgood Signed-off-by: Chris Cormack --- ...-add_option_for_overdrive_patron_auth.perl | 16 ++++++++++++++ installer/data/mysql/kohastructure.sql | 12 +++++++++++ installer/data/mysql/sysprefs.sql | 1 + .../admin/preferences/enhanced_content.pref | 21 +++++++++++++++---- 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_21082-add_option_for_overdrive_patron_auth.perl diff --git a/installer/data/mysql/atomicupdate/bug_21082-add_option_for_overdrive_patron_auth.perl b/installer/data/mysql/atomicupdate/bug_21082-add_option_for_overdrive_patron_auth.perl new file mode 100644 index 0000000000..8d3742f2c0 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_21082-add_option_for_overdrive_patron_auth.perl @@ -0,0 +1,16 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do('DROP TABLE IF EXISTS branches_overdrive'); + $dbh->do( q| + CREATE TABLE IF NOT EXISTS branches_overdrive ( + `branchcode` VARCHAR( 10 ) NOT NULL , + `authname` VARCHAR( 255 ) NOT NULL , + PRIMARY KEY (`branchcode`) , + CONSTRAINT `branches_overdrive_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE + ) ENGINE = INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |); + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('OverDriveAuthname', '', 'Authname for OverDrive Patron Authentication, will be used as fallback if individual branch authname not set', NULL, 'Free');"); + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('OverDriveWebsiteID','', 'WebsiteID provided by OverDrive', NULL, 'Free');"); + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('OverDrivePasswordRequired','', 'Does the library require passwords for OverDrive SIP authentication', NULL, 'YesNo');"); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 21082 - Add overdrive patron auth method)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 95c36175d2..60277e743a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -271,6 +271,18 @@ CREATE TABLE `branches` ( -- information about your libraries or branches are st PRIMARY KEY (`branchcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `branches_overdrive` +-- + +DROP TABLE IF EXISTS `branches_overdrive`; +CREATE TABLE IF NOT EXISTS branches_overdrive ( + `branchcode` VARCHAR( 10 ) NOT NULL , + `authname` VARCHAR( 255 ) NOT NULL , + PRIMARY KEY (`branchcode`) , + CONSTRAINT `branches_overdrive_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `browser` -- diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index bc7af05dd8..71313a9594 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -420,6 +420,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OverDriveClientKey','','Client key for OverDrive integration','30','Free'), ('OverDriveClientSecret','','Client key for OverDrive integration','30','YesNo'), ('OverDriveLibraryID','','Library ID for OverDrive integration','','Integer'), +('OverDrivePasswordRequired','',NULL,'Does the library require passwords for OverDrive SIP authentication','YesNo'), ('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'), ('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'), ('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index 2d283ccc23..03fb7fc482 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -350,6 +350,14 @@ Enhanced Content: - and client secret - pref: OverDriveClientSecret - . + - + - "Authenticate using OverDrive website id #" + - pref: OverDriveWebsiteID + - . + - + - "Authenticate using OverDrive Authname" + - pref: OverDriveAuthName + - "(will be used as fallback if individual branch authname not set here)." - - "Show items from the OverDrive catalog of library #" - pref: OverDriveLibraryID @@ -359,10 +367,15 @@ Enhanced Content: choices: yes: Enable no: "Don't enable" - - users to access their OverDrive circulation history, and circulate items. - - If you enable access, you must register auth return url of - - http(s)://my.opac.hostname/cgi-bin/koha/external/overdrive/auth.pl - - with OverDrive. + - users to access their OverDrive circulation history, and circulate items.
+ - A password is + - pref: OverDrivePasswordRequired + choices: + yes: Required + no: Not required + - for user access to OverDrive.
+ - If you enable access you must have a SIP connection registered with + - OverDrive for patron authentication against Koha RecordedBooks: - - Include RecordedBooks availability information with the client secret -- 2.19.0