added attribute fleshing option to the basic pl entry retrieve
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jan 2008 13:59:36 +0000 (13:59 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 18 Jan 2008 13:59:36 +0000 (13:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8415 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm

index a5c529d..8bcb3a9 100644 (file)
@@ -194,18 +194,26 @@ __PACKAGE__->register_method(
         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 @@ sub retrieve_picklist_entry {
 }
 
 
+
 __PACKAGE__->register_method(
        method => 'delete_picklist_entry',
        api_name        => 'open-ils.acq.picklist_entry.delete',