bug 1570: return to same tab if cancelling preference edit
authorGalen Charlton <galen.charlton@liblime.com>
Sun, 2 Dec 2007 19:41:41 +0000 (13:41 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 2 Dec 2007 21:06:20 +0000 (15:06 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
admin/systempreferences.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl

index 79062dc..650e36c 100755 (executable)
@@ -361,6 +361,8 @@ if ($op eq 'add_form') {
         $data=$sth->fetchrow_hashref;
         $sth->finish;
         $template->param(modify => 1);
+        # save tab to return to if user cancels edit
+        $template->param(return_tab => $tabsysprefs{$searchfield});
     }
 
     my @options;
index b196850..d512fae 100644 (file)
                     <input type="radio" name="value" id="value-no" value="0" checked="checked" /><!-- TMPL_ELSE --><input type="radio" name="value" id="value-no" value="0" /><!-- /TMPL_IF --> <label for="value-no" class="yesno">OFF</label><!-- /TMPL_IF -->
                 </li>
         </ol></fieldset>
-        <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl">Cancel</a></fieldset>
+        <fieldset class="action"><input type="submit" value="Save" /> 
+          <!-- TMPL_IF name="return_tab" -->
+            <a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl?tab=<!-- TMPL_VAR name="return_tab" -->">Cancel</a>
+          <!-- TMPL_ELSE -->
+            <a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl">Cancel</a>
+          <!-- /TMPL_IF -->
+        </fieldset>
         
         <fieldset class="brief">
                <legend>Koha internal</legend>