* Modify the module tree in project story.

This commit is contained in:
hufangzhou
2021-11-21 16:10:21 +08:00
parent 01bfb0629e
commit c1f2dfd857

View File

@@ -783,6 +783,8 @@ class treeModel extends model
*/
public function getProjectStoryTreeMenu($rootID, $startModule = 0, $userFunc)
{
$this->app->loadLang('branch');
if($this->app->rawModule == 'projectstory') $extra['projectID'] = $rootID;
if($this->app->rawModule == 'execution') $extra['executionID'] = $rootID;
$menu = "<ul id='modules' class='tree' data-ride='tree' data-name='tree-story'>";
@@ -802,8 +804,24 @@ class treeModel extends model
/* Get module according to product. */
$products = $this->loadModel('product')->getProductPairsByProject($rootID);
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
$productNum = count($products);
$branchGroups = $this->dao->select('t1.product as product,branch,t3.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->leftJoin(TABLE_BRANCH)->alias('t3')->on('t1.branch=t3.id')
->where('t1.project')->eq($rootID)
->andWhere('t2.type')->ne('normal')
->andWhere('t1.product')->in(array_keys($products))
->andWhere('t2.deleted')->eq('0')
->fetchGroup('product', 'branch');
foreach($branchGroups as $productID => $branches)
{
foreach($branches as $branchID => $branchInfo)
{
$branchGroups[$productID][$branchID] = $branchID == BRANCH_MAIN ? $this->lang->branch->main : $branchInfo->name;
}
}
$productNum = count($products);
foreach($products as $id => $product)
{
$extra['productID'] = $id;