diff --git a/module/project/control.php b/module/project/control.php index 2c519069f4..740eb6a0fa 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -854,7 +854,12 @@ class project extends control { /* 项目型项目不展示2.5级产品下拉菜单。 */ $project = $this->project->getByID($projectID); - if(!$project->hasProduct) $this->config->excludeSwitcherList[] = 'project-testcase'; + if(!$project->hasProduct) + { + $this->config->excludeSwitcherList[] = 'project-testcase'; + $productPairs = $this->loadModel('product')->getProductPairsByProject($projectID); + $productID = key($productPairs); + } echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&caseType=$caseType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID"); } diff --git a/module/testcase/ui/header.html.php b/module/testcase/ui/header.html.php index 430410fda1..41cb350f8e 100644 --- a/module/testcase/ui/header.html.php +++ b/module/testcase/ui/header.html.php @@ -29,7 +29,7 @@ $product = is_bool($product) ? new stdclass() : $product; $canModify = common::canModify('product', $product); $canSwitchCaseType = $this->app->tab == 'qa'; $canDisplaySuite = $this->app->tab == 'qa' && $rawMethod != 'browseunits'; -$canManageModule = hasPriv('tree', 'browse') && !empty($productID); +$canManageModule = hasPriv('tree', 'browse') && !empty($productID) && (!isset($project) || $project->hasProduct); $canCreateSuite = hasPriv('testsuite', 'create'); $canBrowseUnits = hasPriv('testtask', 'browseunits'); $canBrowseZeroCase = hasPriv('testcase', 'zerocase') && $rawMethod != 'browseunits'; diff --git a/module/testcase/zen.php b/module/testcase/zen.php index 364f109d9b..44e3951492 100644 --- a/module/testcase/zen.php +++ b/module/testcase/zen.php @@ -586,6 +586,7 @@ class testcaseZen extends testcase $this->view->switcherParams = "projectID={$projectID}&productID={$productID}¤tMethod=testcase"; $this->view->switcherText = zget($productPairs, $productID, $this->lang->product->all); + $this->view->project = $this->loadModel('project')->getByID($projectID); } }