From 075896bb6eb527662c8ec4a15a833d79d8e85fdd Mon Sep 17 00:00:00 2001 From: Romain B <8530352+Rom1-B@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:53:05 +0100 Subject: [PATCH] feat(issue): more anonymising options (#3160) --- inc/issue.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/inc/issue.class.php b/inc/issue.class.php index 9856fd2c0..551a4081c 100644 --- a/inc/issue.class.php +++ b/inc/issue.class.php @@ -491,11 +491,16 @@ public function getTicketsForDisplay($options) { public function rawSearchOptions() { $tab = []; $hide_technician = false; + $hide_technician_group = false; if (!Session::isCron()) { - $hide_technician = \Entity::getUsedConfig( - 'anonymize_support_agents', - Session::getActiveEntity() - ); + $user = new User(); + if (empty($user->getAnonymizedName(Session::getActiveEntity()))) { + $hide_technician = true; + } + $group = new Group(); + if (empty($group->getAnonymizedName(Session::getActiveEntity()))) { + $hide_technician_group = true; + } } $tab[] = [ @@ -743,8 +748,8 @@ public function rawSearchOptions() { 'datatype' => 'dropdown', 'forcegroupby' => true, 'massiveaction' => false, - 'nodisplay' => $hide_technician, - 'nosearch' => $hide_technician, + 'nodisplay' => $hide_technician_group, + 'nosearch' => $hide_technician_group, 'condition' => ['is_assign' => 1], 'joinparams' => [ 'beforejoin' => [