From 978314ba2fa10dc238525245b98b7113d5a1deac Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 10 Mar 2015 14:25:48 -0400 Subject: [PATCH] Bug 13818 - Editing and saving a course reserve displays the add item form If one chooses to edit an existing course reserve for an item, saving it should go back to the course details, but instead displays the "add items: scan barcode" form. Test Plan: 1) Edit a course reserve 2) Save it 3) Note you get the "add items: scan barcode" form 4) Apply this patch 5) Repeat steps 1 and 2 6) Note you are now redirected back to the course details page Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart --- course_reserves/add_items.pl | 7 +++++++ .../prog/en/modules/course_reserves/add_items-step2.tt | 1 + .../prog/en/modules/course_reserves/course-details.tt | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index 0a96860..ecae625 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -35,6 +35,7 @@ my $cgi = new CGI; my $action = $cgi->param('action') || ''; my $course_id = $cgi->param('course_id') || ''; my $barcode = $cgi->param('barcode') || ''; +my $return = $cgi->param('return') || ''; my $item = GetBiblioFromItemNumber( undef, $barcode ); @@ -73,6 +74,7 @@ if ( $action eq 'lookup' ) { locations => GetAuthorisedValues('LOC'), itypes => GetItemTypes( style => 'array' ), branches => GetBranchesLoop(), + return => $return, ); } elsif ( $action eq 'add' ) { @@ -90,6 +92,11 @@ if ( $action eq 'lookup' ) { staff_note => $cgi->param('staff_note'), public_note => $cgi->param('public_note'), ); + + if ( $return ) { + print $cgi->redirect("/cgi-bin/koha/course_reserves/course-details.pl?course_id=$return"); + exit; + } } output_html_with_http_headers $cgi, $cookie, $template->output; 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 96bf783..2ec285f 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 @@ -18,6 +18,7 @@
+
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 2a8dfba..429782a 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 @@ -155,7 +155,7 @@ [% cr.public_note %] [% IF CAN_user_coursereserves_add_reserves %] - Edit + Edit [% END %] [% IF CAN_user_coursereserves_delete_reserves %] -- 2.1.0