Bug 13436: (RM followup) university -> academic DB update
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 19 Dec 2014 19:45:23 +0000 (16:45 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 19 Dec 2014 19:48:13 +0000 (16:48 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl

index c3e308f..db9fd84 100644 (file)
@@ -448,7 +448,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('UsageStatsID', '', NULL, 'This preference is part of Koha but it should not be deleted or updated manually.',  'Free'),
 ('UsageStatsLastUpdateTime', '', NULL, 'This preference is part of Koha but it should not be deleted or updated manually.', 'Free'),
 ('UsageStatsLibraryName', '', NULL, 'The library name to be shown on Hea Koha community website', 'Free'),
-('UsageStatsLibraryType', 'public', 'public|university', 'The library type to be shown on the Hea Koha community website', 'Choice'),
+('UsageStatsLibraryType', 'public', 'public|school|academic|research|private|societyAssociation|corporate|government|religiousOrg|subscription', 'The library type to be shown on the Hea Koha community website', 'Choice'),
 ('UsageStatsLibraryUrl', '', NULL, 'The library URL to be shown on Hea Koha community website', 'Free'),
 ('UseAuthoritiesForTracings','1','0','Use authority record numbers for subject tracings instead of heading strings.','YesNo'),
 ('UseBranchTransferLimits','0','','If ON, Koha will will use the rules defined in branch_transfer_limits to decide if an item transfer should be allowed.','YesNo'),
index a0698ef..2c34148 100755 (executable)
@@ -9585,6 +9585,20 @@ if ( CheckVersion($DBversion) ) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("
+        UPDATE systempreferences
+        SET options = 'public|school|academic|research|private|societyAssociation|corporate|government|religiousOrg|subscription'
+        WHERE variable = 'UsageStatsLibraryType'
+    ");
+    if ( C4::Context->preference("UsageStatsLibraryType") eq "university" ) {
+        C4::Context->set_preference("UsageStatsLibraryType", "academic")
+    }
+    print "Upgrade to $DBversion done (Bug 13436: Add more options to UsageStatsLibraryType)\n";
+    SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)