SetVersion ($DBversion);
}
-$DBversion = "3.00.04.021";
+$DBversion = "3.00.05.001";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do(<<DEFAULTBRANCHRULES);
CREATE TABLE `default_branch_item_rules` (
DEFAULTBRANCHRULES
}
+$DBversion = "3.00.05.001";
+#$DBversion = "3.01.00.012";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldPolicyOverride', '0', 'Allow staff to override hold policies when placing holds',NULL,'YesNo')");
+ $dbh->do("
+ CREATE TABLE `branch_item_rules` (
+ `branchcode` varchar(10) NOT NULL,
+ `itemtype` varchar(10) NOT NULL,
+ `holdallowed` tinyint(1) default NULL,
+ PRIMARY KEY (`itemtype`,`branchcode`),
+ KEY `branch_item_rules_ibfk_2` (`branchcode`),
+ CONSTRAINT `branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `branch_item_rules_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ ");
+ $dbh->do("
+ ALTER TABLE default_branch_circ_rules
+ ADD COLUMN holdallowed tinyint(1) NULL
+ ");
+ $dbh->do("
+ ALTER TABLE default_circ_rules
+ ADD COLUMN holdallowed tinyint(1) NULL
+ ");
+ print "Upgrade to $DBversion done (Add tables and system preferences for holds policies)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.05.002";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("UPDATE systempreferences SET options = 'Calendar|Days|Datedue' WHERE variable = 'useDaysMode'");
+
+ print "Upgrade to $DBversion done (upgrade useDaysMode syspref)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.05.003";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("UPDATE language_rfc4646_to_iso639 SET iso639_2_code = 'por' WHERE rfc4646_subtag='pt' ");
+ print "Upgrade to $DBversion done (corrected ISO 639-2 language code for Portuguese)\n";
+
+ SetVersion ($DBversion);
+}
+
+
+$DBversion = "3.00.06.001";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ my $value = $dbh->selectrow_array("SELECT value FROM systempreferences WHERE variable = 'HomeOrHoldingBranch'");
+ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','$value','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice');");
+ print "Upgrade to $DBversion done (Add HomeOrHoldingBranchReturn system preference)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.06.002";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE issues CHANGE COLUMN `itemnumber` `itemnumber` int(11) UNIQUE DEFAULT NULL;");
+ $dbh->do("ALTER TABLE serialitems ADD CONSTRAINT `serialitems_sfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE;");
+ print "Upgrade to $DBversion done (Improve serialitems table security)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.06.003";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("UPDATE systempreferences set value='../koha-tmpl/opac-tmpl/prog/en/xslt/".C4::Context->preference('marcflavour')."slim2OPACDetail.xsl',type='Free' where variable='XSLTDetailsDisplay' AND value=1;");
+ $dbh->do("UPDATE systempreferences set value='../koha-tmpl/opac-tmpl/prog/en/xslt/".C4::Context->preference('marcflavour')."slim2OPACResults.xsl',type='Free' where variable='XSLTResultsDisplay' AND value=1;");
+ print "Upgrade to $DBversion done (Improve XSLT)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.00.06.004";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IndependentBranchPatron','0','If ON, librarian patron search can only be done on patron of same library as librarian',NULL,'YesNo');");
+ print "Upgrade to $DBversion done (Add IndependentBranchPatron system preference to be able to limit patron search to librarian's Library)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = '3.00.06.005';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do(qq{INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACviewISBD','1','Allow display of ISBD view of bibiographic records in OPAC','','YesNo');});
+ $dbh->do(qq{INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACviewMARC','1','Allow display of MARC view of bibiographic records in OPAC','','YesNo');});
+
+ print "Upgrade to $DBversion done (Added OPAC ISBD and MARC view sysprefs)\n";
+ SetVersion ($DBversion);
+}
+
+
+
=item DropAllForeignKeys($table)