diff --git a/admin/new_ticket.php b/admin/new_ticket.php index d818c168..707369f5 100644 --- a/admin/new_ticket.php +++ b/admin/new_ticket.php @@ -286,7 +286,7 @@ $show_quick_help = $show['show']; } else if (isset($_GET['email'])) { echo hesk_GET('email'); } ?>" placeholder="" onkeyup="disableIfEmpty('email','notify-email')"> diff --git a/inc/ticket_list.inc.php b/inc/ticket_list.inc.php index 2d51790f..59e27218 100644 --- a/inc/ticket_list.inc.php +++ b/inc/ticket_list.inc.php @@ -27,7 +27,6 @@ * a license please visit the page below: * https://www.hesk.com/buy.php *******************************************************************************/ -define('MINIMUM_REFRESH_THRESHOLD_IN_SECONDS', 1); /* Check if this is a valid include */ if (!defined('IN_SCRIPT')) { die('Invalid attempt'); @@ -106,15 +105,7 @@ if ($total > 0) { $next_page = ($page + 1 > $pages) ? 0 : $page + 1; $autorefreshInSeconds = $_SESSION['autorefresh'] / 1000; $autorefresh = ''; - if ($autorefreshInSeconds >= MINIMUM_REFRESH_THRESHOLD_IN_SECONDS) { - $autorefresh = ' | ' . $hesklang['autorefresh'] . ' ' . $autorefreshInSeconds . ' ' . $hesklang['abbr']['second']; - ?> - - '; if ($pages > 1) { @@ -403,14 +394,11 @@ if ($total > 0) { // Print custom fields foreach ($hesk_settings['custom_fields'] as $key => $value) { if ($value['use'] && hesk_show_column($key)) { - echo '
![]() |
+ + | ![]() |
+
> + > + | +
+ + $v) { - if ($v['use'] && isset($_REQUEST[$k])) { + if ($v['use']==1 && isset($_REQUEST[$k])) { $_SESSION['c_' . $k] = $_REQUEST[$k]; } } @@ -131,10 +230,6 @@ function print_add_ticket() $_SESSION['isnotice'] = array(); } - if (!isset($_SESSION['c_category']) && !$hesk_settings['select_cat']) { - $_SESSION['c_category'] = 0; - } - hesk_cleanSessionVars('already_submitted'); // Tell header to load reCaptcha API if needed @@ -143,6 +238,29 @@ function print_add_ticket() } define('PAGE_TITLE', 'CUSTOMER_TICKET'); + + // Get categories + $hesk_settings['categories'] = array(); + $res = hesk_dbQuery("SELECT `id`, `name` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` WHERE `type`='0' ORDER BY `cat_order` ASC"); + while ($row=hesk_dbFetchAssoc($res)) { + $hesk_settings['categories'][$row['id']] = $row['name']; + } + + $number_of_categories = count($hesk_settings['categories']); + + if ($number_of_categories == 0) { + $category = 1; + } elseif ($number_of_categories == 1) { + $category = current(array_keys($hesk_settings['categories'])); + } else { + $category = isset($_GET['catid']) ? hesk_REQUEST('catid'): hesk_REQUEST('category'); + + // Force the customer to select a category? + if (!isset($hesk_settings['categories'][$category])) { + return print_select_category($number_of_categories); + } + } + // Print header $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket']; require_once(HESK_PATH . 'inc/header.inc.php'); @@ -151,7 +269,16 @@ function print_add_ticket() @@ -199,8 +326,8 @@ function print_add_ticket() enctype="multipart/form-data" >