* Display the sub Lane view kanban.
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,
|
||||
|
||||
@@ -1841,11 +1841,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, $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);
|
||||
|
||||
@@ -663,14 +663,22 @@ $(function()
|
||||
/* Hide group menu. */
|
||||
hideGroupMenu();
|
||||
|
||||
/* Create story kanban 创建需求看板 */
|
||||
if(browseType == 'all' || browseType == 'story') createKanban('story', kanbanGroup.story, commonOptions);
|
||||
if(groupBy == 'default')
|
||||
{
|
||||
/* Create story kanban 创建需求看板 */
|
||||
if(browseType == 'all' || browseType == 'story') createKanban('story', kanbanGroup.story, commonOptions);
|
||||
|
||||
/* Create bug kanban 创建 Bug 看板 */
|
||||
if(browseType == 'all' || browseType == 'bug') createKanban('bug', kanbanGroup.bug, commonOptions);
|
||||
/* Create bug kanban 创建 Bug 看板 */
|
||||
if(browseType == 'all' || browseType == 'bug') createKanban('bug', kanbanGroup.bug, commonOptions);
|
||||
|
||||
/* Create task kanban 创建 任务 看板 */
|
||||
if(browseType == 'all' || browseType == 'task') createKanban('task', kanbanGroup.task, commonOptions);
|
||||
/* Create task kanban 创建 任务 看板 */
|
||||
if(browseType == 'all' || browseType == 'task') createKanban('task', kanbanGroup.task, commonOptions);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Create kanban by group. 分泳道创建看板. */
|
||||
createKanban(browseType, kanbanGroup[groupBy], commonOptions);
|
||||
}
|
||||
|
||||
/* Init iframe modals */
|
||||
$(document).on('click', '.iframe', function(event)
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
<?php js::set('productID', $productID);?>
|
||||
<?php js::set('kanbanGroup', $kanbanGroup);?>
|
||||
<?php js::set('browseType', $browseType);?>
|
||||
<?php js::set('groupBy', $groupBy);?>
|
||||
<?php
|
||||
js::set('priv',
|
||||
array(
|
||||
|
||||
@@ -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
|
||||
@@ -27,8 +27,9 @@ class kanbanModel extends model
|
||||
$lanes = $this->dao->select('*')->from(TABLE_KANBANLANE)
|
||||
->where('execution')->eq($executionID)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF($browseType != 'all')->andWhere('type')->eq($browseType)
|
||||
->beginIF($groupBy != 'default')->andWhere('extra')->eq($groupBy)
|
||||
->beginIF($browseType != 'all')->andWhere('type')->eq($browseType)->fi()
|
||||
->beginIF($groupBy == 'default')->andWhere('groupby')->eq('')->fi()
|
||||
->beginIF($groupBy != 'default')->andWhere('groupby')->eq($groupBy)->fi()
|
||||
->fetchAll('id');
|
||||
|
||||
if(empty($lanes)) return array();
|
||||
@@ -63,13 +64,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)
|
||||
{
|
||||
@@ -79,7 +80,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)
|
||||
@@ -92,18 +93,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;
|
||||
}
|
||||
@@ -112,9 +113,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 ++;
|
||||
@@ -125,7 +126,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;
|
||||
@@ -209,7 +210,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;
|
||||
@@ -368,6 +370,8 @@ 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;
|
||||
@@ -391,6 +395,8 @@ 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;
|
||||
@@ -422,6 +428,8 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user