From 0ded67a7dba2b544a49fa26d1bdee4faa24c434e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 3 May 2013 11:53:10 +0200 Subject: [PATCH] Bug 10182: Stay on the same tab after saving a biblio When editing a biblio, the bug 7883 introduces the "save and continue editing" feature. After saving, the page is loaded with the first tab selected. This patch refresh the page with the same tab selected. Test plan: 1/ Edit a biblio. 2/ Clic on the 5th tab. 3/ Clic on the "Save and continue editing" button. 4/ You are redirected on the same page with the same tab selected --- cataloguing/addbiblio.pl | 6 ++++-- .../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index fdbacd4..dc0a30a 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -909,7 +909,8 @@ if ( $op eq "addbiblio" ) { } elsif ($redirect eq "just_save"){ - print $input->redirect("/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber&framework=$frameworkcode"); + my $tab = $input->param('current_tab'); + print $input->redirect("/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber&framework=$frameworkcode&tab=$tab"); } else { $template->param( @@ -990,7 +991,8 @@ $template->param( popup => $mode, frameworkcode => $frameworkcode, itemtype => $frameworkcode, - borrowernumber => $loggedinuser, + borrowernumber => $loggedinuser, + tab => $input->param('tab') ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index ae80c6a..907120a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -13,6 +13,10 @@ $("#"+ui.panel.id+" input:eq(0)").focus(); }); + [% IF tab %] + $('#addbibliotabs').tabs('option', 'selected', "#[% tab %]"); + [% END %] + /* check cookie to hide/show marcdocs*/ if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){ hideMARCdocLinks(); @@ -55,7 +59,10 @@ }); $("#saveandcontinue").click(function(){ $(".btn-group").removeClass("open"); - redirect("just_save"); + var tab = $("#addbibliotabs li.ui-tabs-selected:first a").attr('href'); + tab = tab.replace('#', ''); + $("#current_tab").val(tab); + redirect("just_save", tab); return false; }); @@ -352,7 +359,8 @@ function Changefwk(FwkList) { [% ELSE %]
- + + [% END %]
-- 1.7.10.4