From 7934f95494daee073d98f810e9b870965ff4cd5e Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 13 Nov 2007 14:11:13 -0600 Subject: [PATCH] Adding a system preference to choose whether a homebranch or a holdingbranch is used to check against for independentbranches Changing GanBookBeIssued to use this systempreference Set to homebranch by default Paul and others you might want to switch this to holdingbranch to get the behaviour you are used to Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Circulation.pm | 2 +- admin/systempreferences.pl | 1 + installer/data/mysql/updatedatabase.pl | 32 ++++++++++++++++++++++++++ kohaversion.pl | 2 +- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 45e964df5d..14692729ac 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -727,7 +727,7 @@ sub CanBookBeIssued { my $userenv = C4::Context->userenv; if ( ($userenv) && ( $userenv->{flags} != 1 ) ) { $issuingimpossible{NOTSAMEBRANCH} = 1 - if ( $item->{'holdingbranch'} ne $userenv->{branch} ); + if ( $item->{C4::Context->preference("HomeOrHoldingbranch")} ne $userenv->{branch} ); } } diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index d5e199694e..f49ac06387 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -61,6 +61,7 @@ my %tabsysprefs; $tabsysprefs{dateformat}="Admin"; $tabsysprefs{delimiter}="Admin"; $tabsysprefs{IndependantBranches}="Admin"; + $tabsysprefs{HomeOrHoldingBranch}="Admin"; $tabsysprefs{insecure}="Admin"; $tabsysprefs{KohaAdmin}="Admin"; $tabsysprefs{KohaAdminEmailAddress}="Admin"; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 34d03ce7e7..f308fde381 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -561,6 +561,38 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.023"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) + VALUES ('yuipath','http://yui.yahooapis.com/2.3.1/build','Insert the path to YUI libraries','','free')"); + print "Upgrade to $DBversion done (adding new system preference for controlling YUI path)\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.00.00.024"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE biblioitems CHANGE itemtype itemtype VARCHAR(10)"); + print "Upgrade to $DBversion done (changing itemtype to (10))\n"; + SetVersion ($DBversion); +} + +$DBversion = "3.00.00.025"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE items ADD COLUMN itype VARCHAR(10)"); + if(C4::Context->preference('item-level_itypes')){ + $dbh->do('update items,biblioitems set items.itype=biblioitems.itemtype where items.biblionumber=biblioitems.biblionumber and itype is null'); + } + print "Upgrade to $DBversion done (reintroduce items.itype - fill from itemtype)\n "; + SetVersion ($DBversion); +} + +$DBversion = "3.00.00.026"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) + VALUES ('HomeOrHoldingBranch','homebranch','homebranch|holdingbranch','With independent branches turned on this decides whether to check the items holdingbranch or homebranch at circulatilon','choice')"); + print "Upgrade to $DBversion done (adding new system preference for choosing whether homebranch or holdingbranch is checked in circulation)\n"; + SetVersion ($DBversion); +} =item DropAllForeignKeys($table) diff --git a/kohaversion.pl b/kohaversion.pl index abda80caec..fc3fcde19e 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -8,7 +8,7 @@ # and is automatically called by Auth.pm when needed. sub kohaversion { - return "3.00.00.025"; + return "3.00.00.026"; } 1; -- 2.39.5