diff --git a/ChangeLog b/ChangeLog index 1938040f92e..15f31a52fbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,6 +61,7 @@ For users: - New: Can send an email from thirdparty card. - New: Can cancel holidays that were previously validated. - Fix: [bug #1022] correct margin calculation for credit notes. +- New: Can choose contact on event (action com) creation, and filtred by thirdparty For translators: - Qual: Normalized sort order of all languages files with english reference files. diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 0607fdd6e0e..f03d09cd5a5 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -564,23 +564,23 @@ if ($action == 'create') } else { + + $events=array(); + $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); //For external user force the company to user company if (!empty($user->societe_id)) { - print $form->select_company($user->societe_id,'socid','',1,1); + print $form->select_company($user->societe_id,'socid','',1,1,0,$events); } else { - print $form->select_company('','socid','',1,1); + print $form->select_company('','socid','',1,1,0,$events); } } print ''; - // If company is forced, we propose contacts (may be contact is also forced) - if (GETPOST("contactid") > 0 || GETPOST('socid','int') > 0) - { - print ''.$langs->trans("ActionOnContact").''; - $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); - print ''; - } + print ''.$langs->trans("ActionOnContact").''; + $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); + print ''; + // Project if (! empty($conf->projet->enabled)) @@ -809,12 +809,14 @@ if ($id > 0) { print ''.$langs->trans("ActionOnCompany").''; print ''; - print $form->select_company($act->societe->id,'socid','',1,1); + $events=array(); + $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); + print $form->select_company($act->societe->id,'socid','',1,1,0,$events); print ''; // Contact print ''.$langs->trans("Contact").''; - print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1); + $form->select_contacts($act->societe->id, $act->contact->id,'contactid',1); print ''; }