From 3eee6f3091fcb621152af7f4db6441c98cb74558 Mon Sep 17 00:00:00 2001 From: Hayley Mapley Date: Thu, 7 Mar 2019 02:50:12 +0000 Subject: [PATCH] Bug 21003: Removed warning and changed wording on add_items-step2.tt When editing an item in a Course Reserve, the page displayed is the same that is displayed when adding an item to a Course Reserve. This patch removes the warning 'This course already has this item on reserve' when the item is being edited, as well as changes the title, breadcrumbs, and header of the div. This patch also Changes the header of the div to say 'Edit 'book_name' in 'course_name'' instead of 'Add 'book_name' to 'course_name'' when adding items to a course reserve if the item is already present. To test: 1) Create a new course in Course Reserves (you will need Course Reserves enabled in syspref) 2) Add an item by clicking the Add reserves button 3) Click the edit button on the right hand side of the item listing under the Reserves heading 4) Observe that the warning 'The course already has this item on reserve' appears, and that the title, breadcrumbs and header of the div all say Add/Reserve 5) Apply the patch 6) Repeat step 3 and observe that the title, breadcrumbs and header of the div now say Edit 7) Also verify that when adding a reserve with a barcode that does not yet exist in the course reserves that the warning 'The course already...' is not displayed and that the header of the div says Add 8) Finally verify that when adding a reserve with a barcode that DOES exist in the course reserves that the warning 'The course already...' IS displayed and the header of the div says Edit 9) Sign off! Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- course_reserves/add_items.pl | 2 ++ .../en/modules/course_reserves/add_items-step2.tt | 12 ++++++++---- .../en/modules/course_reserves/course-details.tt | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index ff398b995a..42416b3a63 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -40,6 +40,7 @@ my $course_id = $cgi->param('course_id') || ''; my $barcode = $cgi->param('barcode') || ''; my $return = $cgi->param('return') || ''; my $itemnumber = ($cgi->param('itemnumber') && $action eq 'lookup') ? $cgi->param('itemnumber') : ''; +my $is_edit = $cgi->param('is_edit') || ''; my $item = Koha::Items->find( { ( $itemnumber ? ( itemnumber => $itemnumber ) : ( barcode => $barcode ) ) } ); my $title = ($item) ? $item->biblio->title : undef; @@ -79,6 +80,7 @@ if ( $action eq 'lookup' and $item ) { biblio => $item->biblio, course_item => $course_item, course_reserve => $course_reserve, + is_edit => $is_edit, ccodes => GetAuthorisedValues('CCODE'), locations => GetAuthorisedValues('LOC'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt index 669be49ced..4646c85123 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt @@ -1,6 +1,6 @@ [% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Course reserves › Add items +Koha › Course reserves ›[% IF is_edit %] Edit item[% ELSE %]Add items[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -9,13 +9,13 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] - +
- [% IF course_reserve %]
This course already has this item on reserve.
[% END %] + [% IF course_reserve && !is_edit%]
This course already has this item on reserve.
[% END %] [% IF course_item %]
Number of courses reserving this item: [% course_item.course_reserves.size | html %]
[% END %]
@@ -24,7 +24,11 @@
- Add [% biblio.title | html %] to [% course.course_name | html %] + [% IF is_edit || course_reserve %] + Edit [% biblio.title | html %] in [% course.course_name | html %] + [% ELSE %] + Add [% biblio.title | html %] to [% course.course_name | html %] + [% END %]
  1. Barcode: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt index ad1a8a9440..6313a2dfe0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt @@ -219,7 +219,7 @@ [% IF CAN_user_coursereserves_add_reserves || CAN_user_coursereserves_delete_reserves %] [% IF CAN_user_coursereserves_add_reserves %] - Edit + Edit [% END %] [% IF CAN_user_coursereserves_delete_reserves %] -- 2.39.5