From c83f40fc7e48ff82fc538fb61b2d89e847827a5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Oct 2019 15:42:37 +0200 Subject: [PATCH] Debug contact by default --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 4 +++- htdocs/contact/card.php | 14 +++++++------- htdocs/langs/en_US/companies.lang | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 987e81ff94c..92267d97033 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1595,7 +1595,7 @@ if ($action == 'create') if ($socid > 0) { - // Contacts (ask contact only if thirdparty already defined). TODO do this also into order and invoice. + // Contacts (ask contact only if thirdparty already defined). print "" . $langs->trans("DefaultContact") . ''; $form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3a6f4f67353..968607ed660 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -70,6 +70,7 @@ $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $lineid = GETPOST('lineid', 'int'); +$contactid = GETPOST('contactid', 'int'); $projectid = GETPOST('projectid', 'int'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility @@ -1646,8 +1647,9 @@ if ($action == 'create' && $usercancreate) // Contact of order if ($socid > 0) { + // Contacts (ask contact only if thirdparty already defined). print "" . $langs->trans("DefaultContact") . ''; - $form->select_contacts($soc->id, $setcontact, 'contactid', 1, $srccontactslist, '', 1); + $form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); print ''; // Ligne info remises tiers diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index e7522a1292b..4139176e84e 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -371,7 +371,7 @@ if (empty($reshook)) $object->priv = GETPOST("priv", 'int'); $object->note_public = GETPOST("note_public", 'none'); $object->note_private = GETPOST("note_private", 'none'); - $object->roles = GETPOST("roles", 'array'); + $object->roles = GETPOST("roles", 'array'); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); @@ -725,9 +725,9 @@ else print ""; } - //Role + // Contact by default if (!empty($socid)) { - print '' . $langs->trans("Role") . ''; + print '' . $langs->trans("ContactByDefaultFor") . ''; print ''; $contactType = $object->listeTypeContacts('external', '', 1); print $form->multiselectarray('roles', $contactType); @@ -1050,9 +1050,9 @@ else print ""; } - //Role + // Contact by default if (!empty($object->socid)) { - print '' . $langs->trans("Role") . ''; + print '' . $langs->trans("ContactByDefaultFor") . ''; print ''; print $formcompany->showRoles("roles", $object, 'edit', $object->roles); print ''; @@ -1206,7 +1206,7 @@ else print $object->getCivilityLabel(); print ''; - // Role + // Job / position print ''.$langs->trans("PostOrFunction").''.$object->poste.''; // Email @@ -1257,7 +1257,7 @@ else } if (!empty($object->socid)) { - print '' . $langs->trans("Roles") . ''; + print '' . $langs->trans("ContactByDefaultFor") . ''; print ''; print $formcompany->showRoles("roles", $object, 'view'); print ''; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 532fbf14cb7..a4ab22d47c5 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -298,6 +298,7 @@ FromContactName=Name: NoContactDefinedForThirdParty=No contact defined for this third party NoContactDefined=No contact defined DefaultContact=Default contact/address +ContactByDefaultFor=Default contact/address for AddThirdParty=Create third party DeleteACompany=Delete a company PersonalInformations=Personal data