From 845c84a1eb2da52d68b1ccae2235abc4b60abea8 Mon Sep 17 00:00:00 2001 From: sunjun Date: Fri, 13 May 2022 02:53:47 +0000 Subject: [PATCH] *sprint_sunjun_631 --- module/execution/control.php | 15 ++++- .../execution/view/ajaxgetdropmenu.html.php | 63 ++++++++++++++----- module/project/model.php | 11 ++++ 3 files changed, 72 insertions(+), 17 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 0f3f306bda..407d833f02 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3138,7 +3138,7 @@ class execution extends control foreach($executions as $execution) { - if(isset($orderedExecutions[$execution->parent])) unset($orderedExecutions[$execution->parent]); + if(isset($orderedExecutions[$execution->parent]) and $project->model != 'waterfall') unset($orderedExecutions[$execution->parent]); $execution->teams = zget($teams, $execution->id, array()); $orderedExecutions[$execution->id] = $execution; } @@ -3160,11 +3160,20 @@ class execution extends control $projectExecutions = array(); $parentIdList = array(); + $childrenIdList = array(); foreach($orderedExecutions as $execution) { - $projectExecutions[$execution->project][] = $execution; if($execution->type != 'stage') continue; - if($execution->grade == 2 and $execution->project != $execution->parent) $parentIdList[$execution->parent] = $execution->parent; + if($execution->grade == 2 and $execution->project != $execution->parent) + { + $parentIdList[$execution->parent] = $execution->parent; + $childrenIdList[$execution->parent][] = $execution->id; + } + } + foreach($orderedExecutions as $id => $execution) + { + $execution->children = isset($childrenIdList[$execution->id]) ? $childrenIdList[$execution->id] : array(); + $projectExecutions[$execution->project][] = $execution; } $parents = array(); diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index f5c2d77aa6..d504cfd1a3 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -71,7 +71,6 @@ foreach($executions as $projectID => $projectExecutions) if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '