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 6f82662715..8b55d9e07e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -97,7 +97,11 @@ $(document).ready(function() { } }); $( "#transport-types" ).accordion({ collapsible: true, active:false, animate: 200 }); -}); + $(".insert").on("click",function(){ + var containerid = $(this).data("containerid"); + insertValueQuery( containerid ); + }) +}); [% IF add_form or copy_form %] function cancel(f) { @@ -129,17 +133,11 @@ $(document).ready(function() { var myListBox = $(fieldset).find('select[name="SQLfieldname"]'); if($(myListBox).find('option').length > 0) { - var chaineAj = ""; - var NbSelect = 0; $(myListBox).find('option').each( function (){ if ( $(this).attr('selected') ) { - NbSelect++; - if (NbSelect > 1) - chaineAj += ", "; - chaineAj += $(this).val(); + $(myQuery).insertAtCaret("<<" + $(this).val() + ">>"); } - } ); - $(myQuery).insertAtCaret("<<" + chaineAj + ">>"); + }); } } [% END %] @@ -277,8 +275,8 @@ $(document).ready(function() { [% ELSE %]