Bug 21082: Database updates
authorNick Clemens <nick@bywatersolutions.com>
Tue, 17 Jul 2018 13:50:43 +0000 (13:50 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 9 Oct 2018 11:04:22 +0000 (11:04 +0000)
Signed-off-by: Sandy Allgood <sandy.allgood@citruslibraries.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
installer/data/mysql/atomicupdate/bug_21082-add_option_for_overdrive_patron_auth.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref

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 (file)
index 0000000..8d3742f
--- /dev/null
@@ -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";
+}
index c4d47d2..c17a8e1 100644 (file)
@@ -272,6 +272,18 @@ CREATE TABLE `branches` ( -- information about your libraries or branches are st
 ) 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`
 --
 DROP TABLE IF EXISTS `browser`;
index bc7af05..71313a9 100644 (file)
@@ -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'),
index 2d283cc..03fb7fc 100644 (file)
@@ -351,6 +351,14 @@ Enhanced Content:
             - 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 <a href=\"/cgi-bin/koha/admin/overdrive.pl\">here</a>)."
+        -
             - "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.<br />
+            - A password is
+            - pref: OverDrivePasswordRequired
+              choices:
+                  yes: Required
+                  no: Not required
+            - for user access to OverDrive. <br />
+            - 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