TPAC: recover the ability to override hold placement failures user/berick/tpac-recover-hold-overrides
authorBill Erickson <berick@esilibrary.com>
Tue, 22 May 2012 20:22:14 +0000 (16:22 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 22 May 2012 21:05:26 +0000 (17:05 -0400)
There is a certain class of hold failure events (e.g. HOLD_EXISTS,
HOLD_ITEM_CHECKED_OUT) that can be overridden by patrons when they have
the correct override permission.  This change recovers that ability,
which was recently removed with 99e8fc893a.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm

index eaa9622..e349f3f 100644 (file)
@@ -905,7 +905,8 @@ sub attempt_hold_placement {
                             $hdata->{could_override} = 1;
                             $hdata->{age_protect} = 1;
                         } else {
-                            $hdata->{could_override} = $result->{place_unfillable};
+                            $hdata->{could_override} = $result->{place_unfillable} || 
+                                $self->test_could_override($hdata->{hold_failed_event});
                         }
                     } elsif (ref $result eq 'ARRAY') {
                         $hdata->{hold_failed_event} = $result->[0];
@@ -914,7 +915,8 @@ sub attempt_hold_placement {
                             $hdata->{could_override} = 1;
                             $hdata->{age_protect} = 1;
                         } else {
-                            $hdata->{could_override} = $result->[4]; # place_unfillable
+                            $hdata->{could_override} = $result->[4] || # place_unfillable
+                                $self->test_could_override($hdata->{hold_failed_event});
                         }
                     }
                 }