sub update_picklist {
my($self, $conn, $auth, $picklist) = @_;
-
my $e = new_editor(xact=>1, authtoken=>$auth);
return $e->die_event unless $e->checkauth;
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;
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;
+}
+
+