[open-ils-commits] r12653 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Mar 24 13:47:32 EDT 2009


Author: erickson
Date: 2009-03-24 13:47:29 -0400 (Tue, 24 Mar 2009)
New Revision: 12653

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
Log:
sort on picklist name.  ranged, fleshed distribution formula fetcher

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2009-03-24 03:57:29 UTC (rev 12652)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2009-03-24 17:47:29 UTC (rev 12653)
@@ -178,8 +178,10 @@
     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 @@
 
 
 
+__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;



More information about the open-ils-commits mailing list