From b14445c0e3e90bdb8bfaa9649b4f19c07bd3e016 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jan 2009 20:40:02 +0000 Subject: [PATCH] Now for third party of type "person",, informations are used to create contact. --- ChangeLog | 2 ++ htdocs/contact/fiche.php | 13 +++++++------ htdocs/societe.class.php | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d62b20bfc15..4b0de358827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ English Dolibarr changelog For users: - Enhance bank transactions reportings +- When creating a contact from a third party, informations from third party card + are automatically suggested. For translators: - Nothing diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index ba1961d6840..8082a05e43f 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -258,12 +258,6 @@ if ($user->rights->societe->contact->creer) // Company if ($socid) { - // On remplit avec le num�ro de la soci�t� par d�faut - if (strlen(trim($contact->phone_pro)) == 0) - { - $contact->phone_pro = $objsoc->tel; - } - print ''.$langs->trans("Company").''; print ''.$objsoc->nom.''; print ''; @@ -285,23 +279,30 @@ if ($user->rights->societe->contact->creer) print ''.$langs->trans("PostOrFunction").''; // Address + if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->address)) == 0) $contact->address = $objsoc->adresse; // Predefined with third party print ''.$langs->trans("Address").''; + if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->cp)) == 0) $contact->cp = $objsoc->cp; // Predefined with third party + if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->ville)) == 0) $contact->ville = $objsoc->ville; // Predefined with third party print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' '; print ''; + if (strlen(trim($contact->fk_pays)) == 0) $contact->fk_pays = $objsoc->pays_id; // Predefined with third party print ''.$langs->trans("Country").''; $form->select_pays($contact->fk_pays); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''; + if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->phone_pro)) == 0) $contact->phone_pro = $objsoc->tel; // Predefined with third party print ''.$langs->trans("PhonePro").''; print ''.$langs->trans("PhonePerso").''; + if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->fax)) == 0) $contact->fax = $objsoc->fax; // Predefined with third party print ''.$langs->trans("PhoneMobile").''; print ''.$langs->trans("Fax").''; // EMail + if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->email)) == 0) $contact->email = $objsoc->email; // Predefined with third party print ''.$langs->trans("Email").''; // Jabberid diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 35d1e5042c5..16831eb07b8 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -45,7 +45,7 @@ class Societe extends CommonObject var $id; var $nom; - var $nom_particulier; + var $nom_particulier; var $prenom; var $particulier; var $adresse; @@ -73,6 +73,7 @@ class Societe extends CommonObject var $capital; var $typent_id; + var $typent_code; var $effectif_id; var $forme_juridique_code; var $forme_juridique;