diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 60657b08061..bba05a55c8e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2014 Marcos García * Copyright (C) 2018 Frédéric France + * Copyright (C) 2020 Juanjo Menent * * 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 @@ -154,7 +155,8 @@ class Task extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task ("; - $sql .= "fk_projet"; + $sql .= "entity"; + $sql .= ", fk_projet"; $sql .= ", ref"; $sql .= ", fk_task_parent"; $sql .= ", label"; @@ -166,7 +168,8 @@ class Task extends CommonObject $sql .= ", planned_workload"; $sql .= ", progress"; $sql .= ") VALUES ("; - $sql .= $this->fk_project; + $sql .= $conf->entity; + $sql .= ", ".$this->fk_project; $sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null'); $sql .= ", ".$this->fk_task_parent; $sql .= ", '".$this->db->escape($this->label)."'";