Copy category on new task when create a task from sub-task

This commit is contained in:
Juan Pablo Canepa 2017-12-14 10:44:23 -03:00 committed by fguillot
parent 8d206a2f4e
commit 2c72a283f2
1 changed files with 2 additions and 0 deletions

View File

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