From: erickson Date: Fri, 12 Dec 2008 19:35:57 +0000 (+0000) Subject: added bib_source to upload form and queued_bib_record create functions X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=89c0041df83011271854dcd75926d58a56a3a043;p=Evergreen.git added bib_source to upload form and queued_bib_record create functions git-svn-id: svn://svn.open-ils.org/ILS/trunk@11542 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm index 9d45d17246..0f4771e38f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm @@ -109,6 +109,7 @@ sub add_record_to_bib_queue { my $queue = shift; my $marc = shift; my $purpose = shift; + my $bib_source = shift; my $e = new_editor(authtoken => $auth, xact => 1); @@ -119,7 +120,7 @@ sub add_record_to_bib_queue { ($e->allowed('CREATE_BIB_IMPORT_QUEUE', undef, $queue) || $e->allowed('CREATE_BIB_IMPORT_QUEUE')); - my $new_rec = _add_bib_rec($e, $marc, $queue->id, $purpose); + my $new_rec = _add_bib_rec($e, $marc, $queue->id, $purpose, $bib_source); return $e->die_event unless ($new_rec); $e->commit; @@ -137,11 +138,13 @@ sub _add_bib_rec { my $marc = shift; my $queue = shift; my $purpose = shift; + my $bib_source = shift; my $rec = new Fieldmapper::vandelay::queued_bib_record(); $rec->marc( $marc ); $rec->queue( $queue ); $rec->purpose( $purpose ) if ($purpose); + $rec->bib_source($bib_source); return $e->create_vandelay_queued_bib_record( $rec ); } @@ -220,6 +223,7 @@ sub process_spool { my $data = $cache->get_cache('vandelay_import_spool_' . $fingerprint); my $purpose = $data->{purpose}; my $filename = $data->{path}; + my $bib_source = $data->{bib_source}; unless(-r $filename) { $logger->error("unable to read MARC file $filename"); @@ -251,7 +255,7 @@ sub process_spool { $xml =~ s/[\x00-\x1f]//go; if ($type eq 'bib') { - _add_bib_rec( $e, $xml, $queue_id, $purpose ) or return $e->die_event; + _add_bib_rec( $e, $xml, $queue_id, $purpose, $bib_source ) or return $e->die_event; } else { _add_auth_rec( $e, $xml, $queue_id, $purpose ) or return $e->die_event; } diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Vandelay.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Vandelay.pm index d3fccfaf19..6bc1017e5e 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Vandelay.pm @@ -65,6 +65,7 @@ sub spool_marc { my $data_fingerprint = ''; my $purpose = $cgi->param('purpose'); my $infile = $cgi->param('marc_upload'); + my $bib_source = $cgi->param('bib_source'); my $conf = OpenSRF::Utils::SettingsClient->new; my $dir = $conf->config_value( @@ -100,7 +101,10 @@ sub spool_marc { OpenSRF::Utils::Cache->new->put_cache( 'vandelay_import_spool_' . $data_fingerprint, - { purpose => $purpose, path => $outfile } + { purpose => $purpose, + path => $outfile, + bib_source => $bib_source + } ); } diff --git a/Open-ILS/web/vandelay/inc/upload.xml b/Open-ILS/web/vandelay/inc/upload.xml index 71a87662c5..9c71353c55 100644 --- a/Open-ILS/web/vandelay/inc/upload.xml +++ b/Open-ILS/web/vandelay/inc/upload.xml @@ -32,7 +32,7 @@ &vandelay.import.bib_sources; -