diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 84829bf85cb..a4ef7965851 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008-2014 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2014 Marcos García + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -340,7 +341,7 @@ class Task extends CommonObject // Clean parameters if (isset($this->fk_project)) $this->fk_project=trim($this->fk_project); if (isset($this->ref)) $this->ref=trim($this->ref); - if (isset($this->fk_task_parent)) $this->fk_task_parent=trim($this->fk_task_parent); + if (isset($this->fk_task_parent)) $this->fk_task_parent = (int) $this->fk_task_parent; if (isset($this->label)) $this->label=trim($this->label); if (isset($this->description)) $this->description=trim($this->description); if (isset($this->duration_effective)) $this->duration_effective=trim($this->duration_effective); @@ -705,12 +706,12 @@ class Task extends CommonObject $this->fk_projet=''; $this->ref='TK01'; - $this->fk_task_parent=''; + $this->fk_task_parent=null; $this->label='Specimen task TK01'; $this->duration_effective=''; - $this->fk_user_creat=''; + $this->fk_user_creat=null; $this->progress='25'; - $this->fk_statut=''; + $this->fk_statut=null; $this->note='This is a specimen task not'; } @@ -1999,4 +2000,4 @@ class Task extends CommonObject return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); } -} \ No newline at end of file +}