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

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jan 8 13:42:43 EST 2008


Author: erickson
Date: 2008-01-08 13:18:17 -0500 (Tue, 08 Jan 2008)
New Revision: 8350

Modified:
   branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
Log:
added picklist_entry create stub

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-08 18:02:24 UTC (rev 8349)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2008-01-08 18:18:17 UTC (rev 8350)
@@ -35,7 +35,6 @@
 
 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 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 @@
     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;
+}
+
+



More information about the open-ils-commits mailing list