For use ajax combobox for societe and contacts in action card create.

This commit is contained in:
tysauron 2017-09-19 14:53:34 +02:00 committed by GitHub
parent 77d1a15016
commit 0803e03ca9

View File

@ -773,9 +773,9 @@ if ($action == 'create')
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1',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_thirdparty_list($user->societe_id, 'socid', '', 1, 1, 0, $events);
print $form->select_company($user->societe_id, 'socid', '', 1, 1, 0, $events);
} else {
print $form->select_thirdparty_list('', 'socid', '', 'SelectThirdParty', 1, 0, $events);
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events);
}
}
@ -783,7 +783,7 @@ if ($action == 'create')
// Related contact
print '<tr><td class="nowrap">'.$langs->trans("ActionOnContact").'</td><td>';
$form->select_contacts(GETPOST('socid','int'), GETPOST('contactid'), 'contactid', 1, '', '', 0, 'minwidth200');
$form->selectcontacts(GETPOST('socid','int'), GETPOST('contactid'), 'contactid', 1, '', '', 0, 'minwidth200');
print '</td></tr>';