From 8be8581673d5cffbbeff28512baf66a6bc9aefb2 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 22 May 2023 11:17:28 +0800 Subject: [PATCH] * Remove function getAllExecutionPairsByProduct and replaced by getExecutionPairsByProduct. --- module/gitlab/control.php | 4 ++-- module/product/control.php | 2 +- module/product/test/product.class.php | 22 ---------------------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/module/gitlab/control.php b/module/gitlab/control.php index ed66b2caee..626e878786 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -1249,7 +1249,7 @@ class gitlab extends control { if(!$productID) return $this->send(array('message' => array())); - $executions = $this->loadModel('product')->getAllExecutionPairsByProduct($productID); + $executions = $this->loadModel('product')->getExecutionPairsByProduct($productID); $options = ""; foreach($executions as $index =>$execution) { @@ -1361,7 +1361,7 @@ class gitlab extends control /* If the status code beginning with 20 is returned or empty is returned, it is successful. */ if(!$reponse or substr($reponse->message, 0, 2) == '20') { - $this->loadModel('action')->create('gitlabtag', $projectID, 'deleted', '', $project->name); + $this->loadModel('action')->create('gitlabtag', $projectID, 'deleted', '', $projectID); return print(js::reload('parent')); } diff --git a/module/product/control.php b/module/product/control.php index 92c07b55c6..ce4c32216e 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -946,7 +946,7 @@ class product extends control if($projectID) $project = $this->loadModel('project')->getByID($projectID); $mode .= ($from == 'bugToTask' or empty($this->config->CRExecution)) ? 'noclosed' : ''; $mode .= !$projectID ? ',multiple' : ''; - $executions = $from == 'showImport' ? $this->product->getAllExecutionPairsByProduct($productID, $branch, $projectID) : $this->product->getExecutionPairsByProduct($productID, $branch, $projectID, $mode); + $executions = $this->product->getExecutionPairsByProduct($productID, $branch, $projectID, $from == 'showImport' ? '' : $mode); if($this->app->getViewType() == 'json') return print(json_encode($executions)); if($number === '') diff --git a/module/product/test/product.class.php b/module/product/test/product.class.php index 79c975cde6..ed570d0473 100644 --- a/module/product/test/product.class.php +++ b/module/product/test/product.class.php @@ -717,28 +717,6 @@ class productTest } } - /** - * Test get all executions by product. - * - * @param int $productID - * @param int $projectID - * @access public - * @return array - */ - public function getAllExecutionPairsByProductTest($productID, $projectID) - { - $executionPairs = $this->objectModel->getAllExecutionPairsByProduct($productID, 0, $projectID); - - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $executionPairs; - } - } - /** * Test get roadmap of a proejct. *