From 3ab28d4e533d332867180fa51a3ca3db614629bb Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 13 Feb 2012 12:12:25 -0500 Subject: [PATCH] Bug 4912 [REVISED] After editing private list, user should be redirect to private lists As far as I can tell there isn't a redirect in the code which is triggered in the wake of a ModShelf() action. This patch adds a redirect which is reflects the context of the original "edit" link. To test, edit the details of a list in the OPAC from: - the list of private lists - the list of public lists - the contents view of public or private list After each of these actions you should be redirected back to the page where you clicked the "edit" link. Signed-off-by: Nicole C. Engard Signed-off-by: Paul Poulain --- C4/VirtualShelves/Page.pm | 9 +++++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 7cab246242..1727389dc3 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -168,6 +168,14 @@ sub shelfpage ($$$$$) { }; ModShelf( $shelfnumber, $shelf ); + if($displaymode eq "viewshelf"){ + print $query->redirect( $pages{$type}->{redirect} . "?viewshelf=$shelfnumber" ); + } elsif($displaymode eq "publicshelves"){ + print $query->redirect( $pages{$type}->{redirect} ); + } else { + print $query->redirect( $pages{$type}->{redirect} . "?display=privateshelves" ); + } + exit; } elsif ( $op eq 'modif' ) { my ( $shelfnumber2, $shelfname, $owner, $category, $sortfield ) = GetShelf($shelfnumber); @@ -176,6 +184,7 @@ sub shelfpage ($$$$$) { $edit = 1; $template->param( edit => 1, + display => $displaymode, shelfnumber => $shelfnumber2, shelfname => $shelfname, owner => $owner, diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt index 7d9d4d2fde..bf44771357 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -209,12 +209,11 @@ $(function() { Print List - [% IF ( manageshelf ) %] |
[% IF ( showprivateshelves ) %][% END %]
+ [% IF ( manageshelf ) %] |
+ +
- [% IF ( showprivateshelves ) %] - - [% END %]
[% END %] @@ -377,7 +376,7 @@ $(function() {

Lists > [% shelfname |html %] > Editing

- [% IF ( showprivateshelves ) %][% END %] +
    @@ -523,6 +522,7 @@ $(function() { +
    -- 2.39.5