From 29b585ba3537bfb64c4dee22b0c47211b1990f9b Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Thu, 12 Nov 2020 11:27:36 +0800 Subject: [PATCH] * Finish task#8338. --- module/product/control.php | 4 ++-- module/product/model.php | 1 + module/tree/model.php | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index d6adb1d68b..fade57989b 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -150,11 +150,11 @@ class product extends control { setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); $browseType = 'unclosed'; - $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch); + $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch, "¶m=$param&storyType=$storyType"); } else { - $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch); + $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch, "¶m=$param&storyType=$storyType"); } if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType); diff --git a/module/product/model.php b/module/product/model.php index 08e0e1dc5a..25adbef042 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -452,6 +452,7 @@ class productModel extends model if(isset($currentProduct->type) && $currentProduct->type != 'normal') { $branches = $this->loadModel('branch')->getPairs($productID); + $branch = empty($branch) ? (int)$this->cookie->preBranch : $branch; $branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0]; $dropMenuLink = helper::createLink('branch', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra"); diff --git a/module/tree/model.php b/module/tree/model.php index 1fbc1dbe35..5527188599 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -371,10 +371,12 @@ class treeModel extends model * @param int $startModule * @param string $userFunc the function used to create link * @param string $extra extra params + * @param string $branch product branch + * @param string $extraParams extra params * @access public * @return string */ - public function getTreeMenu($rootID, $type = 'root', $startModule = 0, $userFunc, $extra = '', $branch = 0) + public function getTreeMenu($rootID, $type = 'root', $startModule = 0, $userFunc, $extra = '', $branch = 0, $extraParams = '') { if($type == 'line') $rootID = 0; @@ -408,7 +410,7 @@ class treeModel extends model { $linkHtml = ($type == 'case' and !empty($extra)) ? '' . $branch . '' : $this->createBranchLink($type, $rootID, $branchID, $branch); $linkHtml = $manage ? html::a(inlink('browse', "root=$rootID&viewType=$type¤tModuleID=0&branch=$branchID"), $branch) : $linkHtml; - if($type == 'story' or $type == 'bug') $linkHtml = html::a(inlink('browse', "productID=$rootID&branch=$branchID&browseType=bybranch"), $branch, "", "id=branch" . $branchID); + if($type == 'story' or $type == 'bug') $linkHtml = html::a(inlink('browse', "productID=$rootID&branch=$branchID&browseType=bybranch" . $extraParams), $branch, "", "id=branch" . $branchID); if($firstBranch and $product->type != 'normal') { $linkHtml = '' . $this->lang->product->branchName[$product->type] . '