From ff0ca2c99eeaa38524b2ea7a6081eb3f2420e1e7 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 12 Jan 2015 21:44:27 -0500 Subject: [PATCH] #92 Update root index.php --- index.php | 156 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 135 insertions(+), 21 deletions(-) diff --git a/index.php b/index.php index 27d6349c..33d2862f 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ $v) + { + if ($v['use'] && isset($_REQUEST[$k]) ) + { + $_SESSION['c_'.$k] = $_REQUEST[$k]; + } + } + + + // Variables for coloring the fields in case of errors if ( ! isset($_SESSION['iserror'])) { $_SESSION['iserror'] = array(); @@ -82,13 +140,19 @@ function print_add_ticket() $_SESSION['isnotice'] = array(); } - if ( ! isset($_SESSION['c_category'])) +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 + if ($hesk_settings['recaptcha_use'] == 2) + { + define('RECAPTCHA',1); + } + // Print header $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket']; require_once(HESK_PATH . 'inc/header.inc.php'); @@ -135,7 +199,7 @@ function print_add_ticket()
- placeholder="" /> + placeholder="" />
- placeholder="" /> + placeholder="" />
@@ -187,6 +245,12 @@ function print_add_ticket()
> + '.$hesklang['select'].''; + } + ?> @@ -288,12 +359,19 @@ function print_add_ticket() echo '
'; - $options = explode('#HESK#',$v['value']); + // Show "Click to select"? + $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num); + if ($num) + { + echo ''; + } + + + $options = explode('#HESK#',$v['value']); foreach ($options as $option) { - if (strlen($k_value) == 0 || $k_value == $option) + if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; @@ -598,7 +684,7 @@ function print_add_ticket() foreach ($options as $option) { - if (strlen($k_value) == 0 || $k_value == $option) + if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; @@ -715,7 +801,7 @@ function print_add_ticket() echo ' '.$hesklang['vrfy']; } // Not verified yet, should we use Recaptcha? - elseif ($hesk_settings['recaptcha_use']) + elseif ($hesk_settings['recaptcha_use'] == 1) { ?> +
+ + + + + +
@@ -814,10 +914,12 @@ function print_start() if ($hesk_settings['kb_enable']) { require(HESK_PATH . 'inc/knowledgebase_functions.inc.php'); - hesk_load_database_functions(); - hesk_dbConnect(); } + // Connect to database + hesk_load_database_functions(); + hesk_dbConnect(); + /* Print header */ require_once(HESK_PATH . 'inc/header.inc.php'); @@ -861,6 +963,13 @@ function print_start()
$hesklang['open'],