From 4d20bd7bf4d2750eecd71a6c2984b5ede5be3577 Mon Sep 17 00:00:00 2001 From: liuhong Date: Mon, 22 Aug 2022 06:31:23 +0000 Subject: [PATCH 1/4] *Fix bug #26725. --- module/task/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/control.php b/module/task/control.php index 1ea48ce614..856b4c8cce 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -613,7 +613,7 @@ class task extends control $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); $this->view->showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : ''; $this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->execution, 0, 0, $this->view->showAllModule ? 'allModule' : ''); - $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($task->project, 'all', 0, true); + $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($task->project, 'noclosed', 0, true); $this->display(); } From 8b12d60a3bc78c7c4b4b354b76506f2fd5330a87 Mon Sep 17 00:00:00 2001 From: liuhong Date: Tue, 23 Aug 2022 20:29:32 +0000 Subject: [PATCH 2/4] *Fix bug #26275. --- module/execution/model.php | 10 +++++++++- module/task/control.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index c2f067fe39..4c26b20bae 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1561,10 +1561,11 @@ class executionModel extends model * @param string $status * @param int $limit * @param string $pairs + * @param string $projectsToAppended * @access public * @return array */ - public function getByProject($projectID, $status = 'all', $limit = 0, $pairs = false, $devel = false) + public function getByProject($projectID, $status = 'all', $limit = 0, $pairs = false, $devel = false, $projectsToAppended = '') { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getExecutionPairs(); @@ -1585,6 +1586,13 @@ class executionModel extends model ->beginIF($limit)->limit($limit)->fi() ->fetchAll('id'); + if($projectsToAppended) + { + $task = $this->dao->select('execution')->from(TABLE_TASK)->where('id')->eq($projectsToAppended)->fetch('execution'); + $path = sprintf("%s,%s", $projectID, $task); + $executions += $this->dao->select('*')->from(TABLE_EXECUTION)->where('path')->like("%,$path,%")->fetchAll('id'); + } + if(isset($project->model) and $project->model == 'waterfall') { $executionList = array(); diff --git a/module/task/control.php b/module/task/control.php index 856b4c8cce..903b6c558d 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -613,7 +613,7 @@ class task extends control $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); $this->view->showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : ''; $this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->execution, 0, 0, $this->view->showAllModule ? 'allModule' : ''); - $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($task->project, 'noclosed', 0, true); + $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($task->project, 'noclosed', 0, true, false, $taskID); $this->display(); } From d9c174f9211556d7873110fee934db6774641368 Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 24 Aug 2022 01:09:11 +0000 Subject: [PATCH 3/4] *Fix bug #26725. --- module/execution/model.php | 3 +-- module/task/control.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 4c26b20bae..790f36e543 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1588,8 +1588,7 @@ class executionModel extends model if($projectsToAppended) { - $task = $this->dao->select('execution')->from(TABLE_TASK)->where('id')->eq($projectsToAppended)->fetch('execution'); - $path = sprintf("%s,%s", $projectID, $task); + $path = sprintf("%s,%s", $projectID, $projectsToAppended); $executions += $this->dao->select('*')->from(TABLE_EXECUTION)->where('path')->like("%,$path,%")->fetchAll('id'); } diff --git a/module/task/control.php b/module/task/control.php index 903b6c558d..a22df924b6 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -613,7 +613,7 @@ class task extends control $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}"); $this->view->showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : ''; $this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->execution, 0, 0, $this->view->showAllModule ? 'allModule' : ''); - $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($task->project, 'noclosed', 0, true, false, $taskID); + $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($task->project, 'noclosed', 0, true, false, $task->execution); $this->display(); } From 11c273036102bac3e9e44e63b8c8432f98cfc607 Mon Sep 17 00:00:00 2001 From: liuhong Date: Wed, 24 Aug 2022 03:28:26 +0000 Subject: [PATCH 4/4] *Fix bug #26725. --- module/execution/model.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 790f36e543..6e0a5bcf48 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1561,11 +1561,11 @@ class executionModel extends model * @param string $status * @param int $limit * @param string $pairs - * @param string $projectsToAppended + * @param int $appenedID * @access public * @return array */ - public function getByProject($projectID, $status = 'all', $limit = 0, $pairs = false, $devel = false, $projectsToAppended = '') + public function getByProject($projectID, $status = 'all', $limit = 0, $pairs = false, $devel = false, $appendedID = 0) { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getExecutionPairs(); @@ -1582,16 +1582,11 @@ class executionModel extends model ->beginIF($status != 'all' and $status != 'undone' and $status != 'noclosed')->andWhere('status')->in($status)->fi() ->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi() ->beginIF($devel === true)->andWhere('attribute')->in('dev,qa,release')->fi() + ->beginIF($appendedID)->orWhere('id')->eq($appendedID)->fi() ->orderBy($orderBy) ->beginIF($limit)->limit($limit)->fi() ->fetchAll('id'); - if($projectsToAppended) - { - $path = sprintf("%s,%s", $projectID, $projectsToAppended); - $executions += $this->dao->select('*')->from(TABLE_EXECUTION)->where('path')->like("%,$path,%")->fetchAll('id'); - } - if(isset($project->model) and $project->model == 'waterfall') { $executionList = array();