From 94dbde9cfd04ebf90a2b1ef4e0a771f8122b9581 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Tue, 12 Mar 2024 15:28:35 +0100 Subject: [PATCH] fix default current user as commercial for the thirdparty --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index a88aec05618..c1cdb053f5b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1652,7 +1652,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1); // Note: If user has no right to "see all thirdparties", we force selection of sale representative to him, so after creation he can see the record. - $selected = (count(GETPOST('commercial', 'array')) > 0 ? GETPOST('commercial', 'array') : (GETPOST('commercial', 'int') > 0 ? array(GETPOST('commercial', 'int')) : (empty($user->rights->societe->client->voir) ? array($user->id) : array()))); + $selected = (count(GETPOST('commercial', 'array')) > 0 ? GETPOST('commercial', 'array') : (GETPOST('commercial', 'int') > 0 ? array(GETPOST('commercial', 'int')) : (!empty($user->rights->societe->client->voir) ? array($user->id) : array()))); print img_picto('', 'user').$form->multiselectarray('commercial', $userlist, $selected, null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print '';