|
|
@ -252,350 +252,349 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
|
|
|
|
/* Print admin navigation */
|
|
|
|
/* Print admin navigation */
|
|
|
|
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|
|
|
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="content-wrapper">
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<a href="admin_ticket.php?track=<?php echo $trackingID; ?>&Refresh=<?php echo mt_rand(10000, 99999); ?>"><?php echo $hesklang['ticket'] . ' ' . $trackingID; ?></a>
|
|
|
|
<a href="admin_ticket.php?track=<?php echo $trackingID; ?>&Refresh=<?php echo mt_rand(10000, 99999); ?>"><?php echo $hesklang['ticket'] . ' ' . $trackingID; ?></a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li class="active"><?php echo $hesklang['edtt']; ?></li>
|
|
|
|
<li class="active"><?php echo $hesklang['edtt']; ?></li>
|
|
|
|
</ol>
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
<section class="content">
|
|
|
|
<section class="content">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h1 class="box-title">
|
|
|
|
<h1 class="box-title">
|
|
|
|
<?php echo $hesklang['edtt']; ?>
|
|
|
|
<?php echo $hesklang['edtt']; ?>
|
|
|
|
</h1>
|
|
|
|
</h1>
|
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<div class="box-tools pull-right">
|
|
|
|
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
|
|
|
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
|
|
|
<i class="fa fa-minus"></i>
|
|
|
|
<i class="fa fa-minus"></i>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<div class="box-body">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$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 role="form" class="form-horizontal" method="post" action="edit_post.php" name="form1" <?php echo $onsubmit; ?>>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
/* If it's not a reply edit all the fields */
|
|
|
|
$onsubmit = '';
|
|
|
|
if (!$is_reply) {
|
|
|
|
if ($modsForHesk_settings['rich_text_for_tickets']) {
|
|
|
|
if ($hesk_settings['can_sel_lang']) {
|
|
|
|
$onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
|
|
|
|
?>
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<form role="form" class="form-horizontal" method="post" action="edit_post.php" name="form1" <?php echo $onsubmit; ?>>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/* If it's not a reply edit all the fields */
|
|
|
|
|
|
|
|
if (!$is_reply) {
|
|
|
|
|
|
|
|
if ($hesk_settings['can_sel_lang']) {
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<label for="customerLanguage"
|
|
|
|
|
|
|
|
class="col-sm-3 control-label"><?php echo $hesklang['chol']; ?></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<select name="customerLanguage" id="customerLanguage" class="form-control">
|
|
|
|
|
|
|
|
<?php hesk_listLanguages(); ?>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php } else {
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="customerLanguage" value="' . $ticket['language'] . '">';
|
|
|
|
|
|
|
|
} ?>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="customerLanguage"
|
|
|
|
<?php
|
|
|
|
class="col-sm-3 control-label"><?php echo $hesklang['chol']; ?></label>
|
|
|
|
$required = '';
|
|
|
|
|
|
|
|
$required_attribute = '';
|
|
|
|
|
|
|
|
if ($hesk_settings['require_subject'] == 1) {
|
|
|
|
|
|
|
|
$required = ' <span class="important">*</span>';
|
|
|
|
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject'] . $required; ?></label>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<select name="customerLanguage" id="customerLanguage" class="form-control">
|
|
|
|
<input class="form-control" type="text" name="subject" size="40" maxlength="40"
|
|
|
|
<?php hesk_listLanguages(); ?>
|
|
|
|
value="<?php echo $ticket['subject']; ?>"
|
|
|
|
</select>
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php } else {
|
|
|
|
<div class="form-group">
|
|
|
|
echo '<input type="hidden" name="customerLanguage" value="' . $ticket['language'] . '">';
|
|
|
|
<label for="name" class="col-sm-3 control-label">
|
|
|
|
} ?>
|
|
|
|
<?php echo $hesklang['name']; ?>
|
|
|
|
<div class="form-group">
|
|
|
|
<span class="important">*</span>
|
|
|
|
<?php
|
|
|
|
</label>
|
|
|
|
$required = '';
|
|
|
|
|
|
|
|
$required_attribute = '';
|
|
|
|
|
|
|
|
if ($hesk_settings['require_subject'] == 1) {
|
|
|
|
|
|
|
|
$required = ' <span class="important">*</span>';
|
|
|
|
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject'] . $required; ?></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input class="form-control" type="text" name="subject" size="40" maxlength="40"
|
|
|
|
<input class="form-control" type="text" name="name" size="40" maxlength="30"
|
|
|
|
value="<?php echo $ticket['subject']; ?>"
|
|
|
|
value="<?php echo $ticket['name']; ?>"
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?>"/>
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>"
|
|
|
|
|
|
|
|
data-error="<?php echo $hesklang['this_field_is_required']; ?>"
|
|
|
|
|
|
|
|
required>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
|
|
<label for="name" class="col-sm-3 control-label">
|
|
|
|
$required = '';
|
|
|
|
<?php echo $hesklang['name']; ?>
|
|
|
|
$required_attribute = '';
|
|
|
|
<span class="important">*</span>
|
|
|
|
if ($hesk_settings['require_email']) {
|
|
|
|
</label>
|
|
|
|
$required = ' <span class="important">*</span>';
|
|
|
|
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
<div class="col-sm-9">
|
|
|
|
}
|
|
|
|
<input class="form-control" type="text" name="name" size="40" maxlength="30"
|
|
|
|
?>
|
|
|
|
value="<?php echo $ticket['name']; ?>"
|
|
|
|
<label for="email"
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['name']); ?>"
|
|
|
|
class="col-sm-3 control-label"><?php echo $hesklang['email'] . $required; ?></label>
|
|
|
|
data-error="<?php echo $hesklang['this_field_is_required']; ?>"
|
|
|
|
|
|
|
|
required>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<input class="form-control" type="text" name="email" size="40" maxlength="1000"
|
|
|
|
|
|
|
|
value="<?php echo $ticket['email']; ?>"
|
|
|
|
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"
|
|
|
|
|
|
|
|
<?php echo $required_attribute ?>>
|
|
|
|
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
$required = '';
|
|
|
|
foreach ($hesk_settings['custom_fields'] as $k => $v) {
|
|
|
|
$required_attribute = '';
|
|
|
|
if ($v['use'] && hesk_is_custom_field_in_category($k, $ticket['category'])) {
|
|
|
|
if ($hesk_settings['require_email']) {
|
|
|
|
$k_value = $ticket[$k];
|
|
|
|
$required = ' <span class="important">*</span>';
|
|
|
|
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
if ($v['type'] == 'checkbox') {
|
|
|
|
}
|
|
|
|
$k_value = explode('<br>', $k_value);
|
|
|
|
?>
|
|
|
|
}
|
|
|
|
<label for="email"
|
|
|
|
|
|
|
|
class="col-sm-3 control-label"><?php echo $hesklang['email'] . $required; ?></label>
|
|
|
|
if ($v['req'] == 2) {
|
|
|
|
|
|
|
|
$v['req'] = '<span class="important">*</span>';
|
|
|
|
<div class="col-sm-9">
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
<input class="form-control" type="text" name="email" size="40" maxlength="1000"
|
|
|
|
} else {
|
|
|
|
value="<?php echo $ticket['email']; ?>"
|
|
|
|
$v['req'] = '';
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"
|
|
|
|
$required_attribute = '';
|
|
|
|
<?php echo $required_attribute ?>>
|
|
|
|
}
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
switch ($v['type']) {
|
|
|
|
</div>
|
|
|
|
/* Radio box */
|
|
|
|
<?php
|
|
|
|
case 'radio':
|
|
|
|
foreach ($hesk_settings['custom_fields'] as $k => $v) {
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
if ($v['use'] && hesk_is_custom_field_in_category($k, $ticket['category'])) {
|
|
|
|
echo '
|
|
|
|
$k_value = $ticket[$k];
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
|
|
|
|
<div class="col-sm-9">';
|
|
|
|
|
|
|
|
foreach ($v['value']['radio_options'] as $option) {
|
|
|
|
|
|
|
|
if (strlen($k_value) == 0) {
|
|
|
|
|
|
|
|
$k_value = $option;
|
|
|
|
|
|
|
|
$checked = empty($v['value']['no_default']) ? 'checked="checked"' : '';
|
|
|
|
|
|
|
|
} elseif ($k_value == $option) {
|
|
|
|
|
|
|
|
$k_value = $option;
|
|
|
|
|
|
|
|
$checked = 'checked="checked"';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$checked = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<div class="radio"><label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $required_attribute . '> ' . $option . '</label></div>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div class="help-block with-errors"></div></div>
|
|
|
|
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
|
|
|
|
if ($v['type'] == 'checkbox') {
|
|
|
|
break;
|
|
|
|
$k_value = explode('<br>', $k_value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($v['req'] == 2) {
|
|
|
|
/* Select drop-down box */
|
|
|
|
$v['req'] = '<span class="important">*</span>';
|
|
|
|
case 'select':
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$v['req'] = '';
|
|
|
|
|
|
|
|
$required_attribute = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch ($v['type']) {
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
/* Radio box */
|
|
|
|
|
|
|
|
case 'radio':
|
|
|
|
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
|
|
|
|
echo '
|
|
|
|
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
|
|
|
|
<div class="col-sm-9">';
|
|
|
|
|
|
|
|
foreach ($v['value']['radio_options'] as $option) {
|
|
|
|
|
|
|
|
if (strlen($k_value) == 0) {
|
|
|
|
|
|
|
|
$k_value = $option;
|
|
|
|
|
|
|
|
$checked = empty($v['value']['no_default']) ? 'checked="checked"' : '';
|
|
|
|
|
|
|
|
} elseif ($k_value == $option) {
|
|
|
|
|
|
|
|
$k_value = $option;
|
|
|
|
|
|
|
|
$checked = 'checked="checked"';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$checked = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<div class="radio"><label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $required_attribute . '> ' . $option . '</label></div>';
|
|
|
|
echo '
|
|
|
|
}
|
|
|
|
<div class="form-group">
|
|
|
|
echo '<div class="help-block with-errors"></div></div>
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
</div>';
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<select name="' . $k . '" class="form-control" ' . $required_attribute . '>';
|
|
|
|
break;
|
|
|
|
// Show "Click to select"?
|
|
|
|
|
|
|
|
if (!empty($v['value']['show_select'])) {
|
|
|
|
/* Select drop-down box */
|
|
|
|
echo '<option value="">' . $hesklang['select'] . '</option>';
|
|
|
|
case 'select':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<select name="' . $k . '" class="form-control" ' . $required_attribute . '>';
|
|
|
|
|
|
|
|
// Show "Click to select"?
|
|
|
|
|
|
|
|
if (!empty($v['value']['show_select'])) {
|
|
|
|
|
|
|
|
echo '<option value="">' . $hesklang['select'] . '</option>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($v['value']['select_options'] as $option) {
|
|
|
|
|
|
|
|
if ($k_value == $option) {
|
|
|
|
|
|
|
|
$k_value = $option;
|
|
|
|
|
|
|
|
$selected = 'selected';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$selected = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '<option ' . $selected . '>' . $option . '</option>';
|
|
|
|
foreach ($v['value']['select_options'] as $option) {
|
|
|
|
}
|
|
|
|
if ($k_value == $option) {
|
|
|
|
|
|
|
|
$k_value = $option;
|
|
|
|
|
|
|
|
$selected = 'selected';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$selected = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '</select>
|
|
|
|
echo '<option ' . $selected . '>' . $option . '</option>';
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Checkbox */
|
|
|
|
|
|
|
|
case 'checkbox':
|
|
|
|
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
|
|
|
|
echo '
|
|
|
|
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
|
|
|
|
<div class="col-sm-9">';
|
|
|
|
|
|
|
|
foreach ($v['value']['checkbox_options'] as $option) {
|
|
|
|
|
|
|
|
if (in_array($option, $k_value)) {
|
|
|
|
|
|
|
|
$checked = 'checked';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$checked = '';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '<div class="checkbox"><label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $required_attribute . '> ' . $option . '</label></div>';
|
|
|
|
echo '</select>
|
|
|
|
}
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
echo '<div class="help-block with-errors"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
</div>';
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
/* Checkbox */
|
|
|
|
/* Large text box */
|
|
|
|
case 'checkbox':
|
|
|
|
case 'textarea':
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
echo '
|
|
|
|
$k_value = hesk_msgToPlain($k_value, 0, 0);
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
echo '
|
|
|
|
<div class="col-sm-9">';
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
foreach ($v['value']['checkbox_options'] as $option) {
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
if (in_array($option, $k_value)) {
|
|
|
|
<div class="col-sm-9">
|
|
|
|
$checked = 'checked';
|
|
|
|
<textarea name="' . $k . '" class="form-control" rows="' . intval($v['value']['rows']) . '" cols="' . intval($v['value']['cols']) . '" ' . $required_attribute . '>' . $k_value . '</textarea>
|
|
|
|
} else {
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
$checked = '';
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
break;
|
|
|
|
echo '<div class="checkbox"><label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $required_attribute . '> ' . $option . '</label></div>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
// Date
|
|
|
|
/* Large text box */
|
|
|
|
case 'date':
|
|
|
|
case 'textarea':
|
|
|
|
if ($required_attribute !== '') {
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
$required_attribute .= ' pattern="[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])"';
|
|
|
|
$k_value = hesk_msgToPlain($k_value, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
echo '
|
|
|
|
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<textarea name="' . $k . '" class="form-control" rows="' . intval($v['value']['rows']) . '" cols="' . intval($v['value']['cols']) . '" ' . $required_attribute . '>' . $k_value . '</textarea>
|
|
|
|
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
$k_value = hesk_custom_date_display_format($k_value, 'Y-m-d');
|
|
|
|
// Date
|
|
|
|
|
|
|
|
case 'date':
|
|
|
|
|
|
|
|
if ($required_attribute !== '') {
|
|
|
|
|
|
|
|
$required_attribute .= ' pattern="[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])"';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<input type="text" name="' . $k . '" value="' . $k_value . '" class="datepicker form-control" size="10" ' . $required_attribute . '>
|
|
|
|
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Email
|
|
|
|
$k_value = hesk_custom_date_display_format($k_value, 'Y-m-d');
|
|
|
|
case 'email':
|
|
|
|
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$suggest = $hesk_settings['detect_typos'] ? 'onblur="Javascript:hesk_suggestEmail(\'' . $k . '\', \'' . $k . '_suggestions\', 0, 1' . ($v['value']['multiple'] ? ',1' : '') . ')"' : '';
|
|
|
|
echo '
|
|
|
|
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<input type="text" name="' . $k . '" value="' . $k_value . '" class="datepicker form-control" size="10" ' . $required_attribute . '>
|
|
|
|
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>';
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Email
|
|
|
|
|
|
|
|
case 'email':
|
|
|
|
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$suggest = $hesk_settings['detect_typos'] ? 'onblur="Javascript:hesk_suggestEmail(\'' . $k . '\', \'' . $k . '_suggestions\', 0, 1' . ($v['value']['multiple'] ? ',1' : '') . ')"' : '';
|
|
|
|
|
|
|
|
|
|
|
|
echo '
|
|
|
|
echo '
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input class="form-control" type="text" name="' . $k . '" id="' . $k . '" value="' . $k_value . '" size="40" ' . $suggest . ' ' . $required_attribute . '>
|
|
|
|
<input class="form-control" type="text" name="' . $k . '" id="' . $k . '" value="' . $k_value . '" size="40" ' . $suggest . ' ' . $required_attribute . '>
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="' . $k . '_suggestions"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="' . $k . '_suggestions"></div>
|
|
|
|
';
|
|
|
|
</div>
|
|
|
|
break;
|
|
|
|
';
|
|
|
|
|
|
|
|
break;
|
|
|
|
// Hidden (same as text for staff)
|
|
|
|
|
|
|
|
case 'hidden':
|
|
|
|
// Hidden (same as text for staff)
|
|
|
|
case 'readonly':
|
|
|
|
case 'hidden':
|
|
|
|
default:
|
|
|
|
case 'readonly':
|
|
|
|
if (strlen($k_value) != 0) {
|
|
|
|
default:
|
|
|
|
$v['value']['default_value'] = $k_value;
|
|
|
|
if (strlen($k_value) != 0) {
|
|
|
|
}
|
|
|
|
$v['value']['default_value'] = $k_value;
|
|
|
|
|
|
|
|
}
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
|
|
|
|
|
|
|
|
$cls = in_array($k, $_SESSION['iserror']) ? ' isError' : '';
|
|
|
|
echo '
|
|
|
|
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
echo '
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
<div class="form-group' . $cls . '">
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<label for="' . $k . '" class="col-sm-3 control-label">' . $v['name'] . ' ' . $v['req'] . '</label>
|
|
|
|
<input type="text" class="form-control" name="' . $k . '" size="40" maxlength="' . intval($v['value']['max_length']) . '" value="' . $v['value']['default_value'] . '" ' . $required_attribute . '>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
<input type="text" class="form-control" name="' . $k . '" size="40" maxlength="' . intval($v['value']['max_length']) . '" value="' . $v['value']['default_value'] . '" ' . $required_attribute . '>
|
|
|
|
</div>
|
|
|
|
<div class="help-block with-errors"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
';
|
|
|
|
';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} ?>
|
|
|
|
} ?>
|
|
|
|
<div class="form-group" id="message-group">
|
|
|
|
<div class="form-group" id="message-group">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$required = '';
|
|
|
|
|
|
|
|
$required_attribute = '';
|
|
|
|
|
|
|
|
if ($hesk_settings['require_message'] == 1) {
|
|
|
|
|
|
|
|
$required = ' <span class="important">*</span>';
|
|
|
|
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message'] . $required; ?></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-sm-9">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
$message = $ticket['html'] ? hesk_html_entity_decode($ticket['message']) : $ticket['message'];
|
|
|
|
$required = '';
|
|
|
|
|
|
|
|
$required_attribute = '';
|
|
|
|
|
|
|
|
if ($hesk_settings['require_message'] == 1) {
|
|
|
|
|
|
|
|
$required = ' <span class="important">*</span>';
|
|
|
|
|
|
|
|
$required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<textarea class="form-control htmlEditor" name="message" rows="12"
|
|
|
|
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message'] . $required; ?></label>
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>"
|
|
|
|
|
|
|
|
cols="60" <?php echo $required_attribute; ?>><?php echo $message; ?></textarea>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="help-block with-errors" id="message-help-block"></div>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$message = $ticket['html'] ? hesk_html_entity_decode($ticket['message']) : $ticket['message'];
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<textarea class="form-control htmlEditor" name="message" rows="12"
|
|
|
|
|
|
|
|
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>"
|
|
|
|
|
|
|
|
cols="60" <?php echo $required_attribute; ?>><?php echo $message; ?></textarea>
|
|
|
|
|
|
|
|
<div class="help-block with-errors" id="message-help-block"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-group">
|
|
|
|
<input type="hidden" name="save" value="1">
|
|
|
|
<input type="hidden" name="save" value="1">
|
|
|
|
<input type="hidden" name="track" value="<?php echo $trackingID; ?>">
|
|
|
|
<input type="hidden" name="track" value="<?php echo $trackingID; ?>">
|
|
|
|
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
|
|
|
|
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>">
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
if ($is_reply) {
|
|
|
|
if ($is_reply) {
|
|
|
|
?>
|
|
|
|
|
|
|
|
<input type="hidden" name="reply" value="<?php echo $tmpvar['id']; ?>">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<input type="hidden" name="reply" value="<?php echo $tmpvar['id']; ?>">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group" style="text-align: center">
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
$html = $ticket['html'] ? 1 : 0;
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<input type="hidden" name="html" value="<?php echo $html; ?>">
|
|
|
|
<div class="form-group" style="text-align: center">
|
|
|
|
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-default">
|
|
|
|
<?php
|
|
|
|
<?php if (isset($_REQUEST['isManager']) && $_REQUEST['isManager']): ?>
|
|
|
|
$html = $ticket['html'] ? 1 : 0;
|
|
|
|
<input type="hidden" name="isManager" value="1">
|
|
|
|
?>
|
|
|
|
<?php endif; ?>
|
|
|
|
<input type="hidden" name="html" value="<?php echo $html; ?>">
|
|
|
|
<a class="btn btn-default" href="javascript:history.go(-1)"><?php echo $hesklang['back']; ?></a>
|
|
|
|
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-default">
|
|
|
|
</div>
|
|
|
|
<?php if (isset($_REQUEST['isManager']) && $_REQUEST['isManager']): ?>
|
|
|
|
</form>
|
|
|
|
<input type="hidden" name="isManager" value="1">
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<a class="btn btn-default" href="javascript:history.go(-1)"><?php echo $hesklang['back']; ?></a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
buildValidatorForTicketSubmission('form1', "<?php echo addslashes($hesklang['select_at_least_one_value']); ?>");
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<?php if ($ticket['html']): ?>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
/* <![CDATA[ */
|
|
|
|
|
|
|
|
tinyMCE.init({
|
|
|
|
|
|
|
|
mode: "textareas",
|
|
|
|
|
|
|
|
editor_selector: "htmlEditor",
|
|
|
|
|
|
|
|
elements: "content",
|
|
|
|
|
|
|
|
theme: "advanced",
|
|
|
|
|
|
|
|
convert_urls: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
theme_advanced_buttons1: "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
|
|
|
|
|
|
|
|
theme_advanced_buttons2: "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
|
|
|
|
|
|
|
|
theme_advanced_buttons3: "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
theme_advanced_toolbar_location: "top",
|
|
|
|
|
|
|
|
theme_advanced_toolbar_align: "left",
|
|
|
|
|
|
|
|
theme_advanced_statusbar_location: "bottom",
|
|
|
|
|
|
|
|
theme_advanced_resizing: true
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
/* ]]> */
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
buildValidatorForTicketSubmission('form1', "<?php echo addslashes($hesklang['select_at_least_one_value']); ?>");
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<?php if ($ticket['html']): ?>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
/* <![CDATA[ */
|
|
|
|
|
|
|
|
tinyMCE.init({
|
|
|
|
|
|
|
|
mode: "textareas",
|
|
|
|
|
|
|
|
editor_selector: "htmlEditor",
|
|
|
|
|
|
|
|
elements: "content",
|
|
|
|
|
|
|
|
theme: "advanced",
|
|
|
|
|
|
|
|
convert_urls: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
theme_advanced_buttons1: "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
|
|
|
|
|
|
|
|
theme_advanced_buttons2: "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
|
|
|
|
|
|
|
|
theme_advanced_buttons3: "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
theme_advanced_toolbar_location: "top",
|
|
|
|
|
|
|
|
theme_advanced_toolbar_align: "left",
|
|
|
|
|
|
|
|
theme_advanced_statusbar_location: "bottom",
|
|
|
|
|
|
|
|
theme_advanced_resizing: true
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
/* ]]> */
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
require_once(HESK_PATH . 'inc/footer.inc.php');
|
|
|
|
require_once(HESK_PATH . 'inc/footer.inc.php');
|
|
|
|
exit();
|
|
|
|
exit();
|
|
|
|
?>
|
|
|
|
|