diff --git a/admin/new_ticket.php b/admin/new_ticket.php index ef67d3fb..2e0b0d2e 100644 --- a/admin/new_ticket.php +++ b/admin/new_ticket.php @@ -122,1026 +122,979 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php'); /* Print admin navigation */ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); -$columnWidth = 'col-md-8'; $showRs = hesk_dbQuery("SELECT `show` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "quick_help_sections` WHERE `id` = 5"); $show = hesk_dbFetchAssoc($showRs); -if (!$show['show']) { - $columnWidth = 'col-md-10 col-md-offset-1'; -} +$show_quick_help = $show['show']; ?> -
- -
-
-
-
-

-
- -

*

-
+
+ +
+
+

+ +

+
+
+
+

+
+ +

*

+
+
-
- -

- -
- - - - - -
> - -
-
+
+ + +
+ +
+
+ +
+
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+ + + +
+
+
+ -
- - -
'; - break; - - /* Checkbox */ - case 'checkbox': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - echo '
'; - $options = explode('#HESK#', $v['value']); - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - - foreach ($options as $option) { - - if (in_array($option, $k_value)) { - $checked = 'checked="checked"'; - } else { - $checked = ''; - } + /* custom fields AFTER comments */ + + foreach ($hesk_settings['custom_fields'] as $k => $v) { + if ($v['use'] && $v['place']) { + if ($modsForHesk_settings['custom_field_setting']) { + $v['name'] = $hesklang[$v['name']]; + } + + // $v['req'] = $v['req'] ? '*' : ''; + // Staff doesn't need to fill in required custom fields + $v['req'] = ''; + + if ($v['type'] == 'checkbox') { + $k_value = array(); + if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) { + foreach ($_SESSION["c_$k"] as $myCB) { + $k_value[] = stripslashes(hesk_input($myCB)); + } + } + } elseif (isset($_SESSION["c_$k"])) { + $k_value = stripslashes(hesk_input($_SESSION["c_$k"])); + } else { + $k_value = ''; + } + + switch ($v['type']) { + /* Radio box */ + case 'radio': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $v['name']); + + echo '
'; + + $options = explode('#HESK#', $v['value']); + $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + + foreach ($options as $option) { + + if (strlen($k_value) == 0 || $k_value == $option) { + $k_value = $option; + $checked = 'checked="checked"'; + } else { + $checked = ''; + } + + echo '
'; + } + + echo '
'; + break; + + /* Select drop-down box */ + case 'select': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $v['name']); + + $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + + echo '
+
'; + break; + + /* Checkbox */ + case 'checkbox': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $v['name']); + + echo '
'; + + $options = explode('#HESK#', $v['value']); + $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + + foreach ($options as $option) { + + if (in_array($option, $k_value)) { + $checked = 'checked="checked"'; + } else { + $checked = ''; + } + + echo '
'; + } + echo '
'; + break; + + /* Large text box */ + case 'textarea': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $v['name']); + + $size = explode('#', $v['value']); + $size[0] = empty($size[0]) ? 5 : intval($size[0]); + $size[1] = empty($size[1]) ? 30 : intval($size[1]); - echo '
'; - } - echo '
'; - break; - - /* Large text box */ - case 'textarea': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - $size = explode('#', $v['value']); - $size[0] = empty($size[0]) ? 5 : intval($size[0]); - $size[1] = empty($size[1]) ? 30 : intval($size[1]); - - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - - echo '
- -
-
'; - break; - - case 'date': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - if (strlen($k_value) != 0) { - $v['value'] = $k_value; - } + $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - $cls = in_array($k, $_SESSION['iserror']) ? ' isError ' : ''; - - echo ' -
- -
- - ' . $hesklang['date_format'] . ' -
-
'; - break; - - case 'email': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - if (strlen($k_value) != 0) { - $v['value'] = $k_value; - } + echo '
+ +
+
'; + break; - if ($v['value'] == 'cc' || $v['value'] == 'bcc') { - // (b)cc isn't a valid email but is the "value" used by settings. Just remove it. - $v['value'] = ''; - } + case 'date': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + if (strlen($k_value) != 0) { + $v['value'] = $k_value; + } - echo '
- -
-
'; + $cls = in_array($k, $_SESSION['iserror']) ? ' isError ' : ''; - break; + echo ' +
+ +
+ + ' . $hesklang['date_format'] . ' +
+
'; + break; - case 'hidden': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $formattedId); + case 'multiselect': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - if (strlen($k_value) != 0) { - $v['value'] = $k_value; - } + $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + echo '
+
'; + $options = explode('#HESK#', $v['value']); - break; + foreach ($options as $option) { - case 'readonly': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $formattedId); + if ($k_value == $option) { + $k_value = $option; + $selected = 'selected="selected"'; + } else { + $selected = ''; + } - if (strlen($k_value) != 0) { - $v['value'] = $k_value; - } + echo ''; + } + + echo ' +
+ + +
'; + break; - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + case 'email': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - echo '
- -
-
'; + if (strlen($k_value) != 0) { + $v['value'] = $k_value; + } - break; + if ($v['value'] == 'cc' || $v['value'] == 'bcc') { + // (b)cc isn't a valid email but is the "value" used by settings. Just remove it. + $v['value'] = ''; + } + + $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - /* Default text input */ - default: - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); + echo '
+ +
+
'; + + break; - if (strlen($k_value) != 0) { - $v['value'] = $k_value; - } + case 'hidden': + //Clean up multiple dashes or whitespaces + $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); + $formattedId = preg_replace("/[\s_]/", "-", $formattedId); - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + if (strlen($k_value) != 0) { + $v['value'] = $k_value; + } - echo '
- -
-
'; - } - } -} -?> - - - - - -
- - -
-
- -
-
- -
- ' . $hesklang['ticket_tpl_man'] . ')' : ''; ?> -
-
-
- - -
- -
-
- -
-
- -
-
- - -
- -
- - -
-
- -'; -} else { - echo '
'; -} ?> - -
- -
-
-
-'; -} else { - echo '
'; -} ?> - -
- - - -
-
-
-
- - $v) { - if ($v['use'] && $v['place']) { - if ($modsForHesk_settings['custom_field_setting']) { - $v['name'] = $hesklang[$v['name']]; - } - - // $v['req'] = $v['req'] ? '*' : ''; - // Staff doesn't need to fill in required custom fields - $v['req'] = ''; - - if ($v['type'] == 'checkbox') { - $k_value = array(); - if (isset($_SESSION["c_$k"]) && is_array($_SESSION["c_$k"])) { - foreach ($_SESSION["c_$k"] as $myCB) { - $k_value[] = stripslashes(hesk_input($myCB)); - } - } - } elseif (isset($_SESSION["c_$k"])) { - $k_value = stripslashes(hesk_input($_SESSION["c_$k"])); - } else { - $k_value = ''; - } - - switch ($v['type']) { - /* Radio box */ - case 'radio': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - echo '
'; - - $options = explode('#HESK#', $v['value']); - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - - foreach ($options as $option) { - - if (strlen($k_value) == 0 || $k_value == $option) { - $k_value = $option; - $checked = 'checked="checked"'; - } else { - $checked = ''; - } + if (strlen($k_value) != 0) { + $v['value'] = $k_value; + } - echo '
'; - } - - echo '
'; - break; + $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - /* Select drop-down box */ - case 'select': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); + echo '
+ +
+
'; - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; + break; - echo '
-
+
'; + } } - - echo ''; } + /* end custom after */ + /* attachments */ + if ($hesk_settings['attachments']['use']) { - echo '
'; - break; - - /* Checkbox */ - case 'checkbox': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - echo '
'; - - $options = explode('#HESK#', $v['value']); - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - - foreach ($options as $option) { + ?> +
+ - if (in_array($option, $k_value)) { - $checked = 'checked="checked"'; - } else { - $checked = ''; - } - - echo '
'; - } - echo '
'; - break; - - /* Large text box */ - case 'textarea': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - $size = explode('#', $v['value']); - $size[0] = empty($size[0]) ? 5 : intval($size[0]); - $size[1] = empty($size[1]) ? 30 : intval($size[1]); - - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - - echo '
- -
-
'; - break; - - case 'date': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - if (strlen($k_value) != 0) { - $v['value'] = $k_value; - } - - $cls = in_array($k, $_SESSION['iserror']) ? ' isError ' : ''; - - echo ' -
- -
- - ' . $hesklang['date_format'] . ' -
-
'; - break; - - case 'multiselect': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - - echo '
-
-
- - -
'; - break; - - case 'email': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - if (strlen($k_value) != 0) { - $v['value'] = $k_value; - } - - if ($v['value'] == 'cc' || $v['value'] == 'bcc') { - // (b)cc isn't a valid email but is the "value" used by settings. Just remove it. - $v['value'] = ''; +
+ +
+
+ - -
- '; - - break; - - case 'hidden': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $formattedId); - - if (strlen($k_value) != 0) { - $v['value'] = $k_value; + if (!isset($_SESSION['as_notify'])) { + $_SESSION['as_notify'] = $_SESSION['notify_customer_new'] ? 1 : 0; } + ?> +
+ - $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; - - echo ''; - - break; - - case 'readonly': - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $formattedId); - - if (strlen($k_value) != 0) { - $v['value'] = $k_value; +
+
+ +
+
+ +
+ +
+ +
+
+ - -
- '; - - break; - - /* Default text input */ - default: - //Clean up multiple dashes or whitespaces - $formattedId = preg_replace("/[\s-]+/", " ", $v['name']); - $formattedId = preg_replace("/[\s_]/", "-", $v['name']); - - if (strlen($k_value) != 0) { - $v['value'] = $k_value; + elseif (hesk_checkPermission('can_assign_self',0)) + { + $checked = (!isset($_SESSION['as_owner']) || !empty($_SESSION['as_owner'])) ? 'checked="checked"' : ''; + ?> +
+
+ +
+
+ +
+ - echo '
- -
-
'; - } - } -} -/* end custom after */ -/* attachments */ -if ($hesk_settings['attachments']['use']) { - - ?> -
- +
+

-
- + +
+
+ + +
+
+ + + + +
+
+
-
- - - -
- - -
-
-
-
-
-
-';} else {echo '
';} ?> - -
- -
-
- -
-
- -
-
- -
- - -
-

- - -
-
- - -
-
- - - - -
-
-