forked from Wavyzz/dolibarr
Fix: add all phones if create user from contact
This commit is contained in:
@@ -859,6 +859,9 @@ class User extends CommonObject
|
||||
$this->lastname = $contact->nom;
|
||||
$this->firstname = $contact->prenom;
|
||||
$this->email = $contact->email;
|
||||
$this->office_phone = $contact->phone_pro;
|
||||
$this->office_fax = $contact->fax;
|
||||
$this->user_mobile = $contact->phone_mobile;
|
||||
|
||||
if (empty($login)) $login=strtolower(substr($contact->prenom, 0, 4)) . strtolower(substr($contact->nom, 0, 4));
|
||||
$this->login = $login;
|
||||
@@ -871,6 +874,9 @@ class User extends CommonObject
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " SET fk_socpeople=".$contact->id;
|
||||
$sql.= ", office_phone = '".$this->db->escape($this->office_phone)."'";
|
||||
$sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'";
|
||||
$sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'";
|
||||
if ($contact->socid) $sql.=", fk_societe=".$contact->socid;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
Reference in New Issue
Block a user