Removing unconditionnal warning
[koha.git] / installer / data / mysql / updatedatabase.pl
index 43e0ef1..1183375 100755 (executable)
@@ -15,7 +15,7 @@
 # NOTE: Please keep the version in kohaversion.pl up-to-date!
 
 use strict;
-use warnings;
+use warnings;
 
 # CPAN modules
 use DBI;
@@ -742,7 +742,6 @@ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,ty
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo')");
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACURLOpenInNewWindow',0,'If ON, URLs in the OPAC open in a new window',NULL,'YesNo')");
 $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACUserCSS',0,'Add CSS to be included in the OPAC',NULL,'free')");
-$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('emailPurchaseSuggestions',0,'If ON, patron suggestions are emailed rather than managed in Acquisitions',NULL,'YesNo')");
 
     print "Upgrade to $DBversion done (adding additional system preference)\n";
     SetVersion ($DBversion);
@@ -812,7 +811,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('uppercasesurnames',0,'If ON, surnames are converted to upper case in patron entry form',NULL,'YesNo')");
     $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl','ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','PickupLibrary|PatronLibrary|ItemHomeLibrary','Choice')");
     $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar','noFinesWhenClosed','Specify whether to use the Calendar in calculating duedates and fines','ignoreCalendar|noFinesWhenClosed','Choice')");
-    $dbh->do("DELETE FROM `systempreferences` WHERE variable='HomeOrHoldingBranch'");
+    # $dbh->do("DELETE FROM `systempreferences` WHERE variable='HomeOrHoldingBranch'"); # Bug #2752
     print "Upgrade to $DBversion done ('add circ sysprefs CircControl, finesCalendar, and uppercasesurnames, and delete HomeOrHoldingBranch.')\n";
     SetVersion ($DBversion);
 }
@@ -1379,12 +1378,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
        #);
        $dbh->do(q#
        INSERT INTO `systempreferences` VALUES
-               ('BakerTaylorBookstoreURL','','','URL template for \"My Libary Bookstore\" links, to which the \"key\" value is appended, and \"https://\" is prepended.  It should include your hostname and \"Parent Number\".  Make this variable empty to turn MLB links off.<br /> Example: ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&parentNum=10923&key=',''),
+               ('BakerTaylorBookstoreURL','','','URL template for \"My Libary Bookstore\" links, to which the \"key\" value is appended, and \"https://\" is prepended.  It should include your hostname and \"Parent Number\".  Make this variable empty to turn MLB links off.  Example: ocls.mylibrarybookstore.com/MLB/actions/searchHandler.do?nextPage=bookDetails&parentNum=10923&key=',''),
                ('BakerTaylorEnabled','0','','Enable or disable all Baker & Taylor features.','YesNo'),
                ('BakerTaylorPassword','','','Baker & Taylor Password for Content Cafe (external content)','Textarea'),
                ('BakerTaylorUsername','','','Baker & Taylor Username for Content Cafe (external content)','Textarea'),
                ('TagsEnabled','1','','Enables or disables all tagging features.  This is the main switch for tags.','YesNo'),
-               ('TagsExternalDictionary',NULL,'','Path on server to local ispell executable, used to set $Lingua::Ispell::path <br />This dictionary is used as a \"whitelist\" of pre-allowed tags.',''),
+               ('TagsExternalDictionary',NULL,'','Path on server to local ispell executable, used to set $Lingua::Ispell::path  This dictionary is used as a \"whitelist\" of pre-allowed tags.',''),
                ('TagsInputOnDetail','1','','Allow users to input tags from the detail page.',         'YesNo'),
                ('TagsInputOnList',  '0','','Allow users to input tags from the search results list.', 'YesNo'),
                ('TagsModeration',  NULL,'','Require tags from patrons to be approved before becoming visible.','YesNo'),
@@ -1921,6 +1920,55 @@ END_SQL
     SetVersion($DBversion);
 }
 
+$DBversion = "3.00.00.106";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("DELETE FROM systempreferences WHERE variable='noOPACHolds'");
+
+# db revision 105 didn't apply correctly, so we're rolling this into 106
+       $dbh->do("INSERT INTO `systempreferences`
+   (variable,value,explanation,options,type)
+       VALUES
+       ('SMSSendDriver','','Sets which SMS::Send driver is used to send SMS messages.','','free')");
+
+    print "Upgrade to $DBversion done (remove default '0000-00-00' in subscriptionhistory.enddate field)\n";
+    $dbh->do("ALTER TABLE `subscriptionhistory` CHANGE `enddate` `enddate` DATE NULL DEFAULT NULL ");
+    $dbh->do("UPDATE subscriptionhistory SET enddate=NULL WHERE enddate='0000-00-00'");
+    SetVersion ($DBversion);
+}
+
+$DBversion = '3.00.00.107';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do(<<'END_SQL');
+UPDATE systempreferences
+  SET explanation = CONCAT( explanation, '. WARNING: this feature is very resource consuming on collections with large numbers of items.' )
+  WHERE variable = 'OPACShelfBrowser'
+    AND explanation NOT LIKE '%WARNING%'
+END_SQL
+    $dbh->do(<<'END_SQL');
+UPDATE systempreferences
+  SET explanation = CONCAT( explanation, '. WARNING: this feature is very resource consuming.' )
+  WHERE variable = 'CataloguingLog'
+    AND explanation NOT LIKE '%WARNING%'
+END_SQL
+    $dbh->do(<<'END_SQL');
+UPDATE systempreferences
+  SET explanation = CONCAT( explanation, '. WARNING: using NoZebra on even modest sized collections is very slow.' )
+  WHERE variable = 'NoZebra'
+    AND explanation NOT LIKE '%WARNING%'
+END_SQL
+    print "Upgrade to $DBversion done (warning added to OPACShelfBrowser system preference)\n";
+    SetVersion ($DBversion);
+}
+if (C4::Context->preference("Version") =~/3\.00/) {
+        my $perllibdir=C4::Context->config('intranetdir');
+       my $return=do qq($perllibdir/installer/data/mysql/updatedatabase30.pl);
+       unless ($return){
+               print STDERR "cannot read file $perllibdir/installer/data/mysql/updatedatabase30.pl : $! \n" if ($!);
+               print STDERR "cannot read file $ENV{'PERL5LIB'}/installer/data/mysql/updatedatabase30.pl : $@ \n" if ($@);
+       }
+}
+
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table