@@ -, +, @@ notices page - Set the TranslateNotices system preference to "Don't allow." - Go to Tools -> Notices and edit any notice. - On the "Modify notice" page you should see three collapsed sections: Email, Print, and SMS. - Clicking the section headings should expand and collapse the panels. - With one of the panels open, click Save -> Save and continue editing. - When the page reloads the same panel should be expanded. - Enable the TranslateNotices system preference. - Return to the edit interface for one of your notices. - You should now see at least two tabs: Default and English. - The sections under each tab should continue to work correctly. - Test the "Save and continue" functionality again. When redirected you should return to both the correct tab and the correct panel, e.g. the "Print" section under the "English (en)" tab. --- .../prog/en/modules/tools/letter.tt | 219 +++++++++++------- koha-tmpl/intranet-tmpl/prog/js/letter.js | 37 +-- tools/letter.pl | 4 +- 3 files changed, 158 insertions(+), 102 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -22,7 +22,30 @@ Notices › Tools › Koha [% INCLUDE 'doc-head-close.inc' %] - +[% FILTER collapse %] + +[% END %] @@ -416,112 +439,134 @@ [% IF Koha.Preference('TranslateNotices') %]
-
+ [% END # /FOR mtt %] + + [% END # /FOREACH lang %] [% IF Koha.Preference('TranslateNotices') %] - + + [% END %] + [% END # /IF add_form %] --- a/koha-tmpl/intranet-tmpl/prog/js/letter.js +++ a/koha-tmpl/intranet-tmpl/prog/js/letter.js @@ -128,20 +128,31 @@ $(document).ready(function() { } }); - $( ".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 ); - } - } + let section = $("#section").val(); + if( section != "" ){ + $("a[href='#" + section + "']").click(); + } + + $(".panel-group").on("shown.bs.collapse", function (e) { + $("#section").val( e.target.id ); + }).on("hidden.bs.collapse", function (e) { + $("#section").val(""); }); + if( $("#tabs").length > 0 ){ + let langtab = $("#langtab").val(); + $("#tabs a[data-toggle='tab']").on("shown.bs.tab", function (e) { + var link = e.target.hash.replace("#",""); + $("#langtab").val( link ); + }); + + if( langtab != "" ){ + $("#tabs a[href='#" + langtab + "']").tab("show"); + } else { + $("#tabs a:first").tab("show"); + } + } + $(".insert").on("click",function(){ var containerid = $(this).data("containerid"); insertValueQuery( containerid ); @@ -153,8 +164,6 @@ $(document).ready(function() { $("#submit_form").click(); }); - $("#tabs").tabs(); - $("body").on("click", ".preview_template", function(e){ e.preventDefault(); var mtt = $(this).data("mtt"); --- a/tools/letter.pl +++ a/tools/letter.pl @@ -70,6 +70,7 @@ my $content = $input->param('content'); my $op = $input->param('op') || ''; my $redirect = $input->param('redirect'); my $section = $input->param('section'); +my $langtab = $input->param('langtab'); my $dbh = C4::Context->dbh; @@ -93,13 +94,14 @@ $template->param( searchfield => $searchfield, branchcode => $branchcode, section => $section, + langtab => $langtab, 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§ion=$section"); + print $input->redirect("/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=$branchcode&module=$module&code=$code&redirect=done§ion=$section&langtab=$langtab"); exit; } else { $op = q{}; # we return to the default screen for the next operation --