@@ -, +, @@ --- .../intranet-tmpl/prog/en/modules/tools/letter.tt | 37 +++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -26,6 +26,7 @@ $(document).ready(function() { [% END %] $("#submit").click( function(event) { + var at_least_one_exists = 0; $("fieldset.mtt").each( function(){ var title = $(this).find('input[name="title"]').val(); var content = $(this).find('textarea[name="content"]').val(); @@ -36,10 +37,19 @@ $(document).ready(function() { var mtt = $(this).find('input[name="message_transport_type"]').val(); var msg = _("Please specify title and content for %s"); msg = msg.replace( "%s", mtt ); + at_least_one_exists = 1; alert(msg) event.preventDefault(); + return false; + } else if ( title.length > 0 && content.length > 0 ) { + at_least_one_exists = 1; } } ); + if ( ! at_least_one_exists ) { + alert( _("Please fill at least one template.") ); + event.preventDefault(); + return false; + } return true; }); @@ -212,7 +222,7 @@ $(document).ready(function() { [% IF ( add_form ) %]