From ff84484abc02dece54a50eb61ec6e991b3bc742e Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 8 Jan 2008 18:18:17 +0000 Subject: [PATCH] added picklist_entry create stub git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8350 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Acq/Picklist.pm | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm index 1137600bed..90788ab075 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm @@ -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; +} + + -- 2.11.0