[open-ils-commits] r8415 - branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 18 09:25:25 EST 2008


Author: erickson
Date: 2008-01-18 08:59:36 -0500 (Fri, 18 Jan 2008)
New Revision: 8415

Modified:
   branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
Log:
added attribute fleshing option to the basic pl entry retrieve

Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2008-01-18 02:58:17 UTC (rev 8414)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2008-01-18 13:59:36 UTC (rev 8415)
@@ -194,18 +194,26 @@
         params => [
             {desc => 'Authentication token', type => 'string'},
             {desc => 'Picklist entry ID to retrieve', type => 'number'},
+            {options => 'Hash of options, including "flesh", which fleshes the attributes', type => 'hash'},
         ],
         return => {desc => 'Picklist entry object on success, Event on error'}
     }
 );
 
 sub retrieve_picklist_entry {
-    my($self, $conn, $auth, $pl_entry_id) = @_;
+    my($self, $conn, $auth, $pl_entry_id, $options) = @_;
     my $e = new_editor(authtoken=>$auth);
     return $e->die_event unless $e->checkauth;
 
-    my $pl_entry = $e->retrieve_acq_picklist_entry($pl_entry_id)
-        or return $e->event;
+    my $pl_entry;
+    if($$options{flesh}) {
+        $pl_entry = $e->retrieve_acq_picklist_entry([
+            $pl_entry_id, {flesh => 1, flesh_fields => {acqple => ['attributes']}}])
+            or return $e->event;
+    } else {
+        $pl_entry = $e->retrieve_acq_picklist_entry($pl_entry_id)
+            or return $e->event;
+    }
 
     my $picklist = $e->retrieve_acq_picklist($pl_entry->picklist)
         or return $e->event;
@@ -215,6 +223,7 @@
 }
 
 
+
 __PACKAGE__->register_method(
 	method => 'delete_picklist_entry',
 	api_name	=> 'open-ils.acq.picklist_entry.delete',



More information about the open-ils-commits mailing list