From a6c81712860c0c2c62ba1daa87285e48277d6497 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 1 Dec 2022 10:33:59 +0800 Subject: [PATCH] * Fix bug #30278. --- module/execution/control.php | 4 ++-- module/tree/model.php | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 60812612b8..6ea8d61fc6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1097,7 +1097,7 @@ class execution extends control $modules = $this->tree->getAllModulePairs('bug'); /* Get module tree.*/ - $extra = array('executionID' => $executionID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build, 'branchID' => $branch); + $extra = array('projectID' => $executionID, 'orderBy' => $orderBy, 'type' => $type, 'build' => $build, 'branchID' => $branch); if($executionID and empty($productID) and count($products) > 1) { $moduleTree = $this->tree->getBugTreeMenu($executionID, $productID, 0, array('treeModel', 'createBugLink'), $extra); @@ -1205,7 +1205,7 @@ class execution extends control } else { - $moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('executionID' => $executionID, 'productID' => $productID), $branchID); + $moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('projectID' => $executionID, 'productID' => $productID), $branchID); } $tree = $moduleID ? $this->tree->getByID($moduleID) : ''; diff --git a/module/tree/model.php b/module/tree/model.php index 3a11582c03..c84f818e66 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -425,10 +425,9 @@ class treeModel extends model $this->loadModel('branch'); $projectID = zget($extra, 'projectID', 0); - $executionID = zget($extra, 'executionID', 0); $branches = array($branch => ''); $executionModules = array(); - if($branch and empty($projectID) and empty($executionID)) + if($branch and empty($projectID)) { $branchName = $this->branch->getById($branch); $branches = array($branch => $branchName); @@ -438,15 +437,15 @@ class treeModel extends model $manage = $userFunc[1] == 'createManageLink' ? true : false; $product = $this->loadModel('product')->getById($rootID); - $onlyGetLinked = (($projectID or $executionID) and $this->config->vision != 'lite'); - if(strpos('story|bug|case', $type) !== false and $branch === 'all' and empty($projectID) and empty($executionID)) + $onlyGetLinked = ($projectID and $this->config->vision != 'lite'); + if(strpos('story|bug|case', $type) !== false and $branch === 'all' and empty($projectID)) { if($product->type != 'normal') $branches = array(BRANCH_MAIN => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($rootID, 'noempty'); } elseif(strpos(',case,bug,', ",$type,") !== false and $this->app->tab == 'execution') { - if($product->type != 'normal' and $executionID) $branches += $this->branch->getPairs($product->id, 'noempty', $executionID); - if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($executionID, true, $type, array('branchID' => $branch)); + if($product->type != 'normal' and $projectID) $branches += $this->branch->getPairs($product->id, 'noempty', $projectID); + if($onlyGetLinked) $executionModules = $this->getTaskTreeModules($projectID, true, $type, array('branchID' => $branch)); } elseif(($type == 'story' and $this->app->rawModule == 'projectstory') or (strpos(',case,bug,', ",$type,") !== false and $this->app->tab == 'project')) { @@ -1259,7 +1258,7 @@ class treeModel extends model $param = "root={$module->root}&branch=&type=byModule¶m={$module->id}"; $extra['type'] = (isset($extra['type']) and $extra['type'] != 'bysearch') ? $extra['type'] : 'all'; - if($this->app->tab == 'execution') $param = "execuitonID={$extra['executionID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; + if($this->app->tab == 'execution') $param = "execuitonID={$extra['projectID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; if($this->app->tab == 'project') $param = "projectID={$extra['projectID']}&productID={$module->root}&branch={$extra['branchID']}&orderBy={$extra['orderBy']}&build={$extra['build']}&type={$extra['type']}¶m={$module->id}"; return html::a(helper::createLink($moduleName, $methodName, $param), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } @@ -1278,7 +1277,7 @@ class treeModel extends model $moduleName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? $this->app->tab : 'testcase'; $methodName = strpos(',project,execution,', ",{$this->app->tab},") !== false ? 'testcase' : 'browse'; $param = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : ""; - $param = $this->app->tab == 'execution' ? "executionID={$extra['executionID']}&" : $param; + $param = $this->app->tab == 'execution' ? "executionID={$extra['projectID']}&" : $param; return html::a(helper::createLink($moduleName, $methodName, $param . "root={$module->root}&branch={$extra['branchID']}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' data-app='{$this->app->tab}' title='{$module->name}'"); }