diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index 086978561a..1f4c8f20e8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -409,6 +409,7 @@ [% END %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/letter.js b/koha-tmpl/intranet-tmpl/prog/js/letter.js index cdaf5557b4..f4824abab3 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/letter.js +++ b/koha-tmpl/intranet-tmpl/prog/js/letter.js @@ -136,7 +136,19 @@ $(document).ready(function() { } }); - $( ".transport-types" ).accordion({ collapsible: true, active:false, animate: 200 }); + $( ".transport-types" ).accordion({ + collapsible: true, + active: parseInt( $("#section").val(), 10), + animate: 200, + activate: function() { + var active = $( ".transport-types" ).accordion( "option", "active" ); + if( active === false ){ + $("#section").val(""); + } else { + $("#section").val( active ); + } + } + }); $(".insert").on("click",function(){ var containerid = $(this).data("containerid"); diff --git a/tools/letter.pl b/tools/letter.pl index f1a234bf40..a673fa96a9 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -66,7 +66,9 @@ my $code = $input->param('code'); my $module = $input->param('module') || ''; my $content = $input->param('content'); my $op = $input->param('op') || ''; -my $redirect = $input->param('redirect'); +my $redirect = $input->param('redirect'); +my $section = $input->param('section'); + my $dbh = C4::Context->dbh; our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user( @@ -90,13 +92,14 @@ $template->param( script_name => $script_name, searchfield => $searchfield, branchcode => $branchcode, + section => $section, action => $script_name ); if ( $op eq 'add_validate' or $op eq 'copy_validate' ) { add_validate(); if( $redirect eq "just_save" ){ - print $input->redirect("/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=$branchcode&module=$module&code=$code&redirect=done"); + print $input->redirect("/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=$branchcode&module=$module&code=$code&redirect=done§ion=$section"); exit; } else { $op = q{}; # we return to the default screen for the next operation