From 85d1e35b6c377618882a985662dcc7fb7e7aba48 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/ Click on the 5th tab. 3/ Click on the "Save and continue editing" button. 4/ You are redirected on the same page with the same tab selected Signed-off-by: David Cook Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- cataloguing/addbiblio.pl | 6 ++++-- .../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 3a5b7c5f82..d24972c375 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 26f8fa7f09..1113856e7d 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 %]
-- 2.39.5