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;