From 1bf6cf1f9ebacab7659d6ac4dea088bfb6a39293 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 10 Mar 2006 18:09:20 +0000 Subject: [PATCH] adding pull list method for bill git-svn-id: svn://svn.open-ils.org/ILS/trunk@3328 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../Application/Storage/Publisher/action.pm | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) 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 77cd0cfbff..11dad44da5 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -1,5 +1,5 @@ package OpenILS::Application::Storage::Publisher::action; -use base qw/OpenILS::Application::Storage/; +use base qw/OpenILS::Application::Storage::Publisher/; use OpenSRF::Utils::Logger qw/:level/; use OpenSRF::Utils qw/:datetime/; use OpenSRF::AppSession; @@ -262,6 +262,50 @@ __PACKAGE__->register_method( method => 'find_opac_surveys', ); +sub hold_pull_list { + my $self = shift; + my $client = shift; + my $ou = shift; + my $limit = shift || 10; + my $offset = shift || 0; + + return undef unless ($ou); + my $h_table = action::hold_request->table; + my $a_table = asset::copy->table; + + my $select = <<" SQL"; + SELECT h.* + FROM $h_table h + JOIN $a_table a ON (h.current_copy = a.id) + WHERE a.circ_lib = ? + AND h.capture_time IS NULL + ORDER BY h.request_time ASC + LIMIT $limit + OFFSET $offset + SQL + + my $sth = action::survey->db_Main->prepare_cached($select); + $sth->execute($ou); + + $client->respond( $_->to_fieldmapper ) for ( map { action::hold_request->construct($_) } $sth->fetchall_hash ); + + return undef; +} +__PACKAGE__->register_method( + api_name => 'open-ils.storage.direct.action.hold_request.pull_list.search.current_copy_circ_lib', + api_level => 1, + stream => 1, + signature => [ + "Returns the holds for a specific library's pull list.", + [ [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; my $client = shift; -- 2.43.2