From 79d9664263673a318e1e1efa8b1ac9deb9f9138e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 30 Mar 2022 20:48:33 +0800 Subject: [PATCH] * Fix bug#18002. --- module/execution/control.php | 9 +++------ module/execution/view/task.html.php | 1 + module/kanban/model.php | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index defae0bac5..1ba865bf66 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2131,7 +2131,6 @@ class execution extends control */ public function taskKanban($executionID, $browseType = '', $orderBy = 'order_asc', $groupBy = '') { - $execution = $this->loadModel('execution')->getById($executionID); if(empty($browseType)) $browseType = $this->session->kanbanType ? $this->session->kanbanType : 'all'; if(empty($groupBy)) $groupBy = 'default'; @@ -2150,6 +2149,8 @@ class execution extends control /* Compatibility IE8. */ if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); + $this->execution->setMenu($executionID); + $execution = $this->execution->getById($executionID); if($execution->lifetime == 'ops') { $browseType = 'task'; @@ -2157,8 +2158,7 @@ class execution extends control unset($this->lang->kanban->type['bug']); unset($this->lang->kanban->type['all']); } - - if($execution->type == 'stage' and $execution->attribute != 'dev') + elseif($execution->type == 'stage' and $execution->attribute != 'dev') { unset($this->lang->kanban->type['task']); } @@ -2170,9 +2170,6 @@ class execution extends control $kanbanGroup = $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy); } - $this->execution->setMenu($executionID); - $execution = $this->loadModel('execution')->getById($executionID); - /* Determines whether an object is editable. */ $canBeChanged = common::canModify('execution', $execution); diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php index bf0aa62c49..dbfdadd784 100644 --- a/module/execution/view/task.html.php +++ b/module/execution/view/task.html.php @@ -132,6 +132,7 @@ body {margin-bottom: 25px;} $misc = common::hasPriv('execution', 'importTask') ? "class='import'" : "class=disabled"; $link = common::hasPriv('execution', 'importTask') ? $this->createLink('execution', 'importTask', "execution=$execution->id") : '#'; echo "
  • " . html::a($link, $lang->execution->importTask, '', $misc) . "
  • "; + if($execution->lifetime != 'ops') { $class = common::hasPriv('execution', 'importBug') ? '' : "class=disabled"; diff --git a/module/kanban/model.php b/module/kanban/model.php index 01357a147d..746b3638ec 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1316,10 +1316,9 @@ class kanbanModel extends model */ public function getExecutionKanban($executionID, $browseType = 'all', $groupBy = 'default') { - $execution = $this->loadModel('execution')->getById($executionID); - if($groupBy != 'default') return $this->getKanban4Group($executionID, $browseType, $groupBy); + $execution = $this->loadModel('execution')->getById($executionID); $lanes = $this->dao->select('*')->from(TABLE_KANBANLANE) ->where('execution')->eq($executionID) ->andWhere('deleted')->eq(0)