From 4240ac18f37edba951519384a05e5ba5b7a3bdcd Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 24 Mar 2023 16:18:14 +0100 Subject: [PATCH] FIX task have the same entity of project --- htdocs/projet/class/task.class.php | 2 +- htdocs/projet/tasks.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 87dab1c728a..1ece3dc712f 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -198,7 +198,7 @@ class Task extends CommonObjectLine $sql .= ", progress"; $sql .= ", budget_amount"; $sql .= ") VALUES ("; - $sql .= ((int) $conf->entity); + $sql .= (!empty($this->entity) ? (int) $this->entity : (int) $conf->entity); $sql .= ", ".((int) $this->fk_project); $sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null'); $sql .= ", ".((int) $this->fk_task_parent); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 22258bd3b18..e5a7bb4134a 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -336,6 +336,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) { $task = new Task($db); $task->fk_project = $projectid; + $task->entity = $object->entity; // Task have the same entity of project $task->ref = $taskref; $task->label = $label; $task->description = $description;