* [bug#54103,done,0.5h] fix tree story bug.

This commit is contained in:
sunguangming
2024-08-16 13:30:42 +08:00
committed by 王怡栋
parent e18cb4c088
commit dd88fe7c98
2 changed files with 1 additions and 53 deletions
@@ -113,59 +113,6 @@ public function setSubNav(array $kanbanList, object $currentKanban): void
$this->lang->modulePageNav = $modulePageNav;
}
/**
* 获取树状图结构。
* Get tree structure.
*
* @param int $executionID
* @access public
* @return array
*/
public function getTree(int $executionID): array
{
$fullTrees = $this->loadModel('tree')->getTaskStructure($executionID, 0);
array_unshift($fullTrees, array('id' => 0, 'name' => '/', 'type' => 'task', 'actions' => false, 'root' => $executionID));
foreach($fullTrees as $i => $tree)
{
$tree = (object)$tree;
if($tree->type == 'product') array_unshift($tree->children, array('id' => 0, 'name' => '/', 'type' => 'story', 'actions' => false, 'root' => $tree->root));
$fullTree = $this->fillTasksInTree($tree, $executionID);
if(empty($fullTree->children))
{
unset($fullTrees[$i]);
}
else
{
$fullTrees[$i] = $fullTree;
}
}
if(isset($fullTrees[0]) and empty($fullTrees[0]->children)) array_shift($fullTrees);
$newTrees = array();
foreach($fullTrees as $i => $tree)
{
if($tree->type == 'product')
{
foreach($tree->children as $value)
{
$newTrees[] = $value;
}
}
else
{
$newTrees[] = $tree;
}
}
return array_values($newTrees);
}
/**
* 设置右上角页面切换按钮。
* Set right top page switch button.
@@ -21,6 +21,7 @@ featureBar
(
set::rootClass('ml-2'),
set::name('showStory'),
set::checked($this->cookie->showStory),
set::text($lang->execution->treeLevel['story']),
on::change('changeDisplay')
)