Fix: Update professional phone number

This commit is contained in:
Laurent Destailleur 2009-01-17 11:47:21 +00:00
parent d3bee903f3
commit a4cdd7fb92

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
@ -151,14 +151,10 @@ class Contact extends CommonObject
$this->email=trim($this->email); $this->email=trim($this->email);
$this->phone_pro=trim($this->phone_pro); $this->phone_pro=trim($this->phone_pro);
$this->phone_perso=trim($this->phone_perso);
if (! $this->phone_pro && $this->socid > 0) $this->phone_mobile=trim($this->phone_mobile);
{ $this->fax=trim($this->fax);
$soc = new Societe($this->db);
$soc->fetch($this->socid);
$this->phone_pro = $soc->tel;
}
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET "; $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
if ($this->socid > 0) $sql .= " fk_soc='".addslashes($this->socid)."',"; if ($this->socid > 0) $sql .= " fk_soc='".addslashes($this->socid)."',";
if ($this->socid == -1) $sql .= " fk_soc=null,"; if ($this->socid == -1) $sql .= " fk_soc=null,";