From 87c6365aee50b718fc3e3566febe04b073d057b2 Mon Sep 17 00:00:00 2001 From: dingna Date: Fri, 29 Oct 2021 08:30:07 +0800 Subject: [PATCH] * Code for task#43401,#43507,#43398. --- module/execution/control.php | 20 ++++++++++- module/execution/css/kanban.css | 1 + module/execution/js/kanban.js | 49 +++++++++++++++++++++++++++ module/execution/view/kanban.html.php | 8 +++-- module/kanban/lang/zh-cn.php | 34 +++++++++++++++++++ 5 files changed, 109 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 0b9252c8e0..30335035d5 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1831,7 +1831,7 @@ class execution extends control * @access public * @return void */ - public function kanban($executionID, $type = 'story', $orderBy = 'order_asc', $groupBy = 'default') + public function kanban($executionID, $type = 'all', $orderBy = 'order_asc', $groupBy = 'default') { /* Save to session. */ $uri = $this->app->getURI(true); @@ -1879,6 +1879,7 @@ class execution extends control $this->view->kanbanGroup = $kanbanGroup; $this->view->execution = $execution; $this->view->type = $type; + $this->view->group = $group; $this->view->canBeChanged = $canBeChanged; $this->display(); @@ -3247,4 +3248,21 @@ class execution extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->display(); } + + /** + *Ajax get group menu of lanes. + * + * @param string $type all|syory|task|bug + * @param string $group + * @access public + * @return void + */ + public function ajaxGetGroup($type, $group='id') + { + $this->loadModel('kanban'); + $groups = array(); + $groups = $this->lang->kanban->group->$type; + die(html::select("group", $groups, $group, 'class="form-control chosen" data-max_drop_width="215"')); + } + } diff --git a/module/execution/css/kanban.css b/module/execution/css/kanban.css index 8766d47741..3d19590938 100644 --- a/module/execution/css/kanban.css +++ b/module/execution/css/kanban.css @@ -15,3 +15,4 @@ .dropdown-menu a {text-align: left;} .scrollbar-hover {max-height: 2000px; overflow: scroll !important;} +.c-type, .c-group {width: 150px !important; overflow: unset; display:""} diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index a8e6146668..750ae9ed8c 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -692,6 +692,9 @@ $(function() } }; + /* Restore select menu */ + restoreSelect(); + /* Create story kanban 创建需求看板 */ createKanban('story', getStoryKanbanDemoData(), commonOptions); @@ -701,3 +704,49 @@ $(function() /* Create task kanban 创建 任务 看板 */ createKanban('task', getTaskKanbanDemoData(), commonOptions); }); + +/** + * Restore select menu. + */ +function restoreSelect() +{ + var type = $('#type').val(); + if(type == 'all') + { + $('.c-group').css("display","none"); + } +} + +/** + * Choose type. + */ +$('#type').change(function() +{ + var type = $('#type').val(); + $('.c-group').css("display",""); + if(type == 'all') + { + $('.c-group').css("display","none"); + } + else + { + $.get(createLink('execution', 'ajaxGetGroup', 'type=' + type), function(data) + { + $('#group_chosen').remove(); + $('#group').replaceWith(data); + $('#group').chosen(); + }) + } +}); + +/** + * Choose group of lane. + */ +$('.c-group').change(function() +{ + $('.c-group').css("display",""); + var type = $('#type').val(); + var group = $('#group').val(); + link = createLink('execution', 'kanban', 'executionID=' + executionID + '&type=' + type + '&orderBy=order_asc' + '&group=' + group); + location.href = link; +}); diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 0c7df45bb9..d77b0d1a9b 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -10,8 +10,12 @@ ?> - +