Adding a system preference to choose whether a homebranch or a holdingbranch is used...
authorChris Cormack <chris@snaga.liblime.co.nz>
Tue, 13 Nov 2007 20:11:13 +0000 (14:11 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 13 Nov 2007 21:30:38 +0000 (15:30 -0600)
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 <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Circulation.pm
admin/systempreferences.pl
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index 45e964d..1469272 100644 (file)
@@ -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} );
         }
     }
 
index d5e1996..f49ac06 100755 (executable)
@@ -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";
index 34d03ce..f308fde 100755 (executable)
@@ -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)
 
index abda80c..fc3fcde 100644 (file)
@@ -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;