* Code for finish task #84578.
This commit is contained in:
+10
-11
@@ -1629,9 +1629,10 @@ class executionModel extends model
|
||||
/* Process executions. */
|
||||
$this->app->loadConfig('task');
|
||||
|
||||
$emptyHour = array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0);
|
||||
$today = helper::today();
|
||||
$childList = array();
|
||||
$emptyHour = array('totalEstimate' => 0, 'totalConsumed' => 0, 'totalLeft' => 0, 'progress' => 0);
|
||||
$today = helper::today();
|
||||
$childList = array();
|
||||
$parentList = array();
|
||||
foreach($executions as $key => $execution)
|
||||
{
|
||||
$execution->productName = isset($productNameList[$execution->id]) ? $productNameList[$execution->id] : '';
|
||||
@@ -1664,7 +1665,7 @@ class executionModel extends model
|
||||
/* In the case of the waterfall model, calculate the sub-stage. */
|
||||
if($param === 'skipParent')
|
||||
{
|
||||
if($execution->parent < 0 and $execution->type == 'stage') unset($executions[$key]);
|
||||
if($execution->parent) $parentList[$execution->parent] = $execution->parent;
|
||||
if($execution->projectName) $execution->name = $execution->projectName . ' / ' . $execution->name;
|
||||
}
|
||||
elseif($param === 'hasParentName')
|
||||
@@ -1672,13 +1673,10 @@ class executionModel extends model
|
||||
$parentExecutions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('id')->in(trim($execution->path, ','))->andWhere('type')->in('stage,kanban,sprint')->orderBy('grade')->fetchPairs();
|
||||
$executions[$execution->id]->title = implode('/', $parentExecutions);
|
||||
}
|
||||
else
|
||||
elseif(isset($executions[$execution->parent]))
|
||||
{
|
||||
if(isset($executions[$execution->parent]))
|
||||
{
|
||||
$executions[$execution->parent]->children[$key] = $execution;
|
||||
$childList[$key] = $key;
|
||||
}
|
||||
$executions[$execution->parent]->children[$key] = $execution;
|
||||
$childList[$key] = $key;
|
||||
}
|
||||
|
||||
/* Bind execution product */
|
||||
@@ -1688,7 +1686,8 @@ class executionModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
foreach($childList as $id) unset($executions[$id]);
|
||||
foreach($childList as $childID) unset($executions[$childID]);
|
||||
foreach($parentList as $parentID) unset($executions[$parentID]);
|
||||
|
||||
return array_values($executions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user