From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 21 May 2010 13:02:19 +0000 (+0000)
Subject: allow caller to define the sort field/direction in PL retrieval call.  by default... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=16c201ca6778bea10659f20265ba434c35a68376;p=evergreen%2Fpines.git

allow caller to define the sort field/direction in PL retrieval call.  by default, sort most recently edited PLs to the front

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16468 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 fb7e72e620..34b61a68ac 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
@@ -198,10 +198,10 @@ sub retrieve_user_picklist {
     # 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=>{'!='=>''}
+                owner => $e->requestor->id, 
+                name => {'!=' => ''}
             }, {
-                order_by => {acqpl => 'name'},
+                order_by => $$options{order_by} || {acqpl => 'edit_time DESC'},
                 limit => $$options{limit} || 10,
                 offset => $$options{offset} || 0,
             }