From d8881ccb7b946f4b3c0e8665a5b35e6fb323f2ba Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Jan 2016 14:25:14 +0000 Subject: [PATCH] Bug 4912: Redirect to the appropriate view after editing/deleting a list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are 2 places where a list can be edited/deleted: on the list view and the list content view. After the edition, the user expect to be redirect to the previous page. This patch implements that. Test plan: At the OPAC, delete and edit a list from the 2 differents places. Confirm that you are redirect to the page you come from. With patch, redirects work as expected. Signed-off-by: Marc VĂ©ron --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 5 ++++- opac/opac-shelves.pl | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index a92a5cb..564bbe1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -177,6 +177,7 @@ |
+ @@ -184,6 +185,7 @@ + @@ -194,6 +196,7 @@ [% ELSIF category == PRIVATE # not manageshelf and private means shared %] + @@ -545,7 +548,7 @@ [% ELSE %] Editing [% shelf.shelfname |html %] - + [% END %] diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 067eb10..ef54de3 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -84,11 +84,11 @@ if ( $op eq 'add_form' ) { push @messages, { type => 'error', code => 'error_on_insert' }; } else { push @messages, { type => 'message', code => 'success_on_insert' }; - $op = 'view'; + $op = $referer; } } else { push @messages, { type => 'error', code => 'unauthorized_on_insert' }; - $op = 'list'; + $op = $referer; } } elsif ( $op eq 'edit' ) { $shelfnumber = $query->param('shelfnumber'); -- 1.7.10.4