* Finish task #83947.

This commit is contained in:
Yagami
2023-02-07 16:05:18 +08:00
parent 3e1b5be66e
commit 4403b96bf8
2 changed files with 20 additions and 67 deletions
+4 -38
View File
@@ -298,33 +298,16 @@ class task extends control
/* Set Custom*/
foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field;
$executions = array();
if(!empty($projectID))
{
$executionList = $this->execution->getByProject($projectID, 'all', 0, true);
$project = $this->loadModel('project')->getByID($projectID);
$replace = substr(current($executionList), 0, strpos(current($executionList), '/'));
$executions = $this->execution->getByProject($projectID, 'all', 0, true);
$executionKey = 0;
$executionModifyList = $this->execution->getByIdList(array_keys($executionList));
$executionModifyList = $this->execution->getByIdList(array_keys($executions));
foreach($executionModifyList as $modifykey)
{
if(!common::canModify('execution', $modifykey)) $executionKey = $modifykey->id;
if($executionKey) unset($executionList[$executionKey]);
}
$executionAll = $executionList;
if(isset($project->model) and $project->model == 'waterfall')
{
foreach($executionList as $key => $val)
{
$values = str_replace($replace, $project->name, $val);
$executions[$key] = $values;
}
}
else
{
$executions = $executionList;
if($executionKey) unset($executions[$executionKey]);
}
}
@@ -642,24 +625,7 @@ class task extends control
if(isset($this->view->members['closed']) or $this->view->task->status == 'closed') $this->view->members['closed'] = 'Closed';
$executions = array();
if(!empty($task->project))
{
$executionList = $this->execution->getPairs($task->project);
$project = $this->loadModel('project')->getByID($task->project);
if(isset($project->model) and $project->model == 'waterfall')
{
foreach($executionList as $key=>$val)
{
$values = $project->name . '/' . $val;
$executions[$key] = $values;
}
}
else
{
$executions = $executionList;
}
}
if(!empty($task->project)) $executions = $this->execution->getByProject($task->project, 'all', 0, true);
$this->view->title = $this->lang->task->edit . 'TASK' . $this->lang->colon . $this->view->task->name;
$this->view->position[] = $this->lang->task->common;