From 6a2bf8d31b1fbe1d83a66d314bc97be41af65ca7 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=utf8 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 Signed-off-by: Katrin Fischer Signed-off-by: Brendan A Gallagher --- 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 7fd410b62c..92c2343e91 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 8b66274c1e..2d810cb143 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -90,11 +90,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'); -- 2.39.5