From bf069ccba949ed4bbfc3062bb11d8042161979cc Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 29 Nov 2024 10:40:31 +0800 Subject: [PATCH] * [refac bug #57595] Set estStarted and realStarted field for task tree. --- module/execution/model.php | 9 +++++++-- module/execution/tao.php | 3 +++ module/task/model.php | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 22cca528e2..72493a17cd 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4464,7 +4464,9 @@ class executionModel extends model switch($tree->type) { case 'task': - $label = $tree->parent > 0 ? $this->lang->task->children : $this->lang->task->common; + $label = $this->lang->task->common; + if($tree->parent > 0 && !$tree->isParent) $label = $this->lang->task->children; + if($tree->isParent) $label = $this->lang->task->parent; $treeData[$index]['url'] = $canViewTask ? helper::createLink('execution', 'treeTask', "taskID={$tree->id}") : ''; $treeData[$index]['content'] = array( 'html' => "', @@ -4515,9 +4517,12 @@ class executionModel extends model { if($tree->type == 'task') { + $label = $this->lang->task->common; + if($tree->parent > 0 && !$tree->isParent) $label = $this->lang->task->children; + if($tree->isParent) $label = $this->lang->task->parent; $treeData[$index]['url'] = $canViewTask ? helper::createLink('execution', 'treeTask', "taskID={$tree->id}") : ''; $treeData[$index]['content'] = array( - 'html' => "', + 'html' => "', ); } $treeData[$index]['items'] = $this->buildTree($tree->children, $hasProduct, $gradeGroup); diff --git a/module/execution/tao.php b/module/execution/tao.php index d7bca3f4ee..789526b737 100644 --- a/module/execution/tao.php +++ b/module/execution/tao.php @@ -781,6 +781,9 @@ class executionTao extends executionModel $taskItem->pri = (int)$task->pri; $taskItem->status = $task->status; $taskItem->parent = $task->parent; + $taskItem->isParent = $task->isParent; + $taskItem->estStarted = $task->estStarted; + $taskItem->realStarted = $task->realStarted; $taskItem->estimate = $task->estimate; $taskItem->consumed = $task->consumed; $taskItem->left = $task->left; diff --git a/module/task/model.php b/module/task/model.php index e5180ac1a6..39c1ca2842 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2587,6 +2587,7 @@ class taskModel extends model } /* Process parent-child task info. */ + $parentIdList = array(); foreach($tasks as $task) { if($task->parent > 0) $parentIdList[] = $task->parent;