Bugzilla – Attachment 73551 Details for
Bug 20467
Add ability to batch add items to a course
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20467 [QA Followup] - Filter barcodes, Remove selector code as batch changes cannot have a previous selection, use template plugins
Bug-20467-QA-Followup---Filter-barcodes-Remove-sel.patch (text/plain), 6.27 KB, created by
Kyle M Hall (khall)
on 2018-04-03 11:12:27 UTC
(
hide
)
Description:
Bug 20467 [QA Followup] - Filter barcodes, Remove selector code as batch changes cannot have a previous selection, use template plugins
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-04-03 11:12:27 UTC
Size:
6.27 KB
patch
obsolete
>From 4e1022e8361957f235b3afa22ba58f49dff24ea3 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatetsolutions.com> >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' %] > <title>Koha › Course reserves › Add items</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -32,12 +35,8 @@ > <select id="itype" name="itype"> > <option value="">LEAVE UNCHANGED</option> > >- [% FOREACH it IN itypes %] >- [% IF course_item.itype && ( ( course.enabled == 'yes' && it.itemtype == item.itype ) || ( course.enabled == 'no' && it.itemtype == course_item.itype ) ) %] >- <option value="[% it.itemtype %]" selected="selected">[% it.description %]</option> >- [% ELSE %] >- <option value="[% it.itemtype %]">[% it.description %]</option> >- [% END %] >+ [% FOREACH it IN ItemTypes.Get() %] >+ <option value="[% it.itemtype %]">[% it.description %]</option> > [% END %] > </select> > </li> >@@ -47,13 +46,8 @@ > <label class="required" for="ccode">Collection code:</label> > <select id="ccode" name="ccode"> > <option value="">LEAVE UNCHANGED</option> >- >- [% FOREACH c IN ccodes %] >- [% IF course_item.ccode && ( ( course.enabled == 'yes' && c.authorised_value == item.ccode ) || ( course.enabled == 'no' && c.authorised_value == course_item.ccode ) ) %] >- <option value="[% c.authorised_value %]" selected="selected">[% c.lib %]</option> >- [% ELSE %] >- <option value="[% c.authorised_value %]">[% c.lib %]</option> >- [% END %] >+ [% FOREACH c IN AuthorisedValues.Get('CCODE') %] >+ <option value="[% c.authorised_value %]">[% c.lib %]</option> > [% END %] > </select> > </li> >@@ -62,13 +56,8 @@ > <label class="required" for="location">Shelving location:</label> > <select id="location" name="location"> > <option value="">LEAVE UNCHANGED</option> >- >- [% FOREACH s IN locations %] >- [% IF course_item.location && ( ( course.enabled == 'yes' && s.authorised_value == item.location ) || ( course.enabled == 'no' && s.authorised_value == course_item.location ) ) %] >- <option value="[% s.authorised_value %]" selected="selected">[% s.lib %]</option> >- [% ELSE %] >- <option value="[% s.authorised_value %]">[% s.lib %]</option> >- [% END %] >+ [% FOREACH s IN AuthorisedValues.Get('LOC') %] >+ <option value="[% s.authorised_value %]">[% s.lib %]</option> > [% END %] > </select> > </li> >@@ -78,11 +67,7 @@ > <select id="holdingbranch" name="holdingbranch"> > <option value="">LEAVE UNCHANGED</option> > [% FOREACH b IN Branches.all() %] >- [% IF course_item.holdingbranch && ( ( course.enabled == 'yes' && b.value == item.holdingbranch ) || ( course.enabled == 'no' && b.value == course_item.holdingbranch ) ) %] >- <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option> >- [% ELSE %] >- <option value="[% b.branchcode %]">[% b.branchname %]</option> >- [% END %] >+ <option value="[% b.branchcode %]">[% b.branchname %]</option> > [% END %] > </select> > </li> >-- >2.15.1 (Apple Git-101)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20467
:
73209
|
73213
|
73214
|
73219
|
73220
|
73239
|
73419
|
73453
|
73550
|
73551
|
73705
|
73797
|
76468
|
76469
|
76470
|
76471
|
76472