From 0e81c1cf78ddb8717e90842caec8ed57d8f4974c Mon Sep 17 00:00:00 2001 From: liuhong Date: Sun, 30 Oct 2022 04:39:47 +0000 Subject: [PATCH] * Fix bug #26228. --- module/task/control.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index d1bd933741..b8111cc5dd 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -297,6 +297,18 @@ class task extends control $executionList = $this->execution->getByProject($projectID, 'all', 0, true); $project = $this->loadModel('project')->getByID($projectID); $replace = substr(current($executionList), 0, strpos(current($executionList), '/')); + + /* Fix bug #26228 closed execution chose execution when create task.*/ + $keys = array_keys($executionList); + $executionKey = 0; + $executionModifyList = $this->execution->getByIdList($keys); + foreach($executionModifyList as $execution) + { + if(!common::canModify('execution', $execution)) $executionKey = $execution->id; + if($executionKey) unset($executionList[$executionKey]); + } + $executionAll = $executionList; + if(isset($project->model) and $project->model == 'waterfall') { foreach($executionList as $key => $val) @@ -305,10 +317,6 @@ class task extends control $executionAll[$key] = $values; } } - else - { - $executionAll = $executionList; - } } $executions = $this->config->systemMode == 'classic' ? $executions : $executionAll;