Bug 4912 [REVISED] After editing private list, user should be redirect to private...
authorOwen Leonard <oleonard@myacpl.org>
Mon, 13 Feb 2012 17:12:25 +0000 (12:12 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Fri, 2 Mar 2012 17:27:24 +0000 (18:27 +0100)
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 <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/VirtualShelves/Page.pm
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt

index 7cab246..1727389 100644 (file)
@@ -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,
index 7d9d4d2..bf44771 100644 (file)
@@ -209,12 +209,11 @@ $(function() {
 
 <a class="print tag_hides" href="opac-shelves.pl" onclick="print(); return false;">Print List</a>
 
-                [% IF ( manageshelf ) %] | <form method="get" action="opac-shelves.pl" class="tag_hides"><input type="hidden" name="op" value="modif" />[% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %] <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf tag_hides" value="Edit List" /></form>
+                [% IF ( manageshelf ) %] | <form method="get" action="opac-shelves.pl" class="tag_hides"><input type="hidden" name="op" value="modif" />
+                <input type="hidden" name="display" value="viewshelf" />
+                <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf tag_hides" value="Edit List" /></form>
                       <form method="post" action="opac-shelves.pl" class="tag_hides">
                         <input type="hidden" value="1" name="shelves"/>
-                    [% IF ( showprivateshelves ) %]
-                         <input type="hidden" name="display" value="privateshelves" />
-                    [% END %]
                          <input type="hidden" value="1" name="DEL-[% shelfnumber %]"/>
                          <input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);"/>
                       </form> [% END %]
@@ -377,7 +376,7 @@ $(function() {
                 <h3><a href="/cgi-bin/koha/opac-shelves.pl">Lists</a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% shelfnumber %]"><em>[% shelfname |html %]</em></a> <img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Editing</h3>
                 <form method="post" action="/cgi-bin/koha/opac-shelves.pl">
                   <input type="hidden" name="op" value="modifsave" />
-                   [% IF ( showprivateshelves ) %]<input type="hidden" name="display" value="privateshelves" />[% END %]
+                  <input type="hidden" name="display" value="[% display %]" />
                   <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" />
                   <fieldset class="rows">
                     <ol>
@@ -523,6 +522,7 @@ $(function() {
                               <form action="/cgi-bin/koha/opac-shelves.pl" method="get">
                                 <input type="hidden" name="shelfnumber" value="[% shelvesloo.shelf %]" />
                                 <input type="hidden" name="op" value="modif" />
+                                <input type="hidden" name="display" value="publicshelves" />
                                 <input type="submit" class="editshelf" value="Edit" />
                               </form>
                               <form action="opac-shelves.pl" method="post">