From ad3cf21e065abbe75eb465738e1a373f298cf87a Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 31 Aug 2010 03:20:28 +0000 Subject: [PATCH] Make the bib source selector in Vandelay MARC batch importer/exporter work The bib source selector in Vandelay offered a drop down of the available bib source selections, but never actually affected the source attribute of the bib records in biblio.record_entry when they were imported. This commit finishes off the logic that was almost there. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17395 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Cat/BibCommon.pm | 3 +++ Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat/BibCommon.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat/BibCommon.pm index 4769f095b..4d928a86a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat/BibCommon.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat/BibCommon.pm @@ -89,6 +89,9 @@ sub biblio_record_xml_import { return $evt if $evt; } + # Silence warnings when _find_tcn_info() fails + $tcn ||= ''; + $tcn_source ||= ''; $logger->info("user ".$e->requestor->id. " creating new biblio entry with tcn=$tcn and tcn_source $tcn_source"); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm index f39cb5f82..da3dca6b0 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm @@ -44,6 +44,7 @@ my %record_types = ( x => 'holdings', y => 'holdings', z => 'auth', + ' ' => 'bib', ); sub initialize {} @@ -624,6 +625,13 @@ sub import_record_list_impl { my $update_queue_func = 'update_vandelay_bib_queue'; my $rec_class = 'vqbr'; + my %bib_sources; + my $editor = new_editor(); + my $sources = $editor->search_config_bib_source({id => {'!=' => undef}}); + foreach my $src (@$sources) { + $bib_sources{$src->id} = $src->source; + } + if($type eq 'auth') { $overlay_func =~ s/bib/auth/o; $auto_overlay_func = s/bib/auth/o; @@ -737,8 +745,7 @@ sub import_record_list_impl { # No overlay / merge occurred. Do a traditional record import by creating a new record if($type eq 'bib') { - $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import($e, $rec->marc); #$rec->bib_source - + $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import($e, $rec->marc, $bib_sources{$rec->bib_source}); } else { $record = OpenILS::Application::Cat::AuthCommon->import_authority_record($e, $rec->marc); #$source); -- 2.11.0