diff --git a/Koha/BackgroundJob/ImportKBARTFile.pm b/Koha/BackgroundJob/ImportKBARTFile.pm index 8114abe0d2..64e757d25e 100644 --- a/Koha/BackgroundJob/ImportKBARTFile.pm +++ b/Koha/BackgroundJob/ImportKBARTFile.pm @@ -76,9 +76,10 @@ sub process { }; try { - my $column_headers = $args->{column_headers}; - my $rows = $args->{rows}; - my $package_id = $args->{package_id}; + my $column_headers = $args->{column_headers}; + my $rows = $args->{rows}; + my $package_id = $args->{package_id}; + my $create_linked_biblio = $args->{create_linked_biblio}; if ( scalar( @{$rows} ) == 0 ) { push @messages, { @@ -118,7 +119,8 @@ sub process { }; $failed_imports++; } else { - my $imported_title = Koha::ERM::EHoldings::Title->new($formatted_title)->store; + my $imported_title = Koha::ERM::EHoldings::Title->new($formatted_title) + ->store( { create_linked_biblio => $create_linked_biblio } ); create_linked_resource( { title => $imported_title, @@ -216,7 +218,7 @@ sub read_file { my $file_content = defined( $file->{file_content} ) ? decode_base64( $file->{file_content} ) : ""; my $delimiter = $file->{filename} =~ /\.tsv$/ ? "\t" : ","; - my $quote_char = $file->{filename} =~ /\.tsv$/ ? "" : '"'; + my $quote_char = $file->{filename} =~ /\.tsv$/ ? "\"" : "\""; open my $fh, "<", \$file_content or die; my $csv = Text::CSV_XS->new( @@ -422,10 +424,10 @@ sub is_file_too_large { }; } -=head3 +=head3 rescue_EBSCO_files EBSCO have an incorrect spelling of "preceding_publication_title_id" in all of their KBART files ("preceeding" instead of "preceding"). -This is very annoying because it means all of their KBART files fail to import using the current methodology. +This means all of their KBART files fail to import using the current methodology. There is no simple way of finding out who the vendor is before importing so all KBART files from any vendor are going to have to be checked for this spelling and corrected. =cut diff --git a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm index 64ae0d45d1..775fb89da6 100644 --- a/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm +++ b/Koha/REST/V1/ERM/EHoldings/Titles/Local.pm @@ -272,9 +272,10 @@ sub import_from_list { sub import_from_kbart_file { my $c = shift or return; - my $import_data = $c->req->json; - my $file = $import_data->{file}; - my $package_id = $import_data->{package_id}; + my $import_data = $c->req->json; + my $file = $import_data->{file}; + my $package_id = $import_data->{package_id}; + my $create_linked_biblio = $import_data->{create_linked_biblio}; return try { my @job_ids; @@ -306,10 +307,11 @@ sub import_from_kbart_file { ) if scalar(@invalid_columns) > 0; my $params = { - column_headers => $column_headers, - rows => $rows, - package_id => $package_id, - file_name => $file->{filename} + column_headers => $column_headers, + rows => $rows, + package_id => $package_id, + file_name => $file->{filename}, + create_linked_biblio => $create_linked_biblio }; my $outcome = Koha::BackgroundJob::ImportKBARTFile::is_file_too_large( $params, $max_allowed_packet ); @@ -347,5 +349,4 @@ sub import_from_kbart_file { }; } - -1; +1; \ No newline at end of file diff --git a/api/v1/swagger/paths/erm_eholdings_titles.yaml b/api/v1/swagger/paths/erm_eholdings_titles.yaml index f2fdef93c5..7e4e60411e 100644 --- a/api/v1/swagger/paths/erm_eholdings_titles.yaml +++ b/api/v1/swagger/paths/erm_eholdings_titles.yaml @@ -516,6 +516,8 @@ type: object package_id: type: string + create_linked_biblio: + type: boolean additionalProperties: false responses: 201: diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc index fe1bee7ace..28d0dfb5f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/import_from_kbart_file.inc @@ -1,4 +1,5 @@ [% USE Koha %] +[% USE raw %] [% BLOCK report %] [% SET report = job.report %] @@ -90,6 +91,5 @@ } }); }); - [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue index 055c4e6ae8..401732ce35 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitlesKBARTImport.vue @@ -17,46 +17,55 @@ -