Fix regression

This commit is contained in:
Laurent Destailleur 2018-01-11 20:39:23 +01:00
parent eaecb9da5e
commit f93f9e1a73

View File

@ -177,6 +177,8 @@ class Contact extends CommonObject
if (empty($this->priv)) $this->priv = 0; if (empty($this->priv)) $this->priv = 0;
if (empty($this->statut)) $this->statut = 0; // This is to convert '' into '0' to avoid bad sql request if (empty($this->statut)) $this->statut = 0; // This is to convert '' into '0' to avoid bad sql request
$entity = isset($this->entity)?$this->entity:$conf->entity;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
$sql.= " datec"; $sql.= " datec";
$sql.= ", fk_soc"; $sql.= ", fk_soc";
@ -199,7 +201,7 @@ class Contact extends CommonObject
$sql.= " ".$this->priv.","; $sql.= " ".$this->priv.",";
$sql.= " ".$this->statut.","; $sql.= " ".$this->statut.",";
$sql.= " ".(! empty($this->canvas)?"'".$this->db->escape($this->canvas)."'":"null").","; $sql.= " ".(! empty($this->canvas)?"'".$this->db->escape($this->canvas)."'":"null").",";
$sql.= " ".$this->entity.","; $sql.= " ".$entity.",";
$sql.= "'".$this->db->escape($this->ref_ext)."',"; $sql.= "'".$this->db->escape($this->ref_ext)."',";
$sql.= " ".(! empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null"); $sql.= " ".(! empty($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null");
$sql.= ")"; $sql.= ")";