Only check for rich text if setting is enabled

merge-requests/2/head
Mike Koch 9 years ago
parent 75e332ea0c
commit d922bb58d7

@ -1141,22 +1141,31 @@ function print_add_ticket()
<?php <?php
} // End ELSE submit_notice } // End ELSE submit_notice
?>
<script> if ($modsForHesk_settings['rich_text_for_tickets_for_customers']):
function validateRichText() { ?>
$('#message-help-block').text(""); <script>
$('#message-group').removeClass('has-error'); function validateRichText() {
$('#message-help-block').text("");
var content = tinyMCE.get("message").getContent(); $('#message-group').removeClass('has-error');
if (content == '') {
$('#message-help-block').text("<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>").focus(); var content = tinyMCE.get("message").getContent();
$('#message-group').addClass('has-error'); if (content == '') {
$('#message-group').get(0).scrollIntoView(); $('#message-help-block').text("<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>").focus();
return false; $('#message-group').addClass('has-error');
$('#message-group').get(0).scrollIntoView();
return false;
}
return true;
} }
return true; </script>
} <?php else: ?>
</script> <script>
function validateRichText() {
return true;
}
</script>
<?php endif; ?>
<!-- Do not delete or modify the code below, it is used to detect simple SPAM bots --> <!-- Do not delete or modify the code below, it is used to detect simple SPAM bots -->
<input type="hidden" name="hx" value="3"/><input type="hidden" name="hy" value=""/> <input type="hidden" name="hx" value="3"/><input type="hidden" name="hy" value=""/>

Loading…
Cancel
Save