From 2c72a283f2d51034f85f4e2ca8b194d304a3c433 Mon Sep 17 00:00:00 2001 From: Juan Pablo Canepa Date: Thu, 14 Dec 2017 10:44:23 -0300 Subject: Copy category on new task when create a task from sub-task --- app/Model/SubtaskTaskConversionModel.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/Model') diff --git a/app/Model/SubtaskTaskConversionModel.php b/app/Model/SubtaskTaskConversionModel.php index 8bf83d76..dd6b479d 100644 --- a/app/Model/SubtaskTaskConversionModel.php +++ b/app/Model/SubtaskTaskConversionModel.php @@ -23,6 +23,7 @@ class SubtaskTaskConversionModel extends Base public function convertToTask($project_id, $subtask_id) { $subtask = $this->subtaskModel->getById($subtask_id); + $parent_task = $this->taskFinderModel->getById($subtask['task_id']); $task_id = $this->taskCreationModel->create(array( 'project_id' => $project_id, @@ -30,6 +31,7 @@ class SubtaskTaskConversionModel extends Base 'time_estimated' => $subtask['time_estimated'], 'time_spent' => $subtask['time_spent'], 'owner_id' => $subtask['user_id'], + 'category_id' => $parent_task['category_id'] )); if ($task_id !== false) { -- cgit v1.2.3