From f0c031670e864858f0e4627e1a9151f954628bcc Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 5 Feb 2020 04:33:50 +0000 Subject: [PATCH] Bug 18127: Add batch modified records to an existing list To test: 1) Start by having no (zero) lists 2) Go to Tools -> Batch record modification 3) Go through the batch record modification process, confirm everything works as normal and there is a link to do a new batch record modification at the end 4) In another tab, go to Lists and create a new list 5) Go back to the first tab and start a new batch modification process 6) At the end of the process, there should be a new option to add modified records to an existing list 7) Select a list from the dropdown and confirm you are able to save your modified records to the list as expected 8) Start a new batch modification process, this time for authorities records 9) At the end confirm there is no option to add modified records to a list, because authorities cannot be added to lists Sponsored-by: Catalyst IT Signed-off-by: Jessica Zairo Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../tools/batch_record_modification.tt | 38 ++++++++++++++++++- tools/batch_record_modification.pl | 4 +- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt index 3d64557370..960217a9c9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -245,19 +245,37 @@ [% ELSE %]
- No records were modified. New batch record modification + No records were modified. [% IF recordtype != 'biblio' %]New batch record modification[% END %]
[% END %] [% ELSIF view == 'report' %] [% IF report.total_records == report.total_success %]
- All records have successfully been modified! New batch record modification + All records have successfully been modified! [% IF recordtype != 'biblio' %]New batch record modification[% END %]
[% ELSE %]
[% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred. New batch record modification
[% END %] + + [% IF recordtype == 'biblio' %] +

Next steps

+
    +
  • New batch record modification + [% IF lists.count %] +
  • + + +
  • + [% END %] +
+ [% END %] [% ELSIF view == 'errors' %] [% FOR error IN errors %] [% IF error == 'no_template_defined' %] @@ -376,6 +394,22 @@ $("#marcPreview .modal-body").html("
\"\" " + _("Loading") + "
"); }); + $("#add_bibs_to_list").change(function(){ + var selected = $("#add_bibs_to_list").find("option:selected"); + if ( selected.attr("class") == "shelf" ){ + var shelfnumber = selected.attr("value"); + var bibs = new Array(); + [% FOREACH message IN messages %] + [% IF message.code == 'biblio_modified' %] + bibs.push("biblionumber="+[% message.biblionumber %]); + [% END %] + [% END %] + var bibstring = bibs.join("&"); + window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes'); + return false; + } + }); + }); [% END %] diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl index 1a82c476c3..0203b0bb69 100755 --- a/tools/batch_record_modification.pl +++ b/tools/batch_record_modification.pl @@ -50,6 +50,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ flagsrequired => { tools => 'records_batchmod' }, }); +$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) ); my $sessionID = $input->cookie("CGISESSID"); @@ -63,14 +64,13 @@ if ( $completedJobID ) { report => $report, messages => $messages, view => 'report', + recordtype => $recordtype, ); output_html_with_http_headers $input, $cookie, $template->output; $job->clear(); exit; } -$template->param( lists => scalar Koha::Virtualshelves->search([{ category => 1, owner => $loggedinuser }, { category => 2 }]) ); - my @templates = GetModificationTemplates( $mmtid ); unless ( @templates ) { $op = 'error'; -- 2.39.5