added generic lineitem attr retrieval call
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Aug 2008 19:43:43 +0000 (19:43 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Aug 2008 19:43:43 +0000 (19:43 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@10317 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 50318ab..e0e4489 100644 (file)
@@ -858,6 +858,29 @@ sub set_lineitem_attr {
     return $attr->id;
 }
 
+__PACKAGE__->register_method(
+       method => 'get_lineitem_attr_defs',
+       api_name        => 'open-ils.acq.lineitem_attr_definition.retrieve.all',
+       signature => {
+        desc => 'Retrieve lineitem attr definitions',
+        params => [
+            {desc => 'Authentication token', type => 'string'},
+        ],
+        return => {desc => 'List of attr definitions'}
+    }
+);
+
+sub get_lineitem_attr_defs {
+    my($self, $conn, $auth) = @_;
+    my $e = new_editor(authtoken=>$auth);
+    return $e->event unless $e->checkauth;
+    my %results;
+    for my $type (qw/generated marc local usr provider/) {
+        my $call = "retrieve_all_acq_lineitem_${type}_attr_definition";
+        $results{$type} = $e->$call;
+    }
+    return \%results;
+}
 
 
 1;