diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 084292d0727..8466fdc3bcb 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -35,7 +35,8 @@ class Tasks extends DolibarrApi */ static $FIELDS = array( 'ref', - 'label' + 'label', + 'fk_project' ); /** diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 10f5a36d67f..0d737dfea7f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -62,7 +62,7 @@ class Task extends CommonObject /** * @var int ID parent task */ - public $fk_task_parent; + public $fk_task_parent = 0; /** * @var string Label of task @@ -145,6 +145,9 @@ class Task extends CommonObject { global $conf, $langs; + //For the date + $now = dol_now(); + $error = 0; // Clean parameters @@ -175,7 +178,7 @@ class Task extends CommonObject $sql .= ", ".$this->fk_task_parent; $sql .= ", '".$this->db->escape($this->label)."'"; $sql .= ", '".$this->db->escape($this->description)."'"; - $sql .= ", '".$this->db->idate($this->date_c)."'"; + $sql .= ", '".$this->db->idate($now)."'"; $sql .= ", ".$user->id; $sql .= ", ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); $sql .= ", ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');