diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 7ceb6a8438cd556d136ce00c586e1a15dcb5a813..d42262ffe4f784d8e5df7b1e830d26f2162eeeb5 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -204,9 +204,9 @@ class Project extends CommonObject $sql.= ", fk_soc = " . ($this->socid > 0 ? $this->socid : "null"); $sql.= ", fk_statut = " . $this->statut; $sql.= ", public = " . ($this->public ? 1 : 0); - $sql.= ", datec=" . ($this->date_c != '' ? $this->db->idate($this->date_c) : 'null'); - $sql.= ", dateo=" . ($this->date_start != '' ? $this->db->idate($this->date_start) : 'null'); - $sql.= ", datee=" . ($this->date_end != '' ? $this->db->idate($this->date_end) : 'null'); + $sql.= ", datec=" . ($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null'); + $sql.= ", dateo=" . ($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); + $sql.= ", datee=" . ($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); $sql.= " WHERE rowid = " . $this->id; dol_syslog(get_class($this)."::Update sql=" . $sql, LOG_DEBUG); @@ -263,6 +263,7 @@ class Project extends CommonObject else { $this->error = $this->db->lasterror(); + $this->errors[] = $this->error; dol_syslog(get_class($this)."::Update error -2 " . $this->error, LOG_ERR); $result = -2; } @@ -513,10 +514,9 @@ class Project extends CommonObject $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields"; $sql.= " WHERE fk_object=" . $this->id; - dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) + if (! $resql) { $this->errors[] = $this->db->lasterror(); $error++; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index edc633a7fc84d94abe8ff91825ba77914e6abb23..62bbf9ae642ec971f9ecb2590e3faa170b7d9e9d 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -209,13 +209,13 @@ foreach ($listofreferent as $key => $value) $classname=$value['class']; $tablename=$value['table']; $qualified=$value['test']; - + if ($qualified) { print '<br>'; print_titre($langs->trans($title)); - + $selectList=$formproject->select_element($tablename,$project->societe->id); if (!$selectList || ($selectList<0)) {