From: Bill Erickson Date: Tue, 27 Dec 2011 21:20:08 +0000 (-0500) Subject: Use hold current shelf lib to determine availability : opac hold count X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=85716b57f62b9de89327561f37cc3807d5fd6787;p=evergreen%2Fmasslnc.git Use hold current shelf lib to determine availability : opac hold count The availability of a hold can now be determined by hold.current_shelf_lib == hold.pickup_lib. This change updates the API call for open hold counts for a patron. open-ils.actor.user.hold_requests.count Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index c54debf431..93f1a75274 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -1840,7 +1840,7 @@ sub hold_request_count { } my $holds = $e->json_query({ - select => {ahr => ['shelf_time']}, + select => {ahr => ['pickup_lib', 'current_shelf_lib']}, from => 'ahr', where => { usr => $user_id, @@ -1851,7 +1851,12 @@ sub hold_request_count { return { total => scalar(@$holds), - ready => scalar(grep { $_->{shelf_time} } @$holds) + ready => scalar( + grep { + $_->{current_shelf_lib} and # avoid undef warnings + $_->{pickup_lib} eq $_->{current_shelf_lib} + } @$holds + ) }; }