From f2ebfc1ce6c1e47561ab6ceb8dfe57faf68d0cb1 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 24 Mar 2009 17:47:29 +0000 Subject: [PATCH] sort on picklist name. ranged, fleshed distribution formula fetcher git-svn-id: svn://svn.open-ils.org/ILS/trunk@12653 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Acq/Picklist.pm | 34 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm index 9af5551b43..6e80da7977 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm @@ -178,8 +178,10 @@ sub retrieve_user_picklist { return $e->die_event unless $e->checkauth; # don't grab the PL with name == "", because that is the designated temporary picklist - my $list = $e->search_acq_picklist( - {owner=>$e->requestor->id, name=>{'!='=>''}}, + my $list = $e->search_acq_picklist([ + {owner=>$e->requestor->id, name=>{'!='=>''}}, + {order_by => {acqpl => 'name'}} + ], {idlist=>1} ); @@ -503,5 +505,33 @@ sub zsearch_build_pl { +__PACKAGE__->register_method( + method => 'ranged_distrib_formulas', + api_name => 'open-ils.acq.distribution_formula.ranged.retrieve', + stream => 1, + signature => { + desc => 'Ranged distribution formulas, fleshed with entries', + params => [ + {desc => 'Authentication token', type => 'string'}, + ], + return => {desc => 'List of distribution formulas'} + } +); + +sub ranged_distrib_formulas { + my($self, $conn, $auth) = @_; + my $e = new_editor(authtoken=>$auth); + return $e->event unless $e->checkauth; + my $orgs = $U->user_has_work_perm_at($e, 'CREATE_PICKLIST', {descendants =>1}); + my $forms = $e->search_acq_distribution_formula([ + {owner => $orgs}, + {flesh => 1, flesh_fields => {acqdf => ['entries']}} + ]); + $conn->respond($_) for @$forms; + return undef; +} + + + 1; -- 2.11.0