From 2256e592c136d41e32ef9f3aa63a20cccf5dd084 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 17 May 2023 11:05:27 +0800 Subject: [PATCH] * Adjust the problem of sonar detection. --- module/task/control.php | 58 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 2ff4c5102e..353b95eb3d 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -1483,39 +1483,39 @@ class task extends control foreach($tasks as $task) { $task->storyTitle = isset($stories[$task->story]) ? $stories[$task->story]->title : ''; - if(isset($task->team)) - { - if($orderBy == 'finishedBy') $task->consumed = $task->estimate = $task->left = 0; - foreach($task->team as $team) - { - if($orderBy == 'finishedBy' and $team->left != 0) - { - $task->estimate += $team->estimate; - $task->consumed += $team->consumed; - $task->left += $team->left; - continue; - } - $cloneTask = clone $task; - $cloneTask->estimate = $team->estimate; - $cloneTask->consumed = $team->consumed; - $cloneTask->left = $team->left; - if($team->left == 0) $cloneTask->status = 'done'; - - if($orderBy == 'assignedTo') - { - $cloneTask->assignedToRealName = zget($users, $team->account); - $cloneTask->assignedTo = $team->account; - } - if($orderBy == 'finishedBy')$cloneTask->finishedBy = $team->account; - $groupTasks[$team->account][] = $cloneTask; - } - if(!empty($task->left) and $orderBy == 'finishedBy') $groupTasks[$task->finishedBy][] = $task; - } - else + if(!isset($task->team)) { $groupTasks[$task->$orderBy][] = $task; + continue; } + + if($orderBy == 'finishedBy') $task->consumed = $task->estimate = $task->left = 0; + foreach($task->team as $team) + { + if($orderBy == 'finishedBy' and $team->left != 0) + { + $task->estimate += $team->estimate; + $task->consumed += $team->consumed; + $task->left += $team->left; + continue; + } + + $cloneTask = clone $task; + $cloneTask->estimate = $team->estimate; + $cloneTask->consumed = $team->consumed; + $cloneTask->left = $team->left; + if($team->left == 0) $cloneTask->status = 'done'; + + if($orderBy == 'assignedTo') + { + $cloneTask->assignedToRealName = zget($users, $team->account); + $cloneTask->assignedTo = $team->account; + } + if($orderBy == 'finishedBy')$cloneTask->finishedBy = $team->account; + $groupTasks[$team->account][] = $cloneTask; + } + if(!empty($task->left) and $orderBy == 'finishedBy') $groupTasks[$task->finishedBy][] = $task; } $tasks = array();