From d33b9ae7e686202dd248e676b21cdd18a2ee2266 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 2 Dec 2021 10:11:18 +0800 Subject: [PATCH] * Fix bug #17006,16785. --- module/product/model.php | 12 +++++++----- module/testtask/control.php | 2 +- module/testtask/js/create.js | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index cdd297a104..40000db08e 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -530,11 +530,13 @@ class productModel extends model $output .= ''; $output .= ""; - $notNormalProduct = (isset($currentProduct->type) and $currentProduct->type != 'normal'); - $isTrackMethod = ($currentModule == 'story' and $currentMethod == 'track'); - $isTreeBrowseMethod = ($currentModule == 'tree' and $currentMethod == 'browse'); - $isShowBranchMethod = (strpos($this->config->product->showBranchMethod, $currentMethod) !== false and $currentModule == 'product') || $isTrackMethod || $isTreeBrowseMethod; - if($notNormalProduct and strpos(',testsuite,testreport,', ',' . $currentModule . ',') === false and ($this->app->tab == 'qa' or $isShowBranchMethod)) + $notNormalProduct = (isset($currentProduct->type) and $currentProduct->type != 'normal'); + $isTrackMethod = ($currentModule == 'story' and $currentMethod == 'track'); + $isTreeBrowseMethod = ($currentModule == 'tree' and $currentMethod == 'browse'); + $isTesttaskCreateMethod = ($currentModule == 'testtask' and $currentMethod == 'create'); + $isTesttaskEditMethod = ($currentModule == 'testtask' and $currentMethod == 'edit'); + $isShowBranchMethod = (strpos($this->config->product->showBranchMethod, $currentMethod) !== false and $currentModule == 'product') || $isTrackMethod || $isTreeBrowseMethod; + if($notNormalProduct and strpos(',testsuite,testreport,', ',' . $currentModule . ',') === false and (($this->app->tab == 'qa' and !$isTesttaskCreateMethod and !$isTesttaskEditMethod) or $isShowBranchMethod)) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]); $branches = $this->loadModel('branch')->getPairs($productID, 'all'); diff --git a/module/testtask/control.php b/module/testtask/control.php index 09ae77ad0e..f6f1581325 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -252,7 +252,7 @@ class testtask extends control /* Create testtask from testtask of test.*/ $productID = $productID ? $productID : key($this->products); - $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID); + $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID); $builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 'all', 'notrunk', true); $testreports = $this->testtask->getTestReportPairsByBuild($build); diff --git a/module/testtask/js/create.js b/module/testtask/js/create.js index 5c712f34ac..e860542eee 100755 --- a/module/testtask/js/create.js +++ b/module/testtask/js/create.js @@ -23,7 +23,7 @@ function loadProductRelated() */ function loadExecutions(productID) { - link = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID); + link = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID + '&branch='); $.get(link, function(data) { if(!data) data = '';