* Code for task#43401,#43507,#43398.

This commit is contained in:
dingna
2021-10-29 08:43:06 +08:00
parent 6035a7f700
commit 87c6365aee
5 changed files with 109 additions and 3 deletions
+19 -1
View File
@@ -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"'));
}
}
+1
View File
@@ -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:""}
+49
View File
@@ -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;
});
+6 -2
View File
@@ -10,8 +10,12 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kanban.html.php';?>
<?php js::set('executionID', $executionID);?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<div class="input-control space c-type"><i class="icon icon-list-all"></i><?php echo html::select('type', $lang->kanban->type, $type, 'class="form-control chosen" data-max_drop_width="215"');?></div>
<div class="input-control space c-group"><?php echo html::select('group', $lang->kanban->group->$type, $group, 'class="form-control chosen" data-max_drop_width="215"');?></div>
</div>
<div class='btn-toolbar pull-right'>
<?php
$link = $this->createLink('task', 'export', "execution=$executionID&orderBy=$orderBy&type=kanban");
@@ -58,7 +62,7 @@
?>
<?php if($canCreateTask or $canBatchCreateTask or $canCreateBug or $canBatchCreateBug or $canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlane):?>
<div class='dropdown' id='createDropdown'>
<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> <?php echo $this->lang->create;?> <span class='caret'></span></button>
<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> <?php echo $this->lang->task->create;?> <span class='caret'></span></button>
<ul class='dropdown-menu pull-right'>
<?php if($canCreateStory) echo '<li>' . html::a(helper::createLink('story', 'create', "productID=$productID&branch=0&moduleID=0&story=0&execution=$execution->id"), $lang->story->create, '', "data-app='execution'") . '</li>';?>
<?php if($canBatchCreateStory) echo '<li>' . html::a(helper::createLink('story', 'batchCreate', "productID=$productID&branch=0&moduleID=0&story=0&execution=$execution->id"), $lang->story->batchCreate, '', "data-app='execution'") . '</li>';?>
+34
View File
@@ -1,6 +1,40 @@
<?php
$lang->kanban = new stdClass();
$lang->kanban->type = array();
$lang->kanban->type['all'] = "综合看板";
$lang->kanban->type['story'] = "{$lang->SRCommon}看板";
$lang->kanban->type['task'] = "任务看板";
$lang->kanban->type['bug'] = "bug看板";
$lang->kanban->group = new stdClass();
$lang->kanban->group->all = array();
$lang->kanban->group->story = array();
$lang->kanban->group->story['default'] = "默认方式";
$lang->kanban->group->story['pri'] = "需求优先级";
$lang->kanban->group->story['category'] = "需求类别";
$lang->kanban->group->story['module'] = "需求模块";
$lang->kanban->group->story['source'] = "需求来源";
$lang->kanban->group->story['assignedTo'] = "指派人员";
$lang->kanban->group->task = array();
$lang->kanban->group->task['default'] = "默认方式";
$lang->kanban->group->task['pri'] = "任务优先级";
$lang->kanban->group->task['type'] = "任务类型";
$lang->kanban->group->task['module'] = "任务所属模块";
$lang->kanban->group->task['story'] = "软件需求";
$lang->kanban->group->task['assignedTo'] = "指派人员";
$lang->kanban->group->bug = array();
$lang->kanban->group->bug['default'] = "默认方式";
$lang->kanban->group->bug['pri'] = "bug优先级";
$lang->kanban->group->bug['type'] = "bug类型";
$lang->kanban->group->bug['module'] = "bug模块";
$lang->kanban->group->bug['severity'] = "bug严重程度";
$lang->kanban->group->bug['assignedTo'] = "指派人员";
$lang->kanban->WIP = 'WIP';
$lang->kanban->setWIP = '在制品设置';
$lang->kanban->WIPStatus = '在制品状态';