From 83f30798043baadfd570fa4fc6fe9a67ef6fe29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Thu, 28 Oct 2021 11:01:50 +0800 Subject: [PATCH] * Finish task #43393. --- module/common/lang/zh-cn.php | 1 + module/execution/control.php | 10 +++++----- module/execution/js/kanban.js | 12 +++++++++--- module/execution/lang/zh-cn.php | 5 +++++ module/execution/view/kanban.html.php | 4 ++++ module/kanban/model.php | 12 ++++++------ 6 files changed, 30 insertions(+), 14 deletions(-) diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 59b4a7c9c2..e9ff9e0e63 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -24,6 +24,7 @@ $lang->null = '空'; $lang->ellipsis = '…'; $lang->percent = '%'; $lang->dash = '-'; +$lang->create = '新建'; $lang->zentaoPMS = '禅道'; $lang->pmsName = '开源版'; diff --git a/module/execution/control.php b/module/execution/control.php index f67a3d3376..3d8d8064b5 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1825,12 +1825,12 @@ class execution extends control * Kanban. * * @param int $executionID - * @param string $type + * @param string $browseType story|bug|task|all * @param string $orderBy * @access public * @return void */ - public function kanban($executionID, $type = 'story', $orderBy = 'order_asc') + public function kanban($executionID, $browseType = 'all', $orderBy = 'order_asc') { /* Save to session. */ $uri = $this->app->getURI(true); @@ -1840,11 +1840,11 @@ class execution extends control /* Compatibility IE8. */ if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); - $kanbanGroup = $this->loadModel('kanban')->getExecutionKanban($executionID); + $kanbanGroup = $this->loadModel('kanban')->getExecutionKanban($executionID, $browseType); if(empty($kanbanGroup)) { $this->kanban->createLanes($executionID); - $kanbanGroup = $this->kanban->getExecutionKanban($executionID); + $kanbanGroup = $this->kanban->getExecutionKanban($executionID, $browseType); } $this->execution->setMenu($executionID); @@ -1877,7 +1877,7 @@ class execution extends control $this->view->browseType = ''; $this->view->kanbanGroup = $kanbanGroup; $this->view->execution = $execution; - $this->view->type = $type; + $this->view->browseType = $browseType; $this->view->canBeChanged = $canBeChanged; $this->display(); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 6d4556467f..b20f38459e 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1,3 +1,9 @@ +function changeView(view) +{ + var link = createLink('execution', 'kanban', "executionID=" + executionID + '&type=' + view); + location.href = link; +} + /** * Render user avatar * @param {String|{account: string, avatar: string}} user User account or user object @@ -335,11 +341,11 @@ $(function() }; /* Create story kanban 创建需求看板 */ - createKanban('story', kanbanGroup.story, commonOptions); + if(browseType == 'all' || browseType == 'story') createKanban('story', kanbanGroup.story, commonOptions); /* Create bug kanban 创建 Bug 看板 */ - createKanban('bug', kanbanGroup.bug, commonOptions); + if(browseType == 'all' || browseType == 'bug') createKanban('bug', kanbanGroup.bug, commonOptions); /* Create task kanban 创建 任务 看板 */ - createKanban('task', kanbanGroup.task, commonOptions); + if(browseType == 'all' || browseType == 'task') createKanban('task', kanbanGroup.task, commonOptions); }); diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 4e26f70a5b..518d842e81 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -386,6 +386,11 @@ $lang->execution->kanbanHideCols = '看板隐藏已关闭、已取消列'; $lang->execution->kanbanShowOption = '显示折叠信息'; $lang->execution->kanbanColsColor = '看板列自定义颜色'; +$lang->execution->kanbanViewList['all'] = '综合看板'; +$lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}看板"; +$lang->execution->kanbanViewList['bug'] = 'Bug看板'; +$lang->execution->kanbanViewList['task'] = '任务看板'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = '是否恢复看板默认设置?'; $lang->kanbanSetting->optionList['0'] = '隐藏'; diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 0c7df45bb9..8d3cc66013 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -12,6 +12,9 @@