From 818742f8d10ce4ea6de430e570e8d6ebf88b063d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jan 2011 23:00:39 +0000 Subject: [PATCH] Fix: use canvas when option not enabled --- htdocs/contact/class/contact.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index ed58812dfc3..1ecf5553975 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -107,7 +107,6 @@ class Contact extends CommonObject $this->name=trim($this->name); if (! $this->socid) $this->socid = 0; if (! $this->priv) $this->priv = 0; - if (! $this->canvas) $this->canvas = 'default'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user_creat, priv, canvas)"; $sql.= " VALUES ('".$this->db->idate($now)."',"; @@ -116,7 +115,7 @@ class Contact extends CommonObject $sql.= "'".addslashes($this->name)."',"; $sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").","; $sql.= " ".$this->priv.","; - $sql.= "'".$this->canvas."'"; + $sql.= " ".($this->canvas?"'".$this->canvas."'":"null"); $sql.= ")"; dol_syslog("Contact::create sql=".$sql);