[Koha-patches] [PATCH] Bug 3712 [3.0.x], DBupdate 019

Zeno Tajoli tajoli at cilea.it
Tue Oct 20 10:16:43 CEST 2009


---
 admin/systempreferences.pl                     |    6 ++++--
 installer/data/mysql/en/mandatory/sysprefs.sql |    4 +++-
 installer/data/mysql/updatedatabase.pl         |    1 -
 installer/data/mysql/updatedatabase30.pl       |   23 +++++++++++++++++++++++
 kohaversion.pl                                 |    2 +-
 5 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl
index 904fb4b..28fc92c 100755
--- a/admin/systempreferences.pl
+++ b/admin/systempreferences.pl
@@ -116,7 +116,7 @@ $tabsysprefs{Stemming}                    = "Cataloging";
 $tabsysprefs{WeightFields}                = "Cataloging";
 $tabsysprefs{NoZebra}                     = "Cataloging";
 $tabsysprefs{NoZebraIndexes}              = "Cataloging";
-$tabsysprefs{ReceiveBackIssues}           = "Cataloging";
+#$tabsysprefs{ReceiveBackIssues}           = "Cataloging";
 $tabsysprefs{DefaultClassificationSource} = "Cataloging";
 $tabsysprefs{RoutingSerials}              = "Cataloging";
 $tabsysprefs{'item-level_itypes'}         = "Cataloging";
@@ -138,6 +138,7 @@ $tabsysprefs{useDaysMode}                    = "Circulation";
 $tabsysprefs{ReservesNeedReturns}            = "Circulation";
 $tabsysprefs{CircAutocompl}                  = "Circulation";
 $tabsysprefs{AllowRenewalLimitOverride}      = "Circulation";
+$tabsysprefs{AllowNotForLoanOverride}        = "Circulation";
 $tabsysprefs{canreservefromotherbranches}    = "Circulation";
 $tabsysprefs{finesMode}                      = "Circulation";
 $tabsysprefs{emailLibrarianWhenHoldIsPlaced} = "Circulation";
@@ -166,12 +167,12 @@ $tabsysprefs{yuipath}                 = "StaffClient";
 $tabsysprefs{IntranetmainUserblock}   = "StaffClient";
 
 # Patrons
+#$tabsysprefs{ReadingHistory}               = "Patrons";
 $tabsysprefs{autoMemberNum}                = "Patrons";
 $tabsysprefs{checkdigit}                   = "Patrons";
 $tabsysprefs{intranetreadinghistory}       = "Patrons";
 $tabsysprefs{NotifyBorrowerDeparture}      = "Patrons";
 $tabsysprefs{memberofinstitution}          = "Patrons";
-$tabsysprefs{ReadingHistory}               = "Patrons";
 $tabsysprefs{BorrowerMandatoryField}       = "Patrons";
 $tabsysprefs{borrowerRelationship}         = "Patrons";
 $tabsysprefs{BorrowersTitles}              = "Patrons";
@@ -216,6 +217,7 @@ $tabsysprefs{AmazonContent}          = "EnhancedContent";
 $tabsysprefs{AWSAccessKeyID}         = "EnhancedContent";
 $tabsysprefs{AWSPrivateKey}          = "EnhancedContent";
 $tabsysprefs{AmazonLocale}           = "EnhancedContent";
+$tabsysprefs{OPACAmazonCoverImages}  = "EnhancedContent";
 $tabsysprefs{AmazonAssocTag}         = "EnhancedContent";
 $tabsysprefs{AmazonSimilarItems}     = "EnhancedContent";
 $tabsysprefs{OPACAmazonContent}      = "EnhancedContent";
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql
index 7b3cea2..4ced11d 100644
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -208,7 +208,7 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowOnShelfHolds', '0', '', 'Allow hold requests to be placed on items that are not on loan', 'YesNo');
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('AllowHoldsOnDamagedItems', '1', '', 'Allow hold requests to be placed on damaged items', 'YesNo');
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo');
--- FIXME: add FrameworksLoaded, noOPACUserLogin, ReadingHistory ?
+-- FIXME: add FrameworksLoaded, noOPACUserLogin ?
 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo');
@@ -218,3 +218,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewISBD','1','Allow display of ISBD view of bibiographic records','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewLabeledMARC','0','Allow display of labeled MARC view of bibiographic records','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('viewMARC','1','Allow display of MARC view of bibiographic records','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('AuthDisplayHierarchy','0','To display authorities in a hierarchy way. Put ON only if you have a thesaurus. Default is OFF','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('OPACAmazonCoverImages','0','Display cover images on OPAC from Amazon Web Services. Default is OFF','','YesNo');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 1183375..e107548 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -721,7 +721,6 @@ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,ty
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo')");
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'free')");
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'free')");
-$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to display for each result on a page of results',NULL,'free')");
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice')");
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice')");
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice')");
diff --git a/installer/data/mysql/updatedatabase30.pl b/installer/data/mysql/updatedatabase30.pl
index 00fa2e7..9e5d70f 100644
--- a/installer/data/mysql/updatedatabase30.pl
+++ b/installer/data/mysql/updatedatabase30.pl
@@ -598,6 +598,29 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }  
 
+
+$DBversion = "3.00.04.019";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dhb->do("DELETE systempreferences WHERE variale = 'maxItemsInSearchResults'");
+
+    my $authdisplayhierarchy = C4::Context->preference('AuthDisplayHierarchy');
+    if ($authdisplayhierarchy < 1){
+       $dhb->do("DELETE systempreferences WHERE variale = 'AuthDisplayHierarchy'");
+       $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('AuthDisplayHierarchy','0','To display authorities in a hierarchy way. Put ON only if you have a thesaurus. Default is OFF','','YesNo')");
+    };
+
+    my $opacamazon = C4::Context->preference('OPACAmazonCoverImages');
+    if ($authdisplayhierarchy < 1){
+       $dhb->do("DELETE systempreferences WHERE variale = 'OPACAmazonCoverImages'");
+       $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('OPACAmazonCoverImages','0','Display cover images on OPAC from Amazon Web Services. Default is OFF','','YesNo')");
+    };
+
+    print "Upgrade to $DBversion done (new AuthDisplayHierarchy, delete maxItemsInSearchResults, )\n";
+    SetVersion ($DBversion);
+}  
+
+
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
diff --git a/kohaversion.pl b/kohaversion.pl
index cbe5173..62e0770 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.00.04.018';
+    our $VERSION = '3.00.04.019';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.5.3.7




More information about the Koha-patches mailing list