Browse Source

#326 Add setting for showing user agent info

merge-requests/2/head
Mike Koch 6 years ago
parent
commit
52ba392050
  1. 21
      admin/admin_settings.php
  2. 3
      admin/admin_settings_save.php
  3. 3
      admin/admin_ticket.php
  4. 8
      install/mods-for-hesk/sql/installSql.php
  5. 3
      language/en/text.php

21
admin/admin_settings.php

@ -877,6 +877,27 @@ if ( defined('HESK_DEMO') )
?>
</div>
</div>
<div class="form-group">
<label for="display_user_agent_information" class="col-sm-6 control-label">
<span class="label label-primary"
data-toggle="tooltip"
title="<?php echo $hesklang['added_in_mods_for_hesk']; ?>"><?php echo $hesklang['mods_for_hesk_acronym']; ?></span>
<?php echo $hesklang['display_user_agent_information']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['display_user_agent_information']; ?>"
data-content="<?php echo $hesklang['display_user_agent_information_help']; ?>"></i>
</label>
<div class="col-sm-6">
<?php
$on = $modsForHesk_settings['display_user_agent_information'] ? 'checked' : '';
$off = $modsForHesk_settings['display_user_agent_information'] ? '' : 'checked';
echo '
<div class="radio"><label><input type="radio" name="statuses_order_column" value="0" '.$off.'>'.$hesklang['no'].'</label></div>
<div class="radio"><label><input type="radio" name="statuses_order_column" value="1" '.$on.'>'.$hesklang['yes'].'</label></div>
';
?>
</div>
</div>
</div>
<!-- Second column -->
<div class="col-md-6">

3
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='<?php
@ -833,7 +835,6 @@ else
exit();
/** FUNCTIONS **/
function mfh_updateSetting($key, $value, $isString = false) {
global $hesk_settings;

3
admin/admin_ticket.php

@ -882,7 +882,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
{
echo '<span class="fa fa-lock"></span>&nbsp;';
}
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

8
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

3
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';

Loading…
Cancel
Save