From: Bill Erickson Date: Wed, 28 Dec 2011 14:54:32 +0000 (-0500) Subject: Use hold current shelf lib to determine availability : SIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f4c5013abfb8ce026fb21d4fdcd985e09c55aa67;p=evergreen%2Fmasslnc.git Use hold current shelf lib to determine availability : SIP The availability of a hold can now be determined by hold.current_shelf_lib == hold.pickup_lib. This change updates the unavailable holds count function for the patron information SIP call(s). Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index d2b2085af6..68d8c13655 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -624,16 +624,27 @@ sub recall_items { sub unavail_holds { my ($self, $start, $end) = @_; syslog('LOG_DEBUG', 'OILS: Patron->unavail_holds()'); + + my $ids = $self->{editor}->json_query({ + select => {ahr => ['id']}, + from => 'ahr', + where => { + usr => $self->{user}->id, + fulfillment_time => undef, + cancel_time => undef, + '-or' => [ + {current_shelf_lib => undef}, + {current_shelf_lib => {'!=' => {'+ahr' => 'pickup_lib'}}} + ] + } + }); my @holds_sip_output = map { OpenILS::SIP::clean_text($self->__hold_to_title($_)) } @{ - $self->{editor}->search_action_hold_request({ - usr => $self->{user}->id, - fulfillment_time => undef, - cancel_time => undef, - shelf_time => undef - }) + $self->{editor}->search_action_hold_request( + {id => [map {$_->{id}} @$ids]} + ) }; return (defined $start and defined $end) ?