From 6a1bb3f756a4c515032c97806feb1fedf86d8973 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Wed, 17 Aug 2022 16:13:26 +0800 Subject: [PATCH] * Code for task #65278. --- module/task/control.php | 23 ++++++++++++++++------- module/task/model.php | 2 -- module/task/view/editteam.html.php | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) mode change 100644 => 100755 module/task/model.php mode change 100644 => 100755 module/task/view/editteam.html.php diff --git a/module/task/control.php b/module/task/control.php index b4965f14ba..ef65ffd47c 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -778,7 +778,7 @@ class task extends control if(!empty($task->team) and $task->mode == 'multi') { - return $this->editTeam($executionID, $task, $kanbanGroup); + return $this->editTeam($executionID, $task, $kanbanGroup, $from); } if(!empty($_POST)) @@ -2320,10 +2320,11 @@ class task extends control * @param int $requestID * @param object $task * @param string $kanbanGroup + * @param string $from * @access public * @return void */ - public function editTeam($executionID, $task, $kanbanGroup = 'default') + public function editTeam($executionID, $task, $kanbanGroup = 'default', $from = '') { $taskID = $task->id; $this->commonAction($taskID); @@ -2349,7 +2350,17 @@ class task extends control { $task = $this->task->getById($taskID); $execution = $this->execution->getByID($task->execution); - if(($this->app->tab == 'execution' or $this->config->vision == 'lite') and $this->app->tab == 'execution') + + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project' and $this->session->kanbanview == 'kanban')) and $execution->type == 'kanban') + { + $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + + if($from == 'taskkanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup, $rdSearchValue); @@ -2357,10 +2368,8 @@ class task extends control return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } - else - { - return print(js::closeModal('parent.parent', 'this')); - } + + return print(js::closeModal('parent.parent', 'this')); } return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } diff --git a/module/task/model.php b/module/task/model.php old mode 100644 new mode 100755 index 2c6ef4aa12..9c2cc0ef54 --- a/module/task/model.php +++ b/module/task/model.php @@ -1530,8 +1530,6 @@ class taskModel extends model ->remove('comment,showModule,team,teamEstimate,teamConsumed,teamLeft') ->get(); - if($task->consumed < $oldTask->consumed) return print(js::error($this->lang->task->error->consumedSmall)); - $teams = array(); if(count(array_unique(array_filter($this->post->team))) > 1) { diff --git a/module/task/view/editteam.html.php b/module/task/view/editteam.html.php old mode 100644 new mode 100755 index 1a8d18503c..407837db23 --- a/module/task/view/editteam.html.php +++ b/module/task/view/editteam.html.php @@ -82,7 +82,7 @@ task->estimate?> task->hour}'")?> task->consumed?> - task->hour}'")?> + task->hour}'")?> task->left?> task->hour}'")?>