Merge branch 'master_bug_26228' into 'master'

* Fix bug #26228.

See merge request easycorp/zentaopms!5943
This commit is contained in:
王怡栋
2022-10-31 05:58:26 +00:00
+12 -4
View File
@@ -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;