Merge branch 'sprint/168' into 'sprint/168_hufangzhou_43423'
# Conflicts: # module/execution/js/kanban.js # module/kanban/model.php
This commit is contained in:
@@ -3,6 +3,7 @@ CREATE TABLE IF NOT EXISTS `zt_kanbanlane` (
|
||||
`id` int(8) NOT NULL AUTO_INCREMENT,
|
||||
`execution` mediumint(8) NOT NULL DEFAULT '0',
|
||||
`type` char(30) NOT NULL,
|
||||
`groupby` char(30) NOT NULL,
|
||||
`extra` char(30) NOT NULL,
|
||||
`name` varchar(255) NOT NULL DEFAULT '',
|
||||
`color` char(30) NOT NULL,
|
||||
|
||||
@@ -600,6 +600,7 @@ CREATE TABLE IF NOT EXISTS `zt_kanbanlane` (
|
||||
`id` int(8) NOT NULL AUTO_INCREMENT,
|
||||
`execution` mediumint(8) NOT NULL DEFAULT '0',
|
||||
`type` char(30) NOT NULL,
|
||||
`groupby` char(30) NOT NULL,
|
||||
`extra` char(30) NOT NULL,
|
||||
`name` varchar(255) NOT NULL DEFAULT '',
|
||||
`color` char(30) NOT NULL,
|
||||
|
||||
@@ -649,6 +649,9 @@ class bug extends control
|
||||
}
|
||||
|
||||
setcookie('bugModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
|
||||
|
||||
/* If link from no head then reload. */
|
||||
if(isonlybody()) die(js::reload('parent.parent'));
|
||||
die(js::locate($this->createLink('bug', 'browse', "productID={$productID}&branch=$branch&browseType=unclosed¶m=0&orderBy=id_desc"), 'parent'));
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ $lang->program->common = 'Program';
|
||||
$lang->product->common = 'Product';
|
||||
$lang->project->common = 'Project';
|
||||
$lang->execution->common = $config->systemMode == 'new' ? 'Execution' : $lang->executionCommon;
|
||||
$lang->kanban->common = 'Kanban';
|
||||
$lang->qa->common = 'QA';
|
||||
$lang->devops->common = 'DevOps';
|
||||
$lang->doc->common = 'Doc';
|
||||
|
||||
@@ -136,6 +136,7 @@ $lang->program->common = '项目集';
|
||||
$lang->product->common = '产品';
|
||||
$lang->project->common = '项目';
|
||||
$lang->execution->common = $config->systemMode == 'new' ? '执行' : $lang->executionCommon;
|
||||
$lang->kanban->common = '看板';
|
||||
$lang->qa->common = '测试';
|
||||
$lang->devops->common = 'DevOps';
|
||||
$lang->doc->common = '文档';
|
||||
|
||||
@@ -1838,14 +1838,19 @@ class execution extends control
|
||||
$this->app->session->set('taskList', $uri, 'execution');
|
||||
$this->app->session->set('bugList', $uri, 'qa');
|
||||
|
||||
/* Load language. */
|
||||
$this->app->loadLang('story');
|
||||
$this->app->loadLang('task');
|
||||
$this->app->loadLang('bug');
|
||||
|
||||
/* 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, $browseType);
|
||||
$kanbanGroup = $this->loadModel('kanban')->getExecutionKanban($executionID, $browseType, $groupBy);
|
||||
if(empty($kanbanGroup))
|
||||
{
|
||||
$this->kanban->createLanes($executionID, $browseType, $groupBy);
|
||||
$kanbanGroup = $this->kanban->getExecutionKanban($executionID, $browseType);
|
||||
$kanbanGroup = $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy);
|
||||
}
|
||||
|
||||
$this->execution->setMenu($executionID);
|
||||
@@ -2404,6 +2409,8 @@ class execution extends control
|
||||
{
|
||||
$this->execution->linkStory($objectID);
|
||||
if($object->type != 'project' and $object->project != 0) $this->execution->linkStory($object->project);
|
||||
|
||||
if(isonlybody()) die(js::reload('parent'));
|
||||
die(js::locate($browseLink));
|
||||
}
|
||||
|
||||
@@ -3120,13 +3127,14 @@ class execution extends control
|
||||
/**
|
||||
* Import stories by plan.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $planID
|
||||
* @param int $productID
|
||||
* @param int $executionID
|
||||
* @param int $planID
|
||||
* @param int $productID
|
||||
* @param string $fromMethod
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function importPlanStories($executionID, $planID, $productID = 0)
|
||||
public function importPlanStories($executionID, $planID, $productID = 0, $fromMethod = 'story')
|
||||
{
|
||||
$planStories = $planProducts = array();
|
||||
$planStory = $this->loadModel('story')->getPlanStories($planID);
|
||||
@@ -3161,7 +3169,7 @@ class execution extends control
|
||||
$param = "projectID=$executionID";
|
||||
}
|
||||
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, 'story', $param));
|
||||
die(js::locate(helper::createLink($moduleName, 'story', $param), 'parent'));
|
||||
die(js::locate(helper::createLink($moduleName, $fromMethod, $param)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,4 +31,5 @@
|
||||
|
||||
.dropdown-menu a {text-align: left;}
|
||||
.scrollbar-hover {max-height: 2000px; overflow: scroll !important;}
|
||||
.c-type, .c-group {width: 150px !important; overflow: unset; display: "";}
|
||||
.c-type, .c-group {width: 150px !important; overflow: unset;}
|
||||
.c-type {margin-left: 0px !important;}
|
||||
|
||||
@@ -219,7 +219,12 @@ function renderHeaderCol($col, col, $header, kanban)
|
||||
if(!$col.children('.actions').length)
|
||||
{
|
||||
var $actions = $('<div class="actions" />');
|
||||
if(col.type === 'backlog' || col.type === 'wait' || col.type == 'unconfirmed')
|
||||
var printStoryButton = printTaskButton = printBugButton = false;
|
||||
if(priv.canCreateStory || priv.canBatchCreateStory || priv.canLinkStory || priv.canLinkStoryByPlane) printStoryButton = true;
|
||||
if(priv.canCreateTask || priv.canBatchCreateTask) printTaskButton = true;
|
||||
if(priv.canCreateBug || priv.canBatchCreateBug) printBugButton = true;
|
||||
|
||||
if((col.type === 'backlog' && printStoryButton) || (col.type === 'wait' && printTaskButton) || (col.type == 'unconfirmed' && printBugButton))
|
||||
{
|
||||
$actions.append([
|
||||
'<a data-contextmenu="columnCreate" data-type="' + col.type + '" data-kanban="' + kanban.id + '" data-parent="' + (col.parentType || '') + '" class="text-primary">',
|
||||
@@ -227,11 +232,12 @@ function renderHeaderCol($col, col, $header, kanban)
|
||||
'</a>'
|
||||
].join(''));
|
||||
}
|
||||
|
||||
$actions.append([
|
||||
'<a data-contextmenu="column" data-type="' + col.type + '" data-kanban="' + kanban.id + '" data-parent="' + (col.parentType || '') + '">',
|
||||
'<i class="icon icon-ellipsis-v"></i>',
|
||||
'</a>'
|
||||
].join(''));
|
||||
'<a data-contextmenu="column" data-type="' + col.type + '" data-kanban="' + kanban.id + '" data-parent="' + (col.parentType || '') + '">',
|
||||
'<i class="icon icon-ellipsis-v"></i>',
|
||||
'</a>'
|
||||
].join(''));
|
||||
$actions.appendTo($col);
|
||||
}
|
||||
}
|
||||
@@ -491,8 +497,8 @@ function createColumnMenu(options)
|
||||
var kanbanID = options.kanban;
|
||||
|
||||
var items = [];
|
||||
if(priv.hasEditName) items.push({label: executionLang.editName, url: $.createLink('kanban', 'setColumn', 'col=' + col.columnID + '&executionID=' + executionID), className: 'iframe'})
|
||||
if(priv.hasSetWIP) items.push({label: executionLang.setWIP, url: $.createLink('kanban', 'setWIP', 'col=' + col.columnID + '&executionID=' + executionID), className: 'iframe'})
|
||||
if(priv.hasEditName) items.push({label: executionLang.editName, url: $.createLink('kanban', 'setColumn', 'col=' + col.columnID + '&executionID=' + executionID), className: 'iframe', attrs: {'data-width': '500px'}})
|
||||
if(priv.hasSetWIP) items.push({label: executionLang.setWIP, url: $.createLink('kanban', 'setWIP', 'col=' + col.columnID + '&executionID=' + executionID), className: 'iframe', attrs: {'data-width': '500px'}})
|
||||
items.push({label: executionLang.sortColumn, items: ['按ID倒序', '按ID顺序'], className: 'iframe', onClick: handleSortColCards})
|
||||
return items;
|
||||
}
|
||||
@@ -509,20 +515,20 @@ function createColumnCreateMenu(options)
|
||||
|
||||
if(col.laneType == 'story')
|
||||
{
|
||||
if(priv.canCreateStory) items.push({label: storyLang.create, url: $.createLink('story', 'create', 'productID=' + productID)});
|
||||
if(priv.canBatchCreateStory) items.push({label: storyLang.batchCreate, url: $.createLink('story', 'batchcreate', 'productID=' + productID)});
|
||||
if(priv.canLinkStory) items.push({label: executionLang.linkStory, url: $.createLink('execution', 'linkStory', 'executionID=' + executionID)});
|
||||
if(priv.canCreateStory) items.push({label: storyLang.create, url: $.createLink('story', 'create', 'productID=' + productID, '', true), className: 'iframe'});
|
||||
if(priv.canBatchCreateStory) items.push({label: storyLang.batchCreate, url: $.createLink('story', 'batchcreate', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&executionID=' + executionID, '', true), className: 'iframe'});
|
||||
if(priv.canLinkStory) items.push({label: executionLang.linkStory, url: $.createLink('execution', 'linkStory', 'executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-width': '85%'}});
|
||||
if(priv.canLinkStoryByPlane) items.push({label: executionLang.linkStoryByPlan, url: '#linkStoryByPlan', 'attrs' : {'data-toggle': 'modal'}});
|
||||
}
|
||||
else if(col.laneType == 'bug')
|
||||
{
|
||||
if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=executionID=' + executionID)});
|
||||
if(priv.canBatchCreateBug) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID)});
|
||||
if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=executionID=' + executionID, '', true), className: 'iframe'});
|
||||
if(priv.canBatchCreateBug) items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID, '', true), className: 'iframe'});
|
||||
}
|
||||
else
|
||||
{
|
||||
if(priv.canCreateTask) items.push({label: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID)});
|
||||
if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID)});
|
||||
if(priv.canCreateTask) items.push({label: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID, '', true), className: 'iframe'});
|
||||
if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID, '', true), className: 'iframe'});
|
||||
}
|
||||
return items;
|
||||
}
|
||||
@@ -687,9 +693,9 @@ $(function()
|
||||
}
|
||||
|
||||
/* Init iframe modals */
|
||||
$(document).on('click', '.iframe', function(event)
|
||||
$(document).on('click', '#kanbans .iframe,.contextmenu-menu .iframe', function(event)
|
||||
{
|
||||
$(this).modalTrigger({show: true, width: '500px'});
|
||||
$(this).modalTrigger({show: true});
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
@@ -720,31 +726,15 @@ $(function()
|
||||
var planID = $('#plan').val();
|
||||
if(planID)
|
||||
{
|
||||
parent.location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID);
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban');
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/**
|
||||
* Hide group menu.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function hideGroupMenu()
|
||||
{
|
||||
var type = $('#type').val();
|
||||
if(type == 'all') $('.c-group').hide();
|
||||
}
|
||||
|
||||
$('#type').change(function()
|
||||
{
|
||||
var type = $('#type').val();
|
||||
if(type == 'all')
|
||||
{
|
||||
$('.c-group').hide();
|
||||
}
|
||||
else
|
||||
if(type != 'all')
|
||||
{
|
||||
$('.c-group').show();
|
||||
$.get(createLink('execution', 'ajaxGetGroup', 'type=' + type), function(data)
|
||||
|
||||
@@ -13,12 +13,13 @@
|
||||
<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, $browseType, 'class="form-control chosen" data-max_drop_width="215"');?>
|
||||
</div>
|
||||
<?php if($browseType != 'all'):?>
|
||||
<div class="input-control space c-group">
|
||||
<?php echo html::select('group', $lang->kanban->group->$browseType, $groupBy, 'class="form-control chosen" data-max_drop_width="215"');?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php
|
||||
@@ -62,22 +63,22 @@
|
||||
$canCreateStory = ($productID and common::hasPriv('story', 'create'));
|
||||
$canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate'));
|
||||
$canLinkStory = ($productID and common::hasPriv('execution', 'linkStory'));
|
||||
$canLinkStoryByPlane = ($productID and common::hasPriv('execution', 'story'));
|
||||
$canLinkStoryByPlane = ($productID and common::hasPriv('execution', 'importplanstories'));
|
||||
?>
|
||||
<?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>
|
||||
<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>';?>
|
||||
<?php if($canLinkStory) echo '<li>' . html::a(helper::createLink('execution', 'linkStory', "execution=$execution->id", ''), $lang->execution->linkStory, '', "data-app='execution'") . '</li>';?>
|
||||
<?php if($canCreateStory) echo '<li>' . html::a(helper::createLink('story', 'create', "productID=$productID&branch=0&moduleID=0&story=0&execution=$execution->id", '', true), $lang->story->create, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canBatchCreateStory) echo '<li>' . html::a(helper::createLink('story', 'batchCreate', "productID=$productID&branch=0&moduleID=0&story=0&execution=$execution->id", '', true), $lang->story->batchCreate, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canLinkStory) echo '<li>' . html::a(helper::createLink('execution', 'linkStory', "execution=$execution->id", '', true), $lang->execution->linkStory, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canLinkStoryByPlane) echo '<li>' . html::a('#linkStoryByPlan', $lang->execution->linkStoryByPlan, '', 'data-toggle="modal"') . '</li>';?>
|
||||
<?php if(($canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlane) and ($canCreateTask or $canBatchCreateTask)) echo '<li class="divider"></li>';?>
|
||||
<?php if($canCreateTask) echo '<li>' . html::a(helper::createLink('task', 'create', "execution=$execution->id"), $lang->task->create) . '</li>';?>
|
||||
<?php if($canBatchCreateTask) echo '<li>' . html::a(helper::createLink('task', 'batchCreate', "execution=$execution->id"), $lang->task->batchCreate) . '</li>';?>
|
||||
<?php if($canCreateTask) echo '<li>' . html::a(helper::createLink('task', 'create', "execution=$execution->id", '', true), $lang->task->create, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canBatchCreateTask) echo '<li>' . html::a(helper::createLink('task', 'batchCreate', "execution=$execution->id", '', true), $lang->task->batchCreate, '', "class='iframe'") . '</li>';?>
|
||||
<?php if(($canCreateTask or $canBatchCreateTask) and ($canCreateBug or $canBatchCreateBug)) echo '<li class="divider"></li>';?>
|
||||
<?php if($canCreateBug) echo '<li>' . html::a(helper::createLink('bug', 'create', "productID=$productID&branch=0&extra=execution=$execution->id"), $lang->task->create, '', "data-app='execution'") . '</li>';?>
|
||||
<?php if($canBatchCreateBug) echo '<li>' . html::a(helper::createLink('bug', 'batchCreate', "execution=$execution->id"), $lang->task->batchCreate, '', "data-app='execution'") . '</li>';?>
|
||||
<?php if($canCreateBug) echo '<li>' . html::a(helper::createLink('bug', 'create', "productID=$productID&branch=0&extra=executionID=$execution->id", '', true), $lang->bug->create, '', "class='iframe'") . '</li>';?>
|
||||
<?php if($canBatchCreateBug) echo '<li>' . html::a(helper::createLink('bug', 'batchCreate', "productID=$productID&branch=0&executionID=$execution->id", '', true), $lang->bug->batchCreate, '', "class='iframe'") . '</li>';?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -117,6 +118,7 @@
|
||||
<?php js::set('kanbanGroup', $kanbanGroup);?>
|
||||
<?php js::set('kanbanList', array_keys($kanbanGroup));?>
|
||||
<?php js::set('browseType', $browseType);?>
|
||||
<?php js::set('groupBy', $groupBy);?>
|
||||
<?php
|
||||
js::set('priv',
|
||||
array(
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
$lang->kanban = new stdClass();
|
||||
|
||||
$lang->kanban->type = array();
|
||||
$lang->kanban->type['all'] = "All KanBan";
|
||||
$lang->kanban->type['story'] = "Story KanBan";
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
$lang->kanban = new stdClass();
|
||||
|
||||
$lang->kanban->type = array();
|
||||
$lang->kanban->type['all'] = "综合看板";
|
||||
$lang->kanban->type['story'] = "{$lang->SRCommon}看板";
|
||||
@@ -44,7 +42,7 @@ $lang->kanban->noLimit = '不限制∞';
|
||||
$lang->kanban->setLane = '泳道设置';
|
||||
$lang->kanban->laneName = '泳道名称';
|
||||
$lang->kanban->laneColor = '泳道颜色';
|
||||
$lang->kanban->setLaneColumn = '看板列设置';
|
||||
$lang->kanban->setColumn = '看板列设置';
|
||||
$lang->kanban->columnName = '看板列名称';
|
||||
$lang->kanban->columnColor = '看板列颜色';
|
||||
$lang->kanban->noColumnUniqueName = '看板列名称已存在';
|
||||
|
||||
+31
-24
@@ -17,7 +17,7 @@ class kanbanModel extends model
|
||||
* Get Kanban by execution id.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param string $objectType all|story|bug|task
|
||||
* @param string $browseType all|story|bug|task
|
||||
* @param string $groupBy
|
||||
* @access public
|
||||
* @return array
|
||||
@@ -65,13 +65,13 @@ class kanbanModel extends model
|
||||
{
|
||||
$laneData = array();
|
||||
$columnData = array();
|
||||
$laneType = $lane->type;
|
||||
$laneType = $groupBy == 'default' ? $lane->type : $lane->groupby;
|
||||
|
||||
$laneData['id'] = $laneType;
|
||||
$laneData['id'] = $groupBy == 'default' ? $lane->type : $lane->groupby . '-' . $lane->extra;
|
||||
$laneData['name'] = $lane->name;
|
||||
$laneData['color'] = $lane->color;
|
||||
$laneData['order'] = $lane->order;
|
||||
$laneData['defaultCardType'] = $laneType;
|
||||
$laneData['defaultCardType'] = $lane->type;
|
||||
|
||||
foreach($columns[$laneID] as $columnID => $column)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ class kanbanModel extends model
|
||||
$columnData[$column->id]['name'] = $column->name;
|
||||
$columnData[$column->id]['color'] = $column->color;
|
||||
$columnData[$column->id]['limit'] = $column->limit;
|
||||
$columnData[$column->id]['laneType'] = $laneType;
|
||||
$columnData[$column->id]['laneType'] = $lane->type;
|
||||
$columnData[$column->id]['asParent'] = $column->parent == -1 ? true : false;
|
||||
|
||||
if($column->parent > 0)
|
||||
@@ -94,18 +94,18 @@ class kanbanModel extends model
|
||||
foreach($cardIdList as $cardID)
|
||||
{
|
||||
$cardData = array();
|
||||
$objects = zget($objectGroup, $laneType, array());
|
||||
$objects = zget($objectGroup, $lane->type, array());
|
||||
$object = zget($objects, $cardID, array());
|
||||
|
||||
$cardData['id'] = $object->id;
|
||||
$cardData['order'] = $cardOrder;
|
||||
$cardData['pri'] = $object->pri ? $object->pri : '';
|
||||
$cardData['estimate'] = $laneType == 'bug' ? '' : $object->estimate;
|
||||
$cardData['estimate'] = $lane->type == 'bug' ? '' : $object->estimate;
|
||||
$cardData['assignedTo'] = $object->assignedTo;
|
||||
$cardData['deadline'] = $laneType == 'task' ? $object->deadline : '';
|
||||
$cardData['severity'] = $laneType == 'bug' ? $object->severity : '';
|
||||
$cardData['deadline'] = $lane->type == 'task' ? $object->deadline : '';
|
||||
$cardData['severity'] = $lane->type == 'bug' ? $object->severity : '';
|
||||
|
||||
if($laneType == 'task')
|
||||
if($lane->type == 'task')
|
||||
{
|
||||
$cardData['name'] = $object->name;
|
||||
}
|
||||
@@ -114,9 +114,9 @@ class kanbanModel extends model
|
||||
$cardData['title'] = $object->title;
|
||||
}
|
||||
|
||||
if($laneType == 'story') $cardData['menus'] = $storyCardMenu[$object->id];
|
||||
if($laneType == 'bug') $cardData['menus'] = $bugCardMenu[$object->id];
|
||||
if($laneType == 'task') $cardData['menus'] = $taskCardMenu[$object->id];
|
||||
if($lane->type == 'story') $cardData['menus'] = $storyCardMenu[$object->id];
|
||||
if($lane->type == 'bug') $cardData['menus'] = $bugCardMenu[$object->id];
|
||||
if($lane->type == 'task') $cardData['menus'] = $taskCardMenu[$object->id];
|
||||
|
||||
$laneData['cards'][$column->type][] = $cardData;
|
||||
$cardOrder ++;
|
||||
@@ -127,7 +127,7 @@ class kanbanModel extends model
|
||||
$kanbanGroup[$laneType]['id'] = $laneType;
|
||||
$kanbanGroup[$laneType]['columns'] = array_values($columnData);
|
||||
$kanbanGroup[$laneType]['lanes'][] = $laneData;
|
||||
$kanbanGroup[$laneType]['defaultCardType'] = $laneType;
|
||||
$kanbanGroup[$laneType]['defaultCardType'] = $lane->type;
|
||||
}
|
||||
|
||||
return $kanbanGroup;
|
||||
@@ -211,7 +211,8 @@ class kanbanModel extends model
|
||||
$lane = new stdClass();
|
||||
$lane->execution = $executionID;
|
||||
$lane->type = $type;
|
||||
$lane->extra = $groupBy;
|
||||
$lane->groupby = $groupBy;
|
||||
$lane->extra = $groupKey;
|
||||
$lane->name = $laneName;
|
||||
$lane->color = '#7ec5ff';
|
||||
$lane->order = $laneOrder;
|
||||
@@ -309,7 +310,7 @@ class kanbanModel extends model
|
||||
{
|
||||
$data->cards .= $bugID . ',';
|
||||
}
|
||||
elseif($bug->status == $bugStatus)
|
||||
elseif(strpos(',unconfirmed,confirmed,', $colType) === false and $bug->status == $bugStatus)
|
||||
{
|
||||
$data->cards .= $bugID . ',';
|
||||
}
|
||||
@@ -370,16 +371,18 @@ class kanbanModel extends model
|
||||
$stories = $this->loadModel('story')->getExecutionStories($executionID);
|
||||
foreach($stories as $storyID => $story)
|
||||
{
|
||||
if($lane->groupby and $story->{$lane->groupby} != $lane->extra) continue;
|
||||
|
||||
foreach($this->config->kanban->storyColumnStageList as $colType => $stage)
|
||||
{
|
||||
if(strpos(',ready,develop,test,', $colType) !== false) continue;
|
||||
if($colType == 'backlog' and $story->stage == $stage and strpos($cardPairs['ready'], ",$storyID,") === false and strpos($cardPairs['backlog'], ",$storyID,") === false)
|
||||
{
|
||||
$cardPairs['backlog'] .= empty($cardPairs['backlog']) ? ',' . $storyID . ',' : $storyID . ',';
|
||||
$cardPairs['backlog'] = empty($cardPairs['backlog']) ? ",$storyID," : ",$storyID" . $cardPairs['backlog'];
|
||||
}
|
||||
elseif($story->stage == $stage and strpos($cardPairs[$colType], ",$storyID,") === false)
|
||||
{
|
||||
$cardPairs[$colType] .= empty($cardPairs[$colType]) ? ',' . $storyID . ',' : $storyID . ',';
|
||||
$cardPairs[$colType] = empty($cardPairs[$colType]) ? ",$storyID," : ",$storyID" . $cardPairs[$colType];
|
||||
}
|
||||
elseif($story->stage != $stage and strpos($cardPairs[$colType], ",$storyID,") !== false)
|
||||
{
|
||||
@@ -393,24 +396,26 @@ class kanbanModel extends model
|
||||
$bugs = $this->loadModel('bug')->getExecutionBugs($executionID);
|
||||
foreach($bugs as $bugID => $bug)
|
||||
{
|
||||
if($lane->groupby and $bug->{$lane->groupby} != $lane->extra) continue;
|
||||
|
||||
foreach($this->config->kanban->bugColumnStatusList as $colType => $status)
|
||||
{
|
||||
if(strpos(',resolving,fixing,test,testing,tested,', $colType) !== false) continue;
|
||||
if($colType == 'unconfirmed' and $bug->status == $status and $bug->confirmed == 0 and strpos($cardPairs['unconfirmed'], ",$bugID,") === false and strpos($cardPairs['fixing'], ",$bugID,") === false)
|
||||
{
|
||||
$cardPairs['unconfirmed'] .= empty($cardPairs['unconfirmed']) ? ',' . $bugID . ',' : $bugID . ',';
|
||||
$cardPairs['unconfirmed'] = empty($cardPairs['unconfirmed']) ? ",$bugID," : ",$bugID" . $cardPairs['unconfirmed'];
|
||||
}
|
||||
elseif($colType == 'confirmed' and $bug->status == $status and $bug->confirmed == 1 and strpos($cardPairs['confirmed'], ",$bugID,") === false and strpos($cardPairs['fixing'], ",$bugID,") === false)
|
||||
{
|
||||
$cardPairs['confirmed'] .= empty($cardPairs['confirmed']) ? ',' . $bugID . ',' : $bugID . ',';
|
||||
$cardPairs['confirmed'] = empty($cardPairs['confirmed']) ? ",$bugID," : ",$bugID" . $cardPairs['confirmed'];
|
||||
}
|
||||
elseif($colType == 'fixed' and $bug->status == $status and strpos($cardPairs['fixed'], ",$bugID,") === false and strpos($cardPairs['testing'], ",$bugID,") === false and strpos($cardPairs['tested'], ",$bugID,") === false)
|
||||
{
|
||||
$cardPairs['confirmed'] .= empty($cardPairs['confirmed']) ? ',' . $bugID . ',' : $bugID . ',';
|
||||
$cardPairs['confirmed'] = empty($cardPairs['confirmed']) ? ",$bugID," : ",$bugID" . $cardPairs['confirmed'];
|
||||
}
|
||||
elseif($bug->status == $status and strpos($cardPairs[$colType], ",$bugID,") === false)
|
||||
elseif($bug->status == 'closed' and strpos($cardPairs[$colType], ",$bugID,") === false)
|
||||
{
|
||||
$cardPairs[$colType] .= empty($cardPairs[$colType]) ? ',' . $bugID . ',' : $bugID . ',';
|
||||
$cardPairs[$colType] = empty($cardPairs[$colType]) ? ",$bugID," : ",$bugID". $cardPairs[$colType];
|
||||
}
|
||||
elseif($bug->status != $status and strpos($cardPairs[$colType], ",$bugID,") !== false)
|
||||
{
|
||||
@@ -424,12 +429,14 @@ class kanbanModel extends model
|
||||
$tasks = $this->loadModel('execution')->getKanbanTasks($executionID);
|
||||
foreach($tasks as $taskID => $task)
|
||||
{
|
||||
if($lane->groupby and $task->{$lane->groupby} != $lane->extra) continue;
|
||||
|
||||
foreach($this->config->kanban->taskColumnStatusList as $colType => $status)
|
||||
{
|
||||
if($colType == 'develop') continue;
|
||||
if($task->status == $status and strpos($cardPairs[$colType], ",$taskID,") === false)
|
||||
{
|
||||
$cardPairs[$colType] .= empty($cardPairs[$colType]) ? ',' . $taskID . ',' : $taskID . ',';
|
||||
$cardPairs[$colType] = empty($cardPairs[$colType]) ? ",$taskID," : ",$taskID". $cardPairs[$colType];
|
||||
}
|
||||
elseif($task->status != $status and strpos($cardPairs[$colType], ",$taskID,") !== false)
|
||||
{
|
||||
|
||||
@@ -302,8 +302,8 @@ class task extends control
|
||||
/* Return task id list when call the API. */
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $taskIDList));
|
||||
|
||||
/* Locate the browser. */
|
||||
if(!empty($iframe)) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
/* If link from no head then reload. */
|
||||
if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $taskLink));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user