* Finish task #55675.
This commit is contained in:
@@ -2115,8 +2115,10 @@ class execution extends control
|
||||
$this->loadModel('story');
|
||||
|
||||
if(empty($groupBy)) $groupBy = 'default';
|
||||
|
||||
/* Set Session. */
|
||||
$this->session->set('execLaneType', $browseType);
|
||||
$this->session->set('execGroupBy', $groupBy);
|
||||
$this->session->set('storyList', $this->app->getURI(true), 'execution');
|
||||
|
||||
$this->lang->execution->menu = new stdclass();
|
||||
@@ -2853,8 +2855,10 @@ class execution extends control
|
||||
{
|
||||
if($this->app->tab == 'execution' and $object->type == 'kanban')
|
||||
{
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($objectID, $this->session->execLaneType ? $this->session->execLaneType : 'all');
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
|
||||
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($objectID, $execLaneType, 'id_desc', 0, $execGroupBy);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
|
||||
return print(js::closeModal('parent', '', "parent.updateKanban($kanbanData)"));
|
||||
}
|
||||
@@ -3656,10 +3660,11 @@ class execution extends control
|
||||
* @param int $productID
|
||||
* @param string $fromMethod
|
||||
* @param string $extra
|
||||
* @param string $param
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function importPlanStories($executionID, $planID, $productID = 0, $fromMethod = 'story', $extra = '')
|
||||
public function importPlanStories($executionID, $planID, $productID = 0, $fromMethod = 'story', $extra = '', $param = '')
|
||||
{
|
||||
$planStories = $planProducts = array();
|
||||
$planStory = $this->loadModel('story')->getPlanStories($planID);
|
||||
@@ -3687,7 +3692,8 @@ class execution extends control
|
||||
}
|
||||
|
||||
$moduleName = 'execution';
|
||||
$param = "executionID=$executionID";
|
||||
if(empty($param)) $param = "executionID=$executionID";
|
||||
if(!empty($param)) $param = str_replace(array(',', ' '), array('&', ''), $param);
|
||||
if($execution->type == 'project')
|
||||
{
|
||||
$moduleName = 'projectstory';
|
||||
@@ -3700,7 +3706,8 @@ class execution extends control
|
||||
$lang->executionCommon = $lang->execution->kanban;
|
||||
include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php';
|
||||
}
|
||||
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, in_array($execution->type, array('sprint','project')) ? 'story' : 'kanban', $param));
|
||||
|
||||
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, $fromMethod, $param));
|
||||
return print(js::locate(helper::createLink($moduleName, $fromMethod, $param)));
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ function changeKanbanScaleSize(newScaleSize)
|
||||
}
|
||||
else
|
||||
{
|
||||
var kanban = $('#kanban').data('zui.kanban');
|
||||
var kanban = $('#kanban' + executionID).data('zui.kanban');
|
||||
if(!kanban) return;
|
||||
kanban.setOptions({cardsPerRow: newScaleSize, cardHeight: getCardHeight()});
|
||||
}
|
||||
@@ -272,7 +272,7 @@ function createColumnCreateMenu(options)
|
||||
var col = $col.data('col');
|
||||
var items = [];
|
||||
var laneID = col.$kanbanData.lanes[0].id ? col.$kanbanData.lanes[0].id : 0;
|
||||
var regionID = col.$kanbanData.region;
|
||||
var regionID = col.$kanbanData.region == undefined ? 0 : col.$kanbanData.region;
|
||||
|
||||
if(col.type == 'backlog')
|
||||
{
|
||||
@@ -690,8 +690,6 @@ function renderCount($count, count, column)
|
||||
*/
|
||||
function renderHeaderCol($column, column, $header, kanbanData)
|
||||
{
|
||||
if(groupBy != 'default') return;
|
||||
|
||||
/* Render group header. */
|
||||
var privs = kanbanData.actions;
|
||||
var columnPrivs = kanbanData.columns[0].actions;
|
||||
@@ -703,7 +701,7 @@ function renderHeaderCol($column, column, $header, kanbanData)
|
||||
$actions = $column.children('.actions');
|
||||
}
|
||||
|
||||
if(privs.includes('sortGroup'))
|
||||
if(groupBy == 'default' && privs.includes('sortGroup'))
|
||||
{
|
||||
var groups = regions[column.region].groups;
|
||||
if($header.closest('.kanban').data('zui.kanban'))
|
||||
@@ -784,7 +782,8 @@ function updateRegion(regionID, regionData = [])
|
||||
if(!$region.length) return false;
|
||||
if(!regionData) regionData = regions[regionID];
|
||||
|
||||
$region.data('zui.kanban').render(regionData.groups);
|
||||
var data = groupBy == 'default' ? regionData.groups : regionData;
|
||||
$region.data('zui.kanban').render(data);
|
||||
resetRegionHeight('open');
|
||||
return true;
|
||||
}
|
||||
@@ -1053,7 +1052,7 @@ function updateKanban(kanbanData, regionID = 0)
|
||||
setTimeout(function()
|
||||
{
|
||||
$.zui.closeModal();
|
||||
if(regionID)
|
||||
if(regionID && groupBy == 'default')
|
||||
{
|
||||
updateRegion(regionID, kanbanData[regionID]);
|
||||
}
|
||||
@@ -1062,7 +1061,8 @@ function updateKanban(kanbanData, regionID = 0)
|
||||
$('#kanban').children('.region').children("div[id^='kanban']").each(function()
|
||||
{
|
||||
var regionID = $(this).attr('data-id');
|
||||
updateRegion(regionID, kanbanData[regionID]);
|
||||
var data = groupBy == 'default' ? kanbanData[regionID] : kanbanData[groupBy]
|
||||
updateRegion(regionID, data);
|
||||
});
|
||||
}
|
||||
}, 200);
|
||||
@@ -1317,8 +1317,9 @@ $(function()
|
||||
var planID = $('#plan').val();
|
||||
if(planID)
|
||||
{
|
||||
var vars = $('.linkStoryByPlanButton').data('lane') != null ? '&extra=laneID='+ $('.linkStoryByPlanButton').data('lane') + ',columnID=' + $('.linkStoryByPlanButton').data('col') : '';
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban' + vars);
|
||||
var vars = $('.linkStoryByPlanButton').data('lane') != null ? '&extra=laneID='+ $('.linkStoryByPlanButton').data('lane') + ',columnID=' + $('.linkStoryByPlanButton').data('col') : '';
|
||||
var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy;
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban' + vars + param);
|
||||
$.closeModal();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1141,7 +1141,8 @@ $(function()
|
||||
var planID = $('#plan').val();
|
||||
if(planID)
|
||||
{
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban');
|
||||
var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy;
|
||||
location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=taskKanban&extra=' + param);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -232,8 +232,12 @@ js::set('hasTaskButton', $hasTaskButton);
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class='panel' id='kanbanContainer'>
|
||||
<div class='panel-body region'>
|
||||
<div id='kanban' class='kanban'></div>
|
||||
<div class='panel-body'>
|
||||
<div id='kanban'>
|
||||
<div class='region'>
|
||||
<div id='kanban<?php echo $execution->id;?>' data-id='<?php echo $execution->id;?>' class='kanban'></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -1508,9 +1508,11 @@ class kanban extends control
|
||||
if($from == 'RDKanban')
|
||||
{
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
$regionID = $column->region;
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
$regionID = $column->region;
|
||||
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
|
||||
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', $regionID, $execGroupBy);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)"));
|
||||
}
|
||||
@@ -1589,9 +1591,11 @@ class kanban extends control
|
||||
if($from == 'RDKanban')
|
||||
{
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
$regionID = $column->region;
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
$regionID = $column->region;
|
||||
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
|
||||
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', $regionID, $execGroupBy);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)"));
|
||||
}
|
||||
|
||||
+18
-1
@@ -1454,13 +1454,21 @@ class kanbanModel extends model
|
||||
$lanes = $this->getLanes4Group($executionID, $browseType, $groupBy, $cardList);
|
||||
if(empty($lanes)) return array();
|
||||
|
||||
$columns = $this->dao->select('t1.*, t2.`type` as columnType, t2.limit, t2.name as columnName, t2.color')->from(TABLE_KANBANCELL)->alias('t1')
|
||||
$columns = $this->dao->select('t1.*, GROUP_CONCAT(t1.cards) as cards, t2.`type` as columnType, t2.limit, t2.name as columnName, t2.color')->from(TABLE_KANBANCELL)->alias('t1')
|
||||
->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.`column` = t2.id')
|
||||
->leftJoin(TABLE_KANBANLANE)->alias('t3')->on('t2.group = t3.group')
|
||||
->leftJoin(TABLE_KANBANREGION)->alias('t4')->on('t1.kanban = t4.kanban')
|
||||
->where('t1.kanban')->eq($executionID)
|
||||
->andWhere('t1.`type`')->eq($browseType)
|
||||
->andWhere('t3.deleted')->eq(0)
|
||||
->andWhere('t4.deleted')->eq(0)
|
||||
->groupBy('columnType')
|
||||
->orderBy('column_asc')
|
||||
->fetchAll('columnType');
|
||||
|
||||
$cardGroup = array();
|
||||
$actions = array('setColumn', 'setWIP');
|
||||
|
||||
foreach($columns as $column)
|
||||
{
|
||||
if(empty($column->cards)) continue;
|
||||
@@ -1492,6 +1500,14 @@ class kanbanModel extends model
|
||||
if(in_array($column->columnType, array('testing', 'tested'))) $parentColumn = 'test';
|
||||
if(in_array($column->columnType, array('fixing', 'fixed'))) $parentColumn = 'resolving';
|
||||
|
||||
/* Judge column action priv. */
|
||||
$column->actions = array();
|
||||
foreach($actions as $action)
|
||||
{
|
||||
if($this->isClickable($column, $action)) $column->actions[] = $action;
|
||||
}
|
||||
|
||||
|
||||
$columnData[$column->column]['id'] = $column->column;
|
||||
$columnData[$column->column]['type'] = $column->columnType;
|
||||
$columnData[$column->column]['name'] = $column->columnName;
|
||||
@@ -1500,6 +1516,7 @@ class kanbanModel extends model
|
||||
$columnData[$column->column]['laneType'] = $browseType;
|
||||
$columnData[$column->column]['asParent'] = in_array($column->columnType, array('develop', 'test', 'resolving')) ? true : false;
|
||||
$columnData[$column->column]['parentType'] = $parentColumn;
|
||||
$columnData[$column->column]['actions'] = $column->actions;
|
||||
|
||||
$cardOrder = 1;
|
||||
$objects = zget($cardGroup, $column->columnType, array());
|
||||
|
||||
+16
-11
@@ -80,7 +80,7 @@ class story extends control
|
||||
{
|
||||
$this->loadModel('kanban');
|
||||
$regionPairs = $this->kanban->getRegionPairs($execution->id, 0, 'execution');
|
||||
$regionID = isset($output['regionID']) ? $output['regionID'] : key($regionPairs);
|
||||
$regionID = !empty($output['regionID']) ? $output['regionID'] : key($regionPairs);
|
||||
$lanePairs = $this->kanban->getLanePairsByRegion($regionID, 'story');
|
||||
$laneID = isset($output['laneID']) ? $output['laneID'] : key($lanePairs);
|
||||
|
||||
@@ -680,9 +680,9 @@ class story extends control
|
||||
if(isonlybody())
|
||||
{
|
||||
$execution = $this->execution->getByID($this->session->execution);
|
||||
if($this->app->tab == 'execution' and $execution->type == 'kanban' and $kanbanGroup == 'default')
|
||||
if($this->app->tab == 'execution' and $execution->type == 'kanban')
|
||||
{
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
|
||||
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
|
||||
@@ -1052,10 +1052,12 @@ class story extends control
|
||||
if(isonlybody())
|
||||
{
|
||||
$execution = $this->execution->getByID($this->session->execution);
|
||||
if($this->app->tab == 'execution' and $execution->type == 'kanban' and $this->app->tab == 'execution')
|
||||
if($this->app->tab == 'execution' and $execution->type == 'kanban')
|
||||
{
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
|
||||
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
|
||||
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
|
||||
}
|
||||
@@ -1358,8 +1360,10 @@ class story extends control
|
||||
if($this->app->tab == 'execution' and $execution->type == 'kanban')
|
||||
{
|
||||
$this->loadModel('kanban')->updateLane($this->session->execution, 'story', $storyID);
|
||||
$kanbanData = $this->kanban->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
|
||||
$execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default';
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
|
||||
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
|
||||
}
|
||||
@@ -1707,10 +1711,11 @@ class story extends control
|
||||
if(isonlybody())
|
||||
{
|
||||
$execution = $this->execution->getByID($this->session->execution);
|
||||
if($this->app->tab == 'execution' and $execution->type == 'kanban' and $kanbanGroup == 'default')
|
||||
if($this->app->tab == 'execution' and $execution->type == 'kanban')
|
||||
{
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
$execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all';
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $kanbanGroup);
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
|
||||
return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user