From 91b87a01a6fa1d9e5cf3513efc18a04456713a41 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Tue, 29 Sep 2015 04:31:19 +0000
Subject: [PATCH] Agent Identity Masking

Move setting from Setting > Tickets to Settings > Agents
---
 include/class.config.php                          | 2 +-
 include/i18n/en_US/help/tips/settings.agents.yaml | 6 ++++++
 include/i18n/en_US/help/tips/settings.ticket.yaml | 6 ------
 include/staff/settings-agents.inc.php             | 8 ++++++++
 include/staff/settings-tickets.inc.php            | 8 --------
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/class.config.php b/include/class.config.php
index b3c75485c..dc5bb7511 100644
--- a/include/class.config.php
+++ b/include/class.config.php
@@ -1136,6 +1136,7 @@ class OsticketConfig extends Config {
             'allow_pw_reset'=>isset($vars['allow_pw_reset'])?1:0,
             'pw_reset_window'=>$vars['pw_reset_window'],
             'agent_name_format'=>$vars['agent_name_format'],
+            'hide_staff_name'=>isset($vars['hide_staff_name']) ? 1 : 0,
             'agent_avatar'=>$vars['agent_avatar'],
         ));
     }
@@ -1207,7 +1208,6 @@ class OsticketConfig extends Config {
             'show_assigned_tickets'=>isset($vars['show_assigned_tickets'])?0:1,
             'show_answered_tickets'=>isset($vars['show_answered_tickets'])?0:1,
             'show_related_tickets'=>isset($vars['show_related_tickets'])?1:0,
-            'hide_staff_name'=>isset($vars['hide_staff_name'])?1:0,
             'allow_client_updates'=>isset($vars['allow_client_updates'])?1:0,
             'ticket_lock' => $vars['ticket_lock'],
         ));
diff --git a/include/i18n/en_US/help/tips/settings.agents.yaml b/include/i18n/en_US/help/tips/settings.agents.yaml
index bf1ba0602..5c699b7ef 100644
--- a/include/i18n/en_US/help/tips/settings.agents.yaml
+++ b/include/i18n/en_US/help/tips/settings.agents.yaml
@@ -21,6 +21,12 @@ agent_name_format:
         Choose a format for Agents names throughout the system. Email templates
         will use it for names if no other format is specified.
 
+staff_identity_masking:
+    title: Staff Identity Masking
+    content: >
+        If enabled, this will hide the Agent’s name from the Client during any
+        communication.
+
 # Authentication settings
 password_reset:
     title: Password Expiration Policy
diff --git a/include/i18n/en_US/help/tips/settings.ticket.yaml b/include/i18n/en_US/help/tips/settings.ticket.yaml
index b54e13e3c..b13bd17c4 100644
--- a/include/i18n/en_US/help/tips/settings.ticket.yaml
+++ b/include/i18n/en_US/help/tips/settings.ticket.yaml
@@ -108,12 +108,6 @@ answered_tickets:
         will be included in the <span class="doc-desc-title">Open Tickets
         Queue</span>.
 
-staff_identity_masking:
-    title: Staff Identity Masking
-    content: >
-        If enabled, this will hide the Agent’s name from the Client during any
-        communication.
-
 ticket_attachment_settings:
     title: Ticket Thread Attachments
     content: >
diff --git a/include/staff/settings-agents.inc.php b/include/staff/settings-agents.inc.php
index e5ca64b32..2a06676f0 100644
--- a/include/staff/settings-agents.inc.php
+++ b/include/staff/settings-agents.inc.php
@@ -35,6 +35,14 @@ if (!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config
                             <i class="help-tip icon-question-sign" href="#agent_name_format"></i>
                         </td>
                     </tr>
+                    <tr>
+                        <td><?php echo __('Agent Identity Masking'); ?>:</td>
+                        <td>
+                            <input type="checkbox" name="hide_staff_name" <?php echo $config['hide_staff_name']?'checked="checked"':''; ?>>
+                            <?php echo __("Hide agent's name on responses."); ?>
+                            <i class="help-tip icon-question-sign" href="#staff_identity_masking"></i>
+                        </td>
+                    </tr>
                     <tr>
                         <td width="180"><?php echo __('Avatar Source'); ?>:</td>
                         <td>
diff --git a/include/staff/settings-tickets.inc.php b/include/staff/settings-tickets.inc.php
index 4fe241476..751df274c 100644
--- a/include/staff/settings-tickets.inc.php
+++ b/include/staff/settings-tickets.inc.php
@@ -203,14 +203,6 @@ if(!($maxfileuploads=ini_get('max_file_uploads')))
                 <i class="help-tip icon-question-sign" href="#answered_tickets"></i>
             </td>
         </tr>
-        <tr>
-            <td><?php echo __('Agent Identity Masking'); ?>:</td>
-            <td>
-                <input type="checkbox" name="hide_staff_name" <?php echo $config['hide_staff_name']?'checked="checked"':''; ?>>
-                <?php echo __("Hide agent's name on responses."); ?>
-                <i class="help-tip icon-question-sign" href="#staff_identity_masking"></i>
-            </td>
-        </tr>
         <tr>
             <th colspan="2">
                 <em><b><?php echo __('Attachments');?></b>:  <?php echo __('Size and maximum uploads setting mainly apply to web tickets.');?></em>
-- 
GitLab