Add validation for ticket templates

merge-requests/2/head
Mike Koch 9 years ago
parent f2ad2f5b98
commit dafc94c58a

@ -30,6 +30,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@ -187,8 +188,13 @@ $num = hesk_dbNumRows($result);
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
$onsubmit = '';
if ($modsForHesk_settings['rich_text_for_tickets']) {
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
}
?>
<form class="form-horizontal" action="manage_ticket_templates.php" method="post" name="form1" role="form">
<form class="form-horizontal" action="manage_ticket_templates.php" method="post" name="form1" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
<h3><?php echo $hesklang['new_ticket_tpl']; ?> <a href="javascript:void(0)"
onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['ticket_tpl_intro']); ?>')"><i
class="fa fa-question-circle settingsquestionmark"></i></a></h3>
@ -235,21 +241,24 @@ $num = hesk_dbNumRows($result);
<div class="col-sm-10">
<span id="HeskTitle">
<input id="subject" class="form-control" type="text" name="name" size="40" maxlength="50"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['ticket_tpl_title']); ?>"
<?php if (isset($_SESSION['canned']['name'])) {
echo ' value="' . stripslashes($_SESSION['canned']['name']) . '" ';
} ?>>
} ?> required>
</span>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="form-group" id="message-group">
<label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
<div class="col-sm-10">
<span id="HeskMsg">
<textarea id="message" class="form-control htmlEditor"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="msg"
rows="15" cols="70"><?php
rows="15" cols="70" required><?php
if (isset($_SESSION['canned']['msg'])) {
if ($modsForHesk_settings['rich_text_for_tickets']) {
echo $_SESSION['canned']['msg'];
@ -259,6 +268,7 @@ $num = hesk_dbNumRows($result);
}
?></textarea>
</span>
<div class="help-block with-errors" id="message-help-block"></div>
</div>
</div>
<div class="form-group">

Loading…
Cancel
Save