added flesh_attrs support to lineitem ident search
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Aug 2008 17:26:28 +0000 (17:26 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Aug 2008 17:26:28 +0000 (17:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@10235 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 5bd5033..50318ab 100644 (file)
@@ -419,6 +419,7 @@ __PACKAGE__->register_method(
                     Options hash.  Options are:
                         idlist : if set, only return lineitem IDs
                         clear_marc : if set, strip the MARC xml from the lineitem before delivery
+                        flesh_attrs : flesh lineitem attributes; 
                 /,
                 type => 'object',
             }
@@ -483,7 +484,13 @@ sub lineitem_search_ident {
         if($$options{idlist}) {
             $conn->respond($li_id);
         } else {
-            my $li = $e->retrieve_acq_lineitem($li_id);
+            my $li;
+            if($$options{flesh_attrs}) {
+                $li = $e->retrieve_acq_lineitem([
+                    $li_id, {flesh => 1, flesh_fields => {jub => ['attributes']}}])
+            } else {
+                $li = $e->retrieve_acq_lineitem($li_id);
+            }
             $li->clear_marc if $$options{clear_marc};
             $conn->respond($li);
         }