From 120d739dcf57724a3e7123b506dc6aacc11f70d9 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 20 May 2008 20:37:13 +0000 Subject: [PATCH] added initial lineitem search git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9645 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Acq/Picklist.pm | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm index 21f7cc5300..71e31604e5 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm @@ -713,6 +713,35 @@ sub zsearch { return {complete=>1, picklist_id=>$picklist->id}; } +__PACKAGE__->register_method( + method => 'lineitem_search', + api_name => 'open-ils.acq.lineitem.search', + stream => 1, + signature => { + desc => 'Searches lineitems', + params => [ + {desc => 'Authentication token', type => 'string'}, + {desc => 'Search definition', type => 'object'}, + {desc => 'Optoins hash. idlist=true', type => 'object'}, + {desc => 'List of lineitems', type => 'object/number'}, + ] + } +); + +sub lineitem_search { + my($self, $conn, $auth, $search, $options) = @_; + my $e = new_editor(authtoken=>$auth, xact=>1); + return $e->event unless $e->checkauth; + return $e->event unless $e->allowed('CREATE_PICKLIST'); + # XXX needs serious permissions consideration! + my $pls = $e->search_acq_lineitem($search, {idlist=>$$options{idlist}}); + for my $pl (@$pls) { + $pl->clear_marc if $$options{clear_marc}; + $conn->respond($_) for $pl; + } + return undef; +} + -- 2.11.0