diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ba2e92fe573..13fedebfa88 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -535,13 +535,12 @@ if (empty($reshook)) } // Links with users - if (!empty($user->rights->societe->client->voir)) { - $salesreps = GETPOST('commercial', 'array'); - $result = $object->setSalesRep($salesreps); - if ($result < 0) { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - } + $salesreps = GETPOST('commercial', 'array'); + $result = $object->setSalesRep($salesreps); + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); } // Customer categories association @@ -1378,16 +1377,13 @@ else print ''; } - if ($user->rights->societe->client->voir) - { - // Assign a Name - print ''; - print ''.fieldLabel('AllocateCommercial','commercial_id').''; - print ''; - $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); - print $form->multiselectarray('commercial', $userlist, GETPOST('commercial', 'array'), null, null, null, null, "90%"); - print ''; - } + // Assign a Name + print ''; + print ''.fieldLabel('AllocateCommercial','commercial_id').''; + print ''; + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); + print $form->multiselectarray('commercial', $userlist, (count(GETPOST('commercial', 'array')) > 0?GETPOST('commercial', 'array'):array($user->id)), null, null, null, null, "90%"); + print ''; // Incoterms if (!empty($conf->incoterm->enabled))