diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 488edd3f..2cfe2a9c 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -1529,7 +1529,6 @@ if ( defined('HESK_DEMO') ) '.$hesklang['date_custom_field'].' + +
diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index 27c5e46f..fa78f714 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -490,7 +490,7 @@ for ($i=1;$i<=20;$i++) $set['custom_fields'][$this_field]['value'] = 'cc'; } - if (!in_array($set['custom_fields'][$this_field]['type'],array('text','textarea','select','radio','checkbox','date','multiselect','email'))) + if (!in_array($set['custom_fields'][$this_field]['type'],array('text','textarea','select','radio','checkbox','date','multiselect','email','hidden','readonly'))) { $set['custom_fields'][$this_field]['type'] = 'text'; } diff --git a/admin/edit_post.php b/admin/edit_post.php index e3cb4c87..fc8ffa9b 100644 --- a/admin/edit_post.php +++ b/admin/edit_post.php @@ -433,6 +433,37 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); '; 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; + } + + 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; + } + + echo '
+ +
+
'; + + break; + /* Default text input */ default: if (strlen($k_value) != 0) diff --git a/admin/new_ticket.php b/admin/new_ticket.php index 6407df19..9c416f4d 100644 --- a/admin/new_ticket.php +++ b/admin/new_ticket.php @@ -526,6 +526,41 @@ if (!$show['show']) { 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; + } + + $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; + } + + $cls = in_array($k,$_SESSION['iserror']) ? ' class="isError" ' : ''; + + echo '
+ +
+
'; + + break; + /* Default text input */ default: //Clean up multiple dashes or whitespaces @@ -947,6 +982,41 @@ if (!$show['show']) { 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; + } + + $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; + } + + $cls = in_array($k,$_SESSION['iserror']) ? ' class="isError" ' : ''; + + echo '
+ +
+
'; + + break; + /* Default text input */ default: //Clean up multiple dashes or whitespaces diff --git a/admin/options.php b/admin/options.php index 9c4f155d..4fa05066 100644 --- a/admin/options.php +++ b/admin/options.php @@ -120,6 +120,44 @@ switch ($type)

'; break; + case 'hidden': + echo ' + +

'.$hesklang['hidden_custom_field_help'].'

+ + + + +
'.$hesklang['value_colon'].' +
+

+ '; + break; + case 'readonly': + echo ' + +

'.$hesklang['readonly_custom_field_help'].'

+ + + + +
'.$hesklang['value_colon'].' +
+

+ '; + break; case 'textarea': if (strpos($query,'#') !== false) { diff --git a/index.php b/index.php index 46b5df74..b8c42f9f 100644 --- a/index.php +++ b/index.php @@ -539,6 +539,41 @@ if (!$show['show']) { 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; + } + + $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; + } + + $cls = in_array($k,$_SESSION['iserror']) ? ' class="isError" ' : ''; + + echo '
+ +
+
'; + + break; + /* Default text input */ default: //Clean up multiple dashes or whitespaces @@ -860,6 +895,41 @@ if (!$show['show']) { 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; + } + + $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; + } + + $cls = in_array($k,$_SESSION['iserror']) ? ' class="isError" ' : ''; + + echo '
+ +
+
'; + + break; + /* Default text input */ default: //Clean up multiple dashes or whitespaces diff --git a/language/en/text.php b/language/en/text.php index cc444a5e..f06ebf4f 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -31,6 +31,11 @@ $hesklang['screen_resolution'] = 'Screen Resolution'; $hesklang['display_user_agent_information'] = 'Show user agent'; $hesklang['display_user_agent_information_help'] = 'When enabled, staff will be able to view the operating system, browser, and screen resolution of the device used to create the ticket.'; +$hesklang['value_colon'] = 'Value:'; +$hesklang['hidden_custom_field'] = 'Hidden text field'; +$hesklang['hidden_custom_field_help'] = 'This input is the same as a text field; however this value cannot be changed and will not be visible to the user.'; +$hesklang['readonly_custom_field'] = 'Read-only text field'; +$hesklang['readonly_custom_field_help'] = 'This input is the same as a text field; however this value cannot be changed, but will be visible to the user.'; // ADDED OR MODIFIED IN Mods for HESK 2.4.0 $hesklang['sort_by_user_defined_order'] = 'Sort by user-defined order';