From 456e849ec29e9a5b1499ea8e492dc157b381f8d5 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 11 Apr 2017 16:09:27 -0400 Subject: [PATCH] Bug 18367 - Fix untranslatable string from Bug 18264 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Restore display of message when no barcode found To test: 1 - Go to course reserves 2 - Add an item to a course 3 - Try adding an invalid barcode - should get an alert 4 - Try force adding an item with itemnumber: http://localhost:8081/cgi-bin/koha/course_reserves/add_items.pl?op=lookpup&course_id=11&itemnumber=1234523546 5 - Should recieve an error Signed-off-by: Frédéric Demians Signed-off-by: Jonathan Druart (cherry picked from commit 1fc3751804146e92c0d8d85517ffcd6ec338808e) Signed-off-by: Fridolin Somers --- course_reserves/add_items.pl | 8 +++++--- .../prog/en/modules/course_reserves/add_items-step1.tt | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index 89cbb47eb7..ed37654de0 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -54,9 +54,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( flagsrequired => { coursereserves => 'add_reserves' }, } ); -my $inumber = $itemnumber ? "(blank) (itemnumber:$itemnumber)" : ""; -$template->param( ERROR_BARCODE_NOT_FOUND => $barcode . $inumber ) - unless ( $barcode && !$itemnumber && $item && $action eq 'lookup' ); + +unless ( $item && $action eq 'lookup' ){ + $template->param( ERROR_ITEM_NOT_FOUND => 1 ); + $template->param( UNKNOWN_BARCODE => $barcode ) if $barcode; +} $template->param( course => GetCourse($course_id) ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt index b5036363ff..daf1602a3d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step1.tt @@ -11,8 +11,13 @@
- [% IF ERROR_BARCODE_NOT_FOUND %] -
No item found with barcode [% ERROR_BARCODE_NOT_FOUND %]
+ + [% IF ERROR_ITEM_NOT_FOUND %] + [% IF UNKNOWN_BARCODE %] +
No item found with barcode [% UNKNOWN_BARCODE %]
+ [% ELSE %] +
No item found
+ [% END %] [% END %]
-- 2.39.5