diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2b004f0ff10d8..3076f3d4854b4 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2067,7 +2067,27 @@ function setdatefields() // related contact print ''.$langs->trans("ActionOnContact").''; print '
'; - print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array(), 'multiple', 'contactid'); + + $searchSocid = ($object->socid > 0) ? $object->socid : (getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : -1); + + print img_picto('', 'contact', 'class="paddingrightonly"'); + print $form->selectcontacts( + $searchSocid, + array_keys($object->socpeopleassigned), + 'socpeopleassigned[]', + 1, + '', + '', + 1, + 'minwidth300 widthcentpercentminusx', + false, + 0, + 0, + array(), + 'multiple', + 'contactid' + ); + print '
'; print ''; print '';