Fix for Bug 4449: AllowHoldPolicyOverride cannot over all policies github/bug_4449 origin/new/enh/bug_4449
authorIan Walls <ian.walls@bywatersolutions.com>
Thu, 9 Sep 2010 20:19:10 +0000 (16:19 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Fri, 8 Apr 2011 23:39:50 +0000 (11:39 +1200)
AllowHoldPolicyOverride should be able to override AllowOnShelfHolds, as well as other possible reasons for blocking a hold. Before, this only
allowed override of branch policies set in Circ Rules.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
reserve/request.pl

index 7e51364..e8942b4 100755 (executable)
@@ -428,10 +428,7 @@ foreach my $biblionumber (@biblionumbers) {
             }
             
             if (IsAvailableForItemLevelRequest($itemnumber) and not $item->{cantreserve} and CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) {
-                if ( not $policy_holdallowed and C4::Context->preference( 'AllowHoldPolicyOverride' ) ) {
-                    $item->{override} = 1;
-                    $num_override++;
-                } elsif ( $policy_holdallowed ) {
+                if ( $policy_holdallowed ) {
                     $item->{available} = 1;
                     $num_available++;
                 }
@@ -439,6 +436,12 @@ foreach my $biblionumber (@biblionumbers) {
                     $item->{override} = 1;
                     $num_override++;
             }
+            # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
+            if (C4::Context->preference( 'AllowHoldPolicyOverride' ) ) {
+                $item->{override} = 1;
+                $num_override++;
+            }   
+
             # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
             
             # FIXME: move this to a pm