Merge branch 'master' into zenops_46

This commit is contained in:
liyuchun
2022-09-29 09:25:12 +08:00
194 changed files with 5548 additions and 736 deletions
+33 -6
View File
@@ -611,6 +611,26 @@ class task extends control
if(!isset($this->view->members[$this->view->task->assignedTo])) $this->view->members[$this->view->task->assignedTo] = $this->view->task->assignedTo;
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;
}
}
$this->view->title = $this->lang->task->edit . 'TASK' . $this->lang->colon . $this->view->task->name;
$this->view->position[] = $this->lang->task->common;
$this->view->position[] = $this->lang->task->edit;
@@ -619,7 +639,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, $task->execution);
$this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $executions;
$this->display();
}
@@ -941,7 +961,11 @@ class task extends control
}
$execution = $this->execution->getById($task->execution);
if(!isonlybody() and $execution->type == 'kanban') return print(js::locate($this->createLink('execution', 'kanban', "executionID=$execution->id")));
if(!isonlybody() and $execution->type == 'kanban')
{
setcookie('taskToOpen', $taskID, 0, $this->config->webRoot, '', false, true);
return print(js::locate($this->createLink('execution', 'kanban', "executionID=$execution->id")));
}
$this->session->project = $task->project;
@@ -1109,10 +1133,11 @@ class task extends control
*
* @param int $taskID
* @param string $from
* @param string $orderBy
* @access public
* @return void
*/
public function recordEstimate($taskID, $from = '')
public function recordEstimate($taskID, $from = '', $orderBy = '')
{
$this->commonAction($taskID);
@@ -1171,12 +1196,14 @@ class task extends control
$this->session->set('estimateList', $uri, 'execution');
if(isonlybody()) $this->session->set('estimateList', $uri . (strpos($uri, '?') === false ? '?' : '&') . 'onlybody=yes', 'execution');
$task = $this->task->getById($taskID);
$orderBy = 'date,id';
if(!empty($task->team) and $task->mode == 'linear') $orderBy = 'order,date,id';
$task = $this->task->getById($taskID);
if(!empty($task->team) and $task->mode == 'linear' and !$orderBy) $orderBy = 'order_asc';
if(!$orderBy) $orderBy = 'date_asc';
$this->view->title = $this->lang->task->record;
$this->view->task = $task;
$this->view->from = $from;
$this->view->orderBy = $orderBy;
$this->view->efforts = $this->task->getTaskEstimate($taskID, '', '', $orderBy);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->display();