From 6ffa3a482c061acb5c2dc8fbf44ae6f44642ec12 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 14 Jul 2022 05:49:17 +0000 Subject: [PATCH] * Fix bug #25262. --- module/kanban/model.php | 2 +- module/task/control.php | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index a857dc05bd..aa3c4ff03d 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3808,7 +3808,7 @@ class kanbanModel extends model { $menu = array(); - if(common::hasPriv('task', 'edit') and $this->task->isClickable($task, 'edit')) $menu[] = array('label' => $this->lang->task->edit, 'icon' => 'edit', 'url' => helper::createLink('task', 'edit', "taskID=$task->id", '', true), 'size' => '95%'); + if(common::hasPriv('task', 'edit') and $this->task->isClickable($task, 'edit')) $menu[] = array('label' => $this->lang->task->edit, 'icon' => 'edit', 'url' => helper::createLink('task', 'edit', "taskID=$task->id&comment=false&kanbanGroup=default&from=taskkanban", '', true), 'size' => '95%'); if(common::hasPriv('task', 'pause') and $this->task->isClickable($task, 'pause')) $menu[] = array('label' => $this->lang->task->pause, 'icon' => 'pause', 'url' => helper::createLink('task', 'pause', "taskID=$task->id&extra=from=taskkanban", '', true)); if(common::hasPriv('task', 'restart') and $this->task->isClickable($task, 'restart')) $menu[] = array('label' => $this->lang->task->restart, 'icon' => 'play', 'url' => helper::createLink('task', 'restart', "taskID=$task->id&from=taskkanban", '', true)); if(common::hasPriv('task', 'recordEstimate') and $this->task->isClickable($task, 'recordEstimate')) $menu[] = array('label' => $this->lang->task->recordEstimate, 'icon' => 'time', 'url' => helper::createLink('task', 'recordEstimate', "taskID=$task->id&from=taskkanban", '', true)); diff --git a/module/task/control.php b/module/task/control.php index 27419d0dbd..e91f7eb33b 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -502,10 +502,11 @@ class task extends control * @param int $taskID * @param bool $comment * @param string $kanbanGroup + * @param string $from * @access public * @return void */ - public function edit($taskID, $comment = false, $kanbanGroup = 'default') + public function edit($taskID, $comment = false, $kanbanGroup = 'default', $from = '') { $this->commonAction($taskID); $task = $this->task->getById($taskID); @@ -553,7 +554,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); @@ -561,7 +562,7 @@ class task extends control return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } - else + if($from == 'taskkanban') { $taskSearchValue = $this->session->taskSearchValue ? $this->session->taskSearchValue : ''; $kanbanData = $this->loadModel('kanban')->getExecutionKanban($task->execution, $execLaneType, $execGroupBy, $taskSearchValue); @@ -792,7 +793,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroup, $rdSearchValue); @@ -1051,7 +1052,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; @@ -1124,7 +1125,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); @@ -1285,7 +1286,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == "kanban") + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == "kanban") { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; @@ -1383,7 +1384,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; @@ -1450,7 +1451,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); @@ -1531,7 +1532,7 @@ class task extends control $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; @@ -1704,7 +1705,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; @@ -1770,7 +1771,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if($execution->type == "kanban") + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == "kanban") { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; @@ -2333,7 +2334,7 @@ class task extends control { $task = $this->task->getById($taskID); $execution = $this->execution->getByID($task->execution); - if($execution->type == 'kanban' and $this->app->tab == 'execution') + if(($this->app->tab == 'execution' or $this->config->vision == 'lite') and $this->app->tab == 'execution') { $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);