From 7614cbf462a00c29b5870a8379d3c1f70ddc77d0 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 25 Mar 2015 10:31:53 -0300 Subject: [PATCH] Bug 5786: DBRev 3.19.00.017 Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/updatedatabase.pl | 70 +++++++++++++------------- kohaversion.pl | 2 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4e21562dfe..951060fd00 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9675,41 +9675,6 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } -$DBversion = '3.19.00.XXX'; -if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - # First create the column - $dbh->do("ALTER TABLE issuingrules ADD onshelfholds tinyint(1) default 0 NOT NULL"); - # Now update the column - if (C4::Context->preference("AllowOnShelfHolds")){ - # Pref is on, set allow for all rules - $dbh->do("UPDATE issuingrules SET onshelfholds=1"); - } else { - # If the preference is not set, leave off - $dbh->do("UPDATE issuingrules SET onshelfholds=0"); - } - # Remove from the systempreferences table - $dbh->do("DELETE FROM systempreferences WHERE variable = 'AllowOnShelfHolds'"); - - # First create the column - $dbh->do("ALTER TABLE issuingrules ADD opacitemholds char(1) DEFAULT 'N' NOT NULL"); - # Now update the column - my $opacitemholds = C4::Context->preference("OPACItemHolds") || ''; - if (lc ($opacitemholds) eq 'force') { - $opacitemholds = 'F'; - } - else { - $opacitemholds = $opacitemholds ? 'Y' : 'N'; - } - # Set allow for all rules - $dbh->do("UPDATE issuingrules SET opacitemholds='$opacitemholds'"); - - # Remove from the systempreferences table - $dbh->do("DELETE FROM systempreferences WHERE variable = 'OPACItemHolds'"); - - print "Upgrade to $DBversion done (Bug 5786 - Move AllowOnShelfHolds to circulation matrix; Move OPACItemHolds system preference to circulation matrix)\n"; - SetVersion ($DBversion); -} - $DBversion = "3.19.00.007"; if ( CheckVersion($DBversion) ) { my $orphan_budgets = $dbh->selectall_arrayref(q| @@ -9902,6 +9867,41 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = '3.19.00.017'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + # First create the column + $dbh->do("ALTER TABLE issuingrules ADD onshelfholds tinyint(1) default 0 NOT NULL"); + # Now update the column + if (C4::Context->preference("AllowOnShelfHolds")){ + # Pref is on, set allow for all rules + $dbh->do("UPDATE issuingrules SET onshelfholds=1"); + } else { + # If the preference is not set, leave off + $dbh->do("UPDATE issuingrules SET onshelfholds=0"); + } + # Remove from the systempreferences table + $dbh->do("DELETE FROM systempreferences WHERE variable = 'AllowOnShelfHolds'"); + + # First create the column + $dbh->do("ALTER TABLE issuingrules ADD opacitemholds char(1) DEFAULT 'N' NOT NULL"); + # Now update the column + my $opacitemholds = C4::Context->preference("OPACItemHolds") || ''; + if (lc ($opacitemholds) eq 'force') { + $opacitemholds = 'F'; + } + else { + $opacitemholds = $opacitemholds ? 'Y' : 'N'; + } + # Set allow for all rules + $dbh->do("UPDATE issuingrules SET opacitemholds='$opacitemholds'"); + + # Remove from the systempreferences table + $dbh->do("DELETE FROM systempreferences WHERE variable = 'OPACItemHolds'"); + + print "Upgrade to $DBversion done (Bug 5786 - Move AllowOnShelfHolds to circulation matrix; Move OPACItemHolds system preference to circulation matrix)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/kohaversion.pl b/kohaversion.pl index a2769f5525..7a29352c62 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -17,7 +17,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.19.00.016'; + our $VERSION = '3.19.00.017'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 2.39.5