Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
This commit is contained in:
commit
959a75c51e
@ -204,7 +204,7 @@ 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) && is_numeric($this->entity))?$this->entity:$conf->entity);
|
$this->entity = ((isset($this->entity) && is_numeric($this->entity))?$this->entity:$conf->entity);
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (";
|
||||||
$sql.= " datec";
|
$sql.= " datec";
|
||||||
@ -228,7 +228,7 @@ class Contact extends CommonObject
|
|||||||
$sql.= " ".$this->db->escape($this->priv).",";
|
$sql.= " ".$this->db->escape($this->priv).",";
|
||||||
$sql.= " ".$this->db->escape($this->statut).",";
|
$sql.= " ".$this->db->escape($this->statut).",";
|
||||||
$sql.= " ".(! empty($this->canvas)?"'".$this->db->escape($this->canvas)."'":"null").",";
|
$sql.= " ".(! empty($this->canvas)?"'".$this->db->escape($this->canvas)."'":"null").",";
|
||||||
$sql.= " ".$this->db->escape($entity).",";
|
$sql.= " ".$this->db->escape($this->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.= ")";
|
||||||
@ -307,6 +307,8 @@ class Contact extends CommonObject
|
|||||||
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
|
|
||||||
|
$this->entity = ((isset($this->entity) && is_numeric($this->entity))?$this->entity:$conf->entity);
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname);
|
$this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname);
|
||||||
$this->firstname=trim($this->firstname);
|
$this->firstname=trim($this->firstname);
|
||||||
@ -354,6 +356,7 @@ class Contact extends CommonObject
|
|||||||
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'":"NULL");
|
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'":"NULL");
|
||||||
$sql .= ", default_lang=".($this->default_lang?"'".$this->db->escape($this->default_lang)."'":"NULL");
|
$sql .= ", default_lang=".($this->default_lang?"'".$this->db->escape($this->default_lang)."'":"NULL");
|
||||||
$sql .= ", no_email=".($this->no_email?"'".$this->db->escape($this->no_email)."'":"0");
|
$sql .= ", no_email=".($this->no_email?"'".$this->db->escape($this->no_email)."'":"0");
|
||||||
|
$sql .= ", entity = " . $this->db->escape($this->entity);
|
||||||
$sql .= " WHERE rowid=".$this->db->escape($id);
|
$sql .= " WHERE rowid=".$this->db->escape($id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
|
|||||||
@ -480,10 +480,10 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
$entity = ((isset($this->entity) && is_numeric($this->entity))?$this->entity:$conf->entity);
|
$this->entity = ((isset($this->entity) && is_numeric($this->entity))?$this->entity:$conf->entity);
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key, fk_multicurrency, multicurrency_code)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key, fk_multicurrency, multicurrency_code)";
|
||||||
$sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$entity.", '".$this->db->idate($now)."'";
|
$sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$this->db->escape($this->entity).", '".$this->db->idate($now)."'";
|
||||||
$sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null");
|
$sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null");
|
||||||
$sql.= ", ".(! empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'":"null");
|
$sql.= ", ".(! empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'":"null");
|
||||||
$sql.= ", ".$this->status;
|
$sql.= ", ".$this->status;
|
||||||
@ -891,7 +891,7 @@ class Societe extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::update verify ok or not done");
|
dol_syslog(get_class($this)."::update verify ok or not done");
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
|
||||||
$sql .= "entity = " . $this->entity;
|
$sql .= "entity = " . $this->db->escape($this->entity);
|
||||||
$sql .= ",nom = '" . $this->db->escape($this->name) ."'"; // Required
|
$sql .= ",nom = '" . $this->db->escape($this->name) ."'"; // Required
|
||||||
$sql .= ",name_alias = '" . $this->db->escape($this->name_alias) ."'";
|
$sql .= ",name_alias = '" . $this->db->escape($this->name_alias) ."'";
|
||||||
$sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null");
|
$sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user