From 0dd10f48dcb660d2cadf385bd191359defd11298 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 8 Aug 2023 16:01:56 +0800 Subject: [PATCH] * Change the get execution paris method. --- module/action/model.php | 2 +- module/execution/model.php | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/module/action/model.php b/module/action/model.php index 3100502e09..7dcfba9989 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1104,7 +1104,7 @@ class actionModel extends model elseif($productID == 'all' and is_numeric($projectID)) { $products = $this->loadModel('product')->getProductPairsByProject($projectID); - $executions = $this->loadModel('execution')->getPairs($projectID) + array(0 => 0); + $executions = $this->loadModel('execution')->fetchPairs($projectID) + array(0 => 0); $authedExecutions = isset($authedExecutions) ? array_intersect(array_keys($executions), explode(',', $authedExecutions)) : array_keys($executions); diff --git a/module/execution/model.php b/module/execution/model.php index 116c7d252a..ab24558e52 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1714,6 +1714,26 @@ class executionModel extends model return $pairs; } + /** + * Get an array of task id:name. + * + * @param int $projectID + * @access public + * @return array + */ + public function fetchPairs($projectID = 0, $type = 'all', $filterMulti = true) + { + return $this->dao->select('id,name')->from(TABLE_EXECUTION) + ->where('deleted')->eq(0) + ->andWhere('vision')->eq($this->config->vision) + ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() + ->beginIF($type == 'all')->andWhere('type')->in('stage,sprint,kanban')->fi() + ->beginIF($type != 'all')->andWhere('type')->in($type)->fi() + ->beginIF($filterMulti)->andWhere('multiple')->eq('1')->fi() + ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() + ->fetchPairs(); + } + /** * Get execution by idList. *