From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Thu, 8 Apr 2010 21:50:20 +0000 (+0000) Subject: Tweak the descriptions for the on-shelf holds retrieval methods, and add a variant... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b05dfea293f979e1cf068432102e2cdba075e22e;p=evergreen%2Fmasslnc.git Tweak the descriptions for the on-shelf holds retrieval methods, and add a variant that filters to shelf-expired holds. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16182 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 39dd4a75e5..6141c61add 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -1427,7 +1427,7 @@ __PACKAGE__->register_method( api_name => 'open-ils.circ.captured_holds.on_shelf.retrieve', stream => 1, signature => q/ - Returns a list of un-fulfilled holds for a given title id + Returns a list of un-fulfilled holds (on the Holds Shelf) for a given title id @param authtoken The login session key @param org The org id of the location in question / @@ -1438,12 +1438,24 @@ __PACKAGE__->register_method( api_name => 'open-ils.circ.captured_holds.id_list.on_shelf.retrieve', stream => 1, signature => q/ - Returns a list ids of un-fulfilled holds for a given title id + Returns list ids of un-fulfilled holds (on the Holds Shelf) for a given title id @param authtoken The login session key @param org The org id of the location in question / ); +__PACKAGE__->register_method( + method => 'fetch_captured_holds', + api_name => 'open-ils.circ.captured_holds.id_list.expired_on_shelf.retrieve', + stream => 1, + signature => q/ + Returns list ids of shelf-expired un-fulfilled holds for a given title id + @param authtoken The login session key + @param org The org id of the location in question + / +); + + sub fetch_captured_holds { my( $self, $conn, $auth, $org ) = @_; @@ -1453,29 +1465,32 @@ sub fetch_captured_holds { $org ||= $e->requestor->ws_ou; - my $hold_ids = $e->json_query( - { - select => { ahr => ['id'] }, - from => { - ahr => { - acp => { - field => 'id', - fkey => 'current_copy' - }, - } - }, - where => { - '+acp' => { status => OILS_COPY_STATUS_ON_HOLDS_SHELF }, - '+ahr' => { - capture_time => { "!=" => undef }, - current_copy => { "!=" => undef }, - fulfillment_time => undef, - pickup_lib => $org, - cancel_time => undef, - } + my $query = { + select => { ahr => ['id'] }, + from => { + ahr => { + acp => { + field => 'id', + fkey => 'current_copy' + }, } - }, - ); + }, + where => { + '+acp' => { status => OILS_COPY_STATUS_ON_HOLDS_SHELF }, + '+ahr' => { + capture_time => { "!=" => undef }, + current_copy => { "!=" => undef }, + fulfillment_time => undef, + pickup_lib => $org, + cancel_time => undef, + } + } + }; + if($self->api_name =~ /expired/) { + $query->{'where'}->{'+ahr'}->{'shelf_expire_time'} = {'<' => 'now'}; + $query->{'where'}->{'+ahr'}->{'shelf_time'} = {'!=' => undef}; + } + my $hold_ids = $e->json_query( $query ); for my $hold_id (@$hold_ids) { if($self->api_name =~ /id_list/) {