From c1782d9f246810e4b897c1404d240fa5b51cf9a5 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 13 Feb 2012 12:12:25 -0500 Subject: [PATCH] [SIGNED-OFF] 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 --- C4/VirtualShelves/Page.pm | 9 +++++++++ .../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 7cab246..1727389 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 7d9d4d2..bf44771 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() { +
    -- 1.7.2.3