From: miker Date: Mon, 8 Sep 2008 17:58:07 +0000 (+0000) Subject: backporting status filter for pull list method from trunk (carrying expire-time check... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d01945a657b44c881882e9652288afc5776bdcb7;p=Evergreen.git backporting status filter for pull list method from trunk (carrying expire-time check along with it, just because) git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@10555 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 19e6f983bd..4077203648 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -358,6 +358,9 @@ sub hold_pull_list { my $idlist = 1 if ($self->api_name =~/id_list/o); + my $status_filter = ''; + $status_filter = 'AND a.status IN (0,7)' if ($self->api_name =~/status_filtered/o); + my $select = <<" SQL"; SELECT h.* FROM $h_table h @@ -365,6 +368,8 @@ sub hold_pull_list { WHERE a.circ_lib = ? AND h.capture_time IS NULL AND h.cancel_time IS NULL + AND (h.expire_time IS NULL OR h.expire_time > NOW()) + $status_filter ORDER BY h.request_time ASC LIMIT $limit OFFSET $offset @@ -409,6 +414,34 @@ __PACKAGE__->register_method( ], method => 'hold_pull_list', ); +__PACKAGE__->register_method( + api_name => 'open-ils.storage.direct.action.hold_request.pull_list.id_list.current_copy_circ_lib.status_filtered', + api_level => 1, + stream => 1, + signature => [ + "Returns the hold ids for a specific library's pull list that are definitely in that library, based on status.", + [ [org_unit => "The library's org id", "number"], + [limit => 'An optional page size, defaults to 10', 'number'], + [offset => 'Offset for paging, defaults to 0, 0 based', 'number'], + ], + ['A list of holds for the stated library to pull for', 'array'] + ], + method => 'hold_pull_list', +); +__PACKAGE__->register_method( + api_name => 'open-ils.storage.direct.action.hold_request.pull_list.search.current_copy_circ_lib.status_filtered', + api_level => 1, + stream => 1, + signature => [ + "Returns the holds for a specific library's pull list that are definitely in that library, based on status.", + [ [org_unit => "The library's org id", "number"], + [limit => 'An optional page size, defaults to 10', 'number'], + [offset => 'Offset for paging, defaults to 0, 0 based', 'number'], + ], + ['A list of holds for the stated library to pull for', 'array'] + ], + method => 'hold_pull_list', +); sub find_optional_surveys { my $self = shift;