Merge branch 'sprint/168_sgm_kanban' into 'sprint/168'
* Finish task #43394, #43395, #43396. See merge request easycorp/zentaopms!187
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
function getStoryKanbanDemoData()
|
||||
{
|
||||
return kanbanGroup.story;
|
||||
/* Define kanban columns 定义看板列 */
|
||||
var columns =
|
||||
[
|
||||
@@ -124,6 +123,7 @@ function getStoryKanbanDemoData()
|
||||
columns: 定义看板上的所有列,
|
||||
lanes: 定义看板上的所有泳道
|
||||
defaultCardType: 看板上的卡片默认类型,例如:'story'(需求) */
|
||||
return kanbanGroup.story;
|
||||
return {id: 'story', columns: columns, lanes: lanes, defaultCardType: 'story'};
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,6 @@ $config->kanban->default->task->name = $lang->task->common;
|
||||
$config->kanban->default->task->color = '#4169e1';
|
||||
$config->kanban->default->task->order = '15';
|
||||
|
||||
$config->kanban->parentColumn = array();
|
||||
$config->kanban->parentColumn['story'] = array('develop', 'test');
|
||||
$config->kanban->parentColumn['bug'] = array('resolving', 'test');
|
||||
$config->kanban->parentColumn['task'] = array('develop');
|
||||
|
||||
$config->kanban->storyColumnStageList = array();
|
||||
$config->kanban->storyColumnStageList['backlog'] = 'projected';
|
||||
$config->kanban->storyColumnStageList['ready'] = 'projected';
|
||||
|
||||
+29
-28
@@ -35,6 +35,12 @@ class kanbanModel extends model
|
||||
->andWhere('lane')->in(array_keys($lanes))
|
||||
->fetchGroup('lane', 'id');
|
||||
|
||||
$parentTypes = $this->dao->select('id, type')->from(TABLE_KANBANCOLUMN)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('lane')->in(array_keys($lanes))
|
||||
->andWhere('parent')->eq(-1)
|
||||
->fetchPairs('id', 'type');
|
||||
|
||||
if($objectType == 'story' or $objectType == 'all') $stories = $this->loadModel('story')->getExecutionStories($executionID);
|
||||
if($objectType == 'bug' or $objectType == 'all') $bugs = $this->loadModel('bug')->getExecutionBugs($executionID);
|
||||
if($objectType == 'task' or $objectType == 'all') $tasks = $this->loadModel('execution')->getKanbanTasks($executionID, "id");
|
||||
@@ -55,49 +61,44 @@ class kanbanModel extends model
|
||||
|
||||
foreach($columns[$laneID] as $colID => $col)
|
||||
{
|
||||
if($col->parent > 0) continue;
|
||||
$columnData[$col->id]['id'] = $lane->type . '-' . $col->type;
|
||||
$columnData[$col->id]['type'] = $col->type;
|
||||
$columnData[$col->id]['name'] = $col->name;
|
||||
$columnData[$col->id]['color'] = $col->color;
|
||||
$columnData[$col->id]['limit'] = $col->limit;
|
||||
$columnData[$col->id]['asParent'] = $col->parent == -1 ? true : false;
|
||||
|
||||
$columnData[$col->id]['id'] = $lane->type . '-' . $col->type;
|
||||
$columnData[$col->id]['type'] = $col->type;
|
||||
$columnData[$col->id]['name'] = $col->name;
|
||||
$columnData[$col->id]['color'] = $col->color;
|
||||
$columnData[$col->id]['limit'] = $col->limit;
|
||||
$columnData[$col->id]['asParent'] = $col->parent == -1 ? true : false;
|
||||
|
||||
unset($columns[$laneID][$colID]);
|
||||
}
|
||||
|
||||
foreach($columns[$laneID] as $colID => $col)
|
||||
{
|
||||
$columnData[$col->parent]['subs'][$col->id]['id'] = $lane->type . '-' . $col->type;
|
||||
$columnData[$col->parent]['subs'][$col->id]['type'] = $col->type;
|
||||
$columnData[$col->parent]['subs'][$col->id]['name'] = $col->name;
|
||||
$columnData[$col->parent]['subs'][$col->id]['color'] = $col->color;
|
||||
$columnData[$col->parent]['subs'][$col->id]['limit'] = $col->limit;
|
||||
$columnData[$col->parent]['subs'][$col->id]['parentType'] = $columnData[$col->parent]['type'];
|
||||
if($col->parent > 0)
|
||||
{
|
||||
$columnData[$col->id]['parentType'] = zget($parentTypes, $col->parent, '');
|
||||
}
|
||||
|
||||
$cardIdList = array_filter(explode(',', $col->cards));
|
||||
$cardOrder = 1;
|
||||
$item = array();
|
||||
foreach($cardIdList as $cardID)
|
||||
{
|
||||
if($lane->type == 'story') $object = zget($stories, $cardID, array());
|
||||
if($lane->type == 'task') $object = zget($tasks, $cardID, array());
|
||||
if($lane->type == 'bug') $object = zget($bugs, $cardID, array());
|
||||
|
||||
$laneData['cards'][$col->type][$object->id]['id'] = $object->id;
|
||||
$laneData['cards'][$col->type][$object->id]['order'] = $cardOrder;
|
||||
$laneData['cards'][$col->type][$object->id]['pri'] = $object->pri;
|
||||
$laneData['cards'][$col->type][$object->id]['estimate'] = $lane->type == 'bug' ? '' : $object->estimate;
|
||||
$laneData['cards'][$col->type][$object->id]['assignedTo'] = $object->assignedTo;
|
||||
$laneData['cards'][$col->type][$object->id]['deadline'] = $lane->type == 'task' ? $object->deadline : '';
|
||||
$item['id'] = $object->id;
|
||||
$item['order'] = $cardOrder;
|
||||
$item['pri'] = $object->pri;
|
||||
$item['estimate'] = $lane->type == 'bug' ? '' : $object->estimate;
|
||||
$item['assignedTo'] = $object->assignedTo;
|
||||
$item['deadline'] = $lane->type == 'task' ? $object->deadline : '';
|
||||
|
||||
$laneData['cards'][$col->type][] = $item;
|
||||
|
||||
$cardOrder ++;
|
||||
}
|
||||
}
|
||||
|
||||
$kanban[$lane->type]['id'] = $lane->type;
|
||||
$kanban[$lane->type]['columns'] = array_values($columnData);
|
||||
$kanban[$lane->type]['lanes'] = $laneData;
|
||||
$kanban[$lane->type]['id'] = $lane->type;
|
||||
$kanban[$lane->type]['columns'] = array_values($columnData);
|
||||
$kanban[$lane->type]['lanes'][] = $laneData;
|
||||
$kanban[$lane->type]['defaultCardType'] = $lane->type;
|
||||
}
|
||||
|
||||
return $kanban;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<form method='post' class="load-indicator main-form form-ajax" target='hiddenwin' onsubmit='return setWIPLimit();'>
|
||||
<table align='center' class='table table-form'>
|
||||
<?php if(!in_array($column->type, $config->kanban->parentColumn[$column->laneType])):?>
|
||||
<?php if($column->parent != -1):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanban->WIPStatus;?></th>
|
||||
<td colspan='2'>
|
||||
|
||||
Reference in New Issue
Block a user