From 4e1022e8361957f235b3afa22ba58f49dff24ea3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 3 Apr 2018 06:35:01 -0400 Subject: [PATCH] Bug 20467 [QA Followup] - Filter barcodes, Remove selector code as batch changes cannot have a previous selection, use template plugins --- course_reserves/batch_add_items.pl | 15 +++------- .../en/modules/course_reserves/batch_add_items.tt | 35 +++++++--------------- 2 files changed, 14 insertions(+), 36 deletions(-) diff --git a/course_reserves/batch_add_items.pl b/course_reserves/batch_add_items.pl index 04ce0378a7..db5f725a7f 100755 --- a/course_reserves/batch_add_items.pl +++ b/course_reserves/batch_add_items.pl @@ -20,7 +20,8 @@ use Modern::Perl; -use CGI qw ( -utf8 ); +use CGI qw( -utf8 ); +use List::MoreUtils qw( uniq ); use C4::Auth; use C4::Output; @@ -56,18 +57,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( $template->param( course => GetCourse($course_id) ); if ( !$action ) { - - my $itemtypes = Koha::ItemTypes->search; - $template->param( - action => 'display_form', - ccodes => GetAuthorisedValues('CCODE'), - locations => GetAuthorisedValues('LOC'), - itypes => $itemtypes, - ); - + $template->param( action => 'display_form' ); } elsif ( $action eq 'add' ) { - my @barcodes = split( "\r\n", $barcodes ); + my @barcodes = uniq( split( /\s\n/, $barcodes ) ); my @items; my @invalid_barcodes; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt index cb8ca499f3..9ebe71de53 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/batch_add_items.tt @@ -1,4 +1,7 @@ +[% USE AuthorisedValues %] [% USE Branches %] +[% USE ItemTypes %] + [% INCLUDE 'doc-head-open.inc' %] Koha › Course reserves › Add items [% INCLUDE 'doc-head-close.inc' %] @@ -32,12 +35,8 @@ @@ -47,13 +46,8 @@ @@ -62,13 +56,8 @@ @@ -78,11 +67,7 @@ -- 2.15.1 (Apple Git-101)