diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 64d80dbdbf2..e956f40a3e3 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -242,12 +242,12 @@ class Contact extends CommonObject $sql .= ", poste='".$this->db->escape($this->poste)."'"; $sql .= ", fax='".$this->db->escape($this->fax)."'"; $sql .= ", email='".$this->db->escape($this->email)."'"; - $sql .= ", note_private='".$this->db->escape($this->note_private)."'"; - $sql .= ", note_public='".$this->db->escape($this->note_public)."'"; - $sql .= ", phone = '".$this->db->escape($this->phone_pro)."'"; - $sql .= ", phone_perso = '".$this->db->escape($this->phone_perso)."'"; - $sql .= ", phone_mobile = '".$this->db->escape($this->phone_mobile)."'"; - $sql .= ", jabberid = '".$this->db->escape($this->jabberid)."'"; + $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); + $sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); + $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null"); + $sql .= ", phone_perso = ".(isset($this->phone_perso)?"'".$this->db->escape($this->phone_perso)."'":"null"); + $sql .= ", phone_mobile = ".(isset($this->phone_mobile)?"'".$this->db->escape($this->phone_mobile)."'":"null"); + $sql .= ", jabberid = ".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null"); $sql .= ", priv = '".$this->priv."'"; $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"NULL"); $sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"NULL"); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index f79ff5766b0..794ebda1428 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -919,7 +919,9 @@ abstract class DolibarrModules dol_syslog(get_class($this)."::insert_permissions Add permission to user id=".$obj2->rowid); $tmpuser=new User($this->db); $tmpuser->fetch($obj2->rowid); - $tmpuser->addrights($r_id); + if (!empty($tmpuser->id)) { + $tmpuser->addrights($r_id); + } $i++; } if (! empty($user->admin)) // Reload permission for current user if defined diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 60dbbef1ee5..b2c4884cf3e 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -176,7 +176,9 @@ class Fichinter extends CommonObject // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_CREATE',$this,$user,$langs,$conf); + $tmpuser=new User($this->db); + $tmpuser->fetch($this->author); + $result=$interface->run_triggers('FICHINTER_CREATE',$this,$tmpuser,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 3b5b2d46ec5..718dea6f6d6 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -278,4 +278,4 @@ $(document).ready(function() { $("#markRate").html(""); }); - \ No newline at end of file + diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 6af526492fe..e92192c0d71 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -183,6 +183,7 @@ $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); +dol_syslog('margin::customerMargins.php sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -303,4 +304,4 @@ $(document).ready(function() { $("#markRate").html(""); }); - \ No newline at end of file + diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 6fc92f94860..55a13e83094 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -264,4 +264,4 @@ $(document).ready(function() { $("#marginRate").html(""); $("#markRate").html(""); }); - \ No newline at end of file +