FIX task have the same entity of project

This commit is contained in:
Regis Houssin 2023-03-24 16:18:14 +01:00
parent 7a12ba9c20
commit 4240ac18f3
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -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;