Ajoute automatiquement le numro de tlphone de la socit au contact

quand le numro du contact est vide
This commit is contained in:
Rodolphe Quiedeville 2004-05-25 10:10:56 +00:00
parent 0dbac489b2
commit 6fa53dc690

View File

@ -79,16 +79,20 @@ class Contact
$this->email = trim($this->email);
$this->phone_pro = ereg_replace(" ","",$this->phone_pro);
if (strlen($this->phone_pro) == 0 && $this->socid > 0)
{
$soc = new Societe($this->db);
$soc->fetch($this->socid);
$this->phone_pro = $soc->tel;
}
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET name='$this->name', firstname='$this->firstname'";
$sql .= ", poste='$this->poste'";
$sql .= ", fax='$this->fax'";
$sql .= ", email='$this->email'";
$sql .= ", note='$this->note'";
$contact->address = $HTTP_POST_VARS["adresse"];
$contact->cp = $HTTP_POST_VARS["cp"];
$contact->ville = $HTTP_POST_VARS["ville"];
$sql .= ", phone = '$this->phone_pro'";
$sql .= ", phone_perso = '$this->phone_perso'";
$sql .= ", phone_mobile = '$this->phone_mobile'";