From 6fa53dc690db82ce23f03be60ae642ff88da1497 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 25 May 2004 10:10:56 +0000 Subject: [PATCH] =?UTF-8?q?Ajoute=20automatiquement=20le=20num=E9ro=20de?= =?UTF-8?q?=20t=E9l=E9phone=20de=20la=20soci=E9t=E9=20au=20contact=20quand?= =?UTF-8?q?=20le=20num=E9ro=20du=20contact=20est=20vide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/contact.class.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index 04c3d315d46..7465c97a339 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -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'";