From 46070d04cf5e739180e8832b354955244df89868 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 11 Sep 2018 16:26:04 +0000 Subject: [PATCH] Bug 21333: Add ability to add to basket from a new file This patch adds a workflow for adding to a basket from a file. It removes the need to stage the file before going to the basket and allows you to stage the file and return to the basket To test: 1 - Have basket in acquissitions 2 - Click add to basket 3 - Note new option to 'Add from new file' 4 - Click it 5 - You will be sent to the record import tool 6 - Stage your file 7 - There is a link after staging 'Add records to basket' 8 - Click it 9 - Your items should be added --- .../prog/en/includes/acquisitions-add-to-basket.inc | 1 + .../intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt | 7 +++++++ tools/stage-marc-import.pl | 12 ++++++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc index 3588005..64234df 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc @@ -16,6 +16,7 @@
  • From a subscription
  • From a new (empty) record
  • From an external source
  • +
  • From a new file
  • From a staged file
  • [% IF ( CAN_user_circulate ) %]
  • From titles with highest hold ratios
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt index 58d114d..fdf87b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt @@ -41,6 +41,9 @@
  • [% total | html %] records in file
  • [% import_errors | html %] records not staged because of MARC error
  • [% staged | html %] records staged
  • +[% IF basketno && booksellerid %] +
  • Add staged files to basket
  • +[% END %] [% IF ( checked_matches ) %]
  • [% matched | html %] records with at least one match in catalog per matching rule "[% matcher_code | html %]"
  • @@ -90,6 +93,10 @@
    +[% IF basketno && booksellerid %] + + +[% END %]
    diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl index f2acc58..d76c35a 100755 --- a/tools/stage-marc-import.pl +++ b/tools/stage-marc-import.pl @@ -58,6 +58,8 @@ my $record_type = $input->param('record_type'); my $encoding = $input->param('encoding') || 'UTF-8'; my $format = $input->param('format') || 'ISO2709'; my $marc_modification_template = $input->param('marc_modification_template_id'); +my $basketno = $input->param('basketno'); +my $booksellerid = $input->param('booksellerid'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -74,6 +76,8 @@ $template->param( SCRIPT_NAME => '/cgi-bin/koha/tools/stage-marc-import.pl', uploadmarc => $fileID, record_type => $record_type, + basketno => $basketno, + booksellerid => $booksellerid, ); my %cookies = parse CGI::Cookie($cookie); @@ -181,7 +185,9 @@ if ($completedJobID) { checked_matches => $checked_matches, matcher_failed => $matcher_failed, matcher_code => $matcher_code, - import_batch_id => $batch_id + import_batch_id => $batch_id, + booksellerid => $booksellerid, + basketno => $basketno }; if ($runinbackground) { $job->finish($results); @@ -195,7 +201,9 @@ if ($completedJobID) { checked_matches => $checked_matches, matcher_failed => $matcher_failed, matcher_code => $matcher_code, - import_batch_id => $batch_id + import_batch_id => $batch_id, + booksellerid => $booksellerid, + basketno => $basketno ); } -- 2.1.4