added picklist_entry create stub
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Jan 2008 18:18:17 +0000 (18:18 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Jan 2008 18:18:17 +0000 (18:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8350 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 1137600..90788ab 100644 (file)
@@ -35,7 +35,6 @@ sub create_picklist {
 
 sub update_picklist {
     my($self, $conn, $auth, $picklist) = @_;
-
     my $e = new_editor(xact=>1, authtoken=>$auth);
     return $e->die_event unless $e->checkauth;
 
@@ -65,11 +64,10 @@ sub retrieve_picklist {
 
 sub delete_picklist {
     my($self, $conn, $auth, $picklist_id) = @_;
-
     my $e = new_editor(xact=>1, authtoken=>$auth);
     return $e->die_event unless $e->checkauth;
 
-    # don't let them change the owner
+    # don't let them delete someone else's picklist
     my $picklist = $e->retrieve_acq_picklist($picklist_id)
         or return $e->die_event;
     return $BAD_PARAMS if $picklist->owner != $e->requestor->owner;
@@ -79,3 +77,23 @@ sub delete_picklist {
     return 1;
 }
 
+sub create_picklist_entry {
+    my($self, $conn, $auth, $picklist_id, $marc_xml, $bibid) = @_;
+    my $e = new_editor(xact=>1, authtoken=>$auth);
+    return $e->die_event unless $e->checkauth;
+
+    # XXX data extraction ...
+
+    my $entry = Fieldmaper::acq::picklist_entry->new;
+    $entry->picklist($picklist_id);
+    $entry->marc($marc_xml);
+    $entry->eg_bib_id($bibid);
+    $e->create_acq_picklist_entry($entry) or return $e->die_event;
+
+    # XXX create entry attributes from the extracted data
+
+    $e->commit;
+    return $entry->id;
+}
+
+