From: erickson Date: Tue, 24 Mar 2009 17:47:29 +0000 (+0000) Subject: sort on picklist name. ranged, fleshed distribution formula fetcher X-Git-Tag: sprint4-merge-nov22~10426 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f2ebfc1ce6c1e47561ab6ceb8dfe57faf68d0cb1;p=working%2FEvergreen.git 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 --- 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;