Only check for rich text if setting is enabled

This commit is contained in:
Mike Koch 2015-09-15 13:35:07 -04:00
parent 75e332ea0c
commit d922bb58d7

View File

@ -1141,22 +1141,31 @@ function print_add_ticket()
<?php <?php
} // End ELSE submit_notice } // End ELSE submit_notice
?>
<script>
function validateRichText() {
$('#message-help-block').text("");
$('#message-group').removeClass('has-error');
var content = tinyMCE.get("message").getContent(); if ($modsForHesk_settings['rich_text_for_tickets_for_customers']):
if (content == '') { ?>
$('#message-help-block').text("<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>").focus(); <script>
$('#message-group').addClass('has-error'); function validateRichText() {
$('#message-group').get(0).scrollIntoView(); $('#message-help-block').text("");
return false; $('#message-group').removeClass('has-error');
var content = tinyMCE.get("message").getContent();
if (content == '') {
$('#message-help-block').text("<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>").focus();
$('#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=""/>