From ecee971a217d2e887e9ab1bd268cae9d27b629ca Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 25 Mar 2021 15:50:08 +0800 Subject: [PATCH] * Fix bug #11571. --- module/execution/control.php | 2 +- module/product/control.php | 33 +++++++++++++----------------- module/tree/model.php | 39 +++++++++++++++--------------------- 3 files changed, 31 insertions(+), 43 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index d44b7a8f75..5d3bb71392 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -801,7 +801,7 @@ class execution extends control $this->view->orderBy = $orderBy; $this->view->type = $this->session->executionStoryBrowseType; $this->view->param = $param; - $this->view->moduleTree = $this->loadModel('tree')->getExecutionStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createExecutionStoryLink')); + $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createStoryLink')); $this->view->tabID = 'story'; $this->view->storyTasks = $storyTasks; $this->view->storyBugs = $storyBugs; diff --git a/module/product/control.php b/module/product/control.php index 7d4b90017a..9be40fb686 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -174,25 +174,20 @@ class product extends control { setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); $browseType = 'unclosed'; - if($this->app->rawModule == 'projectstory' and empty($productID)) - { - $moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->project, 0, array('treeModel', 'createProjectStoryLink')); - } - else - { - $moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch, "¶m=$param&storyType=$storyType"); - } } else { - if($this->app->rawModule == 'projectstory' and empty($productID)) - { - $moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->project, 0, array('treeModel', 'createProjectStoryLink')); - } - else - { - $moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch, "¶m=$param&storyType=$storyType"); - } + $branch = (int)$this->cookie->treeBranch; + } + + /* If in project story and not chose product, get project story mdoules. */ + if($this->app->rawModule == 'projectstory' and empty($productID)) + { + $moduleTree = $this->tree->getProjectStoryTreeMenu($projectID, 0, array('treeModel', $createModuleLink)); + } + else + { + $moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), array('projectID' => $projectID, 'productID' => $productID), $branch, "¶m=$param&storyType=$storyType"); } if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType); @@ -215,12 +210,12 @@ class product extends control if($this->app->rawModule == 'projectstory') { if(!empty($product)) $this->session->set('currentProductType', $product->type); - $this->products = $this->loadModel('project')->getProducts($this->session->project, false); - $projectProducts = $this->product->getProducts($this->session->project); + $this->products = $this->loadModel('project')->getProducts($projectID, false); + $projectProducts = $this->product->getProducts($projectID); $productPlans = $this->execution->getPlans($projectProducts); if($browseType == 'bybranch') $param = $branch; - $stories = $this->story->getExecutionStories($this->session->project, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager); + $stories = $this->story->getExecutionStories($projectID, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager); } else { diff --git a/module/tree/model.php b/module/tree/model.php index a596e2e681..e22603223c 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -785,7 +785,7 @@ class treeModel extends model } /** - * Get execution story tree menu. + * Get project story tree menu. * * @param int $rootID * @param int $startModule @@ -793,9 +793,9 @@ class treeModel extends model * @access public * @return string */ - public function getExecutionStoryTreeMenu($rootID, $startModule = 0, $userFunc) + public function getProjectStoryTreeMenu($rootID, $startModule = 0, $userFunc) { - $extra['executionID'] = $rootID; + $extra['projectID'] = $rootID; $menu = "