From edb81d19553983b80869f36baad258fc4437485d Mon Sep 17 00:00:00 2001 From: Guenter Lukas Date: Sun, 5 Feb 2023 11:43:09 +0100 Subject: [PATCH 1/4] update --- htdocs/comm/action/peruser.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 87def7240f5..724a6a89a59 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -915,6 +915,11 @@ while ($currentdaytoshow < $lastdaytoshow) { if ($usergroup > 0) { $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); } + if ($user->socid > 0) + { + // External users should see only contacts of their company + $sql .= " AND fk_soc=" . $socid; + } //print $sql; $resql = $db->query($sql); From d2a6d89fca58163b07fcbc2a15b90f04afd85415 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 5 Feb 2023 10:48:29 +0000 Subject: [PATCH 2/4] Fixing style errors. --- htdocs/comm/action/peruser.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 724a6a89a59..e0e6e9ff004 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -915,8 +915,7 @@ while ($currentdaytoshow < $lastdaytoshow) { if ($usergroup > 0) { $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); } - if ($user->socid > 0) - { + if ($user->socid > 0) { // External users should see only contacts of their company $sql .= " AND fk_soc=" . $socid; } From a0f8a2454b05e9ed3919f15850806c7c65a8c639 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Feb 2023 00:04:19 +0100 Subject: [PATCH 3/4] Update peruser.php --- htdocs/comm/action/peruser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index e0e6e9ff004..9448ea0b77b 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -917,7 +917,7 @@ while ($currentdaytoshow < $lastdaytoshow) { } if ($user->socid > 0) { // External users should see only contacts of their company - $sql .= " AND fk_soc=" . $socid; + $sql .= " AND fk_soc = ".((int) $user->socid); } //print $sql; From b52203b4e0bf438b1a69fe98af216921d34c982e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Feb 2023 00:05:06 +0100 Subject: [PATCH 4/4] Update peruser.php --- htdocs/comm/action/peruser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 9448ea0b77b..ba631ba8c59 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -917,7 +917,7 @@ while ($currentdaytoshow < $lastdaytoshow) { } if ($user->socid > 0) { // External users should see only contacts of their company - $sql .= " AND fk_soc = ".((int) $user->socid); + $sql .= " AND u.fk_soc = ".((int) $user->socid); } //print $sql;