diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 53d5e075..488edd3f 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -877,6 +877,27 @@ if ( defined('HESK_DEMO') ) ?> +
+ +
+
+
+ '; + ?> +
+
diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index 7bf703f2..27c5e46f 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -551,6 +551,7 @@ if ($rich_text_setting == 0) { $set['statuses_order_column'] = empty($_POST['statuses_order_column']) ? 'sort' : 'name'; $set['kb_attach_dir'] = hesk_POST('kb_attach_dir', 'attachments'); +$set['display_user_agent_information'] = empty($_POST['display_user_agent_information']) ? 0 : 1; if ($set['customer-email-verification-required']) { @@ -594,6 +595,7 @@ mfh_updateSetting('dropdownItemTextColor', $set['dropdownItemTextColor'], true); mfh_updateSetting('dropdownItemTextHoverColor', $set['dropdownItemTextHoverColor'], true); mfh_updateSetting('questionMarkColor', $set['questionMarkColor'], true); mfh_updateSetting('dropdownItemTextHoverBackgroundColor', $set['dropdownItemTextHoverBackgroundColor'], true); +mfh_updateSetting('display_user_agent_information', $set['display_user_agent_information']); // Prepare settings file and save it $settings_file_content=' '; } - if ($ticket['user_agent'] !== NULL + if ($modsForHesk_settings['display_user_agent_information'] + && $ticket['user_agent'] !== NULL && $ticket['screen_resolution_height'] !== NULL && $ticket['screen_resolution_height'] != 0 && $ticket['screen_resolution_width'] !== NULL diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 1d1cd9a3..a3b2d891 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -788,6 +788,10 @@ function migrateSettings() { } } +function getSettingValue($settings, $setting, $default) { + return isset($settings[$setting]) ? $settings[$setting] : $default; +} + function execute250Scripts() { global $hesk_settings; @@ -797,9 +801,7 @@ function execute250Scripts() { executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."stage_tickets` ADD COLUMN `user_agent` TEXT"); executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."stage_tickets` ADD COLUMN `screen_resolution_width` INT"); executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."stage_tickets` ADD COLUMN `screen_resolution_height` INT"); -} -function getSettingValue($settings, $setting, $default) { - return isset($settings[$setting]) ? $settings[$setting] : $default; + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) VALUES ('display_user_agent_information', '0')"); } // END Version 2.5.0 \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index eac386d8..cc444a5e 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -28,6 +28,9 @@ $hesklang['device_information'] = 'Device information'; $hesklang['operating_system'] = 'Operating System'; $hesklang['browser'] = 'Browser'; $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.'; // ADDED OR MODIFIED IN Mods for HESK 2.4.0 $hesklang['sort_by_user_defined_order'] = 'Sort by user-defined order';