* Fix bug #49662.
This commit is contained in:
@@ -370,7 +370,7 @@ class executionTao extends executionModel
|
||||
$node->type = 'module';
|
||||
$stories = isset($storyGroups[$node->root][$node->id]) ? $storyGroups[$node->root][$node->id] : array();
|
||||
|
||||
$node->children = $this->buildStoryTree($stories, $taskGroups, $executionID, $node);
|
||||
$this->buildStoryTree($stories, $taskGroups, $executionID, $node);
|
||||
|
||||
/* Append for task of no story && node is not root. */
|
||||
if($node->id && isset($taskGroups[$node->id][0]))
|
||||
@@ -395,13 +395,12 @@ class executionTao extends executionModel
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function buildStoryTree(array $stories, array $taskGroups, int $executionID, object $node, int $parentID = 0): array
|
||||
protected function buildStoryTree(array $stories, array $taskGroups, int $executionID, object $node, int $parentID = 0)
|
||||
{
|
||||
static $users, $avatarPairs;
|
||||
if(empty($users)) $users = $this->loadModel('user')->getPairs('noletter');
|
||||
if(empty($avatarPairs)) $avatarPairs = $this->loadModel('user')->getAvatarPairs();
|
||||
|
||||
$tree = array();
|
||||
foreach($stories as $story)
|
||||
{
|
||||
if($story->parent != $parentID) continue;
|
||||
@@ -433,12 +432,9 @@ class executionTao extends executionModel
|
||||
$storyItem->children = $taskItems;
|
||||
}
|
||||
|
||||
$children = $this->buildStoryTree($stories, $taskGroups, $executionID, $node, $story->id);
|
||||
if($children) $storyItem->children = $children;
|
||||
$tree[] = $storyItem;
|
||||
$node->children[] = $storyItem;
|
||||
$this->buildStoryTree($stories, $taskGroups, $executionID, $node, $story->id);
|
||||
}
|
||||
|
||||
return $tree;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user