From 75ce3e85136113a73b60f8fecda92a110614e570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=B6dl?= <27991923+f-hoedl@users.noreply.github.com> Date: Tue, 12 Nov 2024 00:36:34 +0100 Subject: [PATCH] [FIX] Update ticket create form to hide contracts from other thirdparties for external users (#31762) Co-authored-by: fhoedl --- htdocs/core/class/html.formticket.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 4f8b20293f1..482e6af0088 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -769,7 +769,8 @@ class FormTicket $formcontract = new FormContract($this->db); print ''; print img_picto('', 'contract', 'class="pictofixedwidth"'); - print $formcontract->select_contract(-1, GETPOSTINT('contactid'), 'contractid', 0, 1, 1, 1); + // socid is for internal users null and not 0 or -1 + print $formcontract->select_contract($user->socid ?? -1, GETPOSTINT('contactid'), 'contractid', 0, 1, 1, 1); print ''; } }