* Code for task #49888.
This commit is contained in:
@@ -322,6 +322,28 @@ class bug extends control
|
||||
if($this->app->tab == 'execution')
|
||||
{
|
||||
if(isset($output['executionID'])) $this->loadModel('execution')->setMenu($output['executionID']);
|
||||
$execution = $this->dao->findById((int)$output['executionID'])->from(TABLE_EXECUTION)->fetch();
|
||||
if($execution->type == 'kanban')
|
||||
{
|
||||
$this->loadModel('kanban');
|
||||
|
||||
$cardPositions = $this->kanban->getCardPositions($output['executionID'], 'bug', 'unconfirmed');
|
||||
|
||||
$kanbanLanePairs = array();
|
||||
if(isset($output['laneID']))
|
||||
{
|
||||
$lane = $this->kanban->getLaneByID($output['laneID']);
|
||||
$kanbanLanePairs = $this->kanban->getLanePairsByRegion($lane->region, 'bug');
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($cardPositions as $cardPosition) $kanbanLanePairs[$cardPosition->laneID] = $cardPosition->name . ' / ' . $cardPosition->laneName;
|
||||
}
|
||||
|
||||
if($this->post->kanbanLane) $extras = 'laneID=' . "{$this->post->kanbanLane}" . ",columnID=" . $cardPositions[$this->post->kanbanLane]->columnID . ",executionID=" . $output['executionID'];
|
||||
|
||||
$this->view->kanbanLanePairs = $kanbanLanePairs;
|
||||
}
|
||||
}
|
||||
else if($this->app->tab == 'project')
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ class bugModel extends model
|
||||
->trim('title')
|
||||
->join('openedBuild', ',')
|
||||
->join('mailto', ',')
|
||||
->remove('files, labels,uid,oldTaskID,contactListMenu')
|
||||
->remove('files,labels,uid,oldTaskID,contactListMenu,column,kanbanLane')
|
||||
->get();
|
||||
|
||||
if($bug->execution != 0) $bug->project = $this->dao->select('parent')->from(TABLE_EXECUTION)->where('id')->eq($bug->execution)->fetch('parent');
|
||||
|
||||
@@ -197,6 +197,16 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(isset($kanbanLanePairs)):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->lane;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('kanbanLane', $kanbanLanePairs, '', "class='form control chosen'");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->bug->title;?></th>
|
||||
<td colspan='2'>
|
||||
|
||||
+23
-2
@@ -1083,6 +1083,27 @@ class kanbanModel extends model
|
||||
return $cardGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get object card positions.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @param string $laneType
|
||||
* @param string $columnType
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getCardPositions($kanbanID, $laneType, $columnType)
|
||||
{
|
||||
return $this->dao->select('t1.name as name, t2.id as laneID, t2.name as laneName, t3.id as columnID')
|
||||
->from(TABLE_KANBANREGION)->alias('t1')
|
||||
->leftjoin(TABLE_KANBANLANE)->alias('t2')->on('t1.id=t2.region')
|
||||
->leftjoin(TABLE_KANBANCOLUMN)->alias('t3')->on('t1.id=t3.region')
|
||||
->where('kanban')->eq($kanbanID)
|
||||
->andWhere('t2.type')->eq($laneType)
|
||||
->andWhere('t3.type')->eq($columnType)
|
||||
->fetchAll('laneID');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get imported cards.
|
||||
*
|
||||
@@ -1827,8 +1848,8 @@ class kanbanModel extends model
|
||||
/**
|
||||
* Get lane pairs by region id.
|
||||
*
|
||||
* @param array $regionID
|
||||
* @param string $type all|story|task|bug|common
|
||||
* @param array|int $regionID
|
||||
* @param string $type all|story|task|bug|common
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -62,11 +62,35 @@ class story extends control
|
||||
{
|
||||
$objectID = empty($objectID) ? $this->session->execution : $objectID;
|
||||
$this->execution->setMenu($objectID);
|
||||
$execution = $this->dao->findById((int)$objectID)->from(TABLE_EXECUTION)->fetch();
|
||||
}
|
||||
|
||||
/* Whether there is a object to transfer story, for example feedback. */
|
||||
$extra = str_replace(array(',', ' '), array('&', ''), $extra);
|
||||
parse_str($extra, $output);
|
||||
|
||||
if($execution->type == 'kanban')
|
||||
{
|
||||
$this->loadModel('kanban');
|
||||
|
||||
$cardPositions = $this->kanban->getCardPositions($execution->id, 'story', 'backlog');
|
||||
|
||||
$kanbanLanePairs = array();
|
||||
if($output)
|
||||
{
|
||||
$lane = $this->kanban->getLaneByID($output['laneID']);
|
||||
$kanbanLanePairs = $this->kanban->getLanePairsByRegion($lane->region, 'story');
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($cardPositions as $cardPosition) $kanbanLanePairs[$cardPosition->laneID] = $cardPosition->name . ' / ' . $cardPosition->laneName;
|
||||
}
|
||||
|
||||
if($this->post->kanbanLane) $extra = 'laneID=' . "{$this->post->kanbanLane}" . "&columnID=" . $cardPositions[$this->post->kanbanLane]->columnID;
|
||||
|
||||
$this->view->kanbanLanePairs = $kanbanLanePairs;
|
||||
}
|
||||
|
||||
foreach($output as $paramKey => $paramValue)
|
||||
{
|
||||
if(isset($this->config->story->fromObjects[$paramKey]))
|
||||
@@ -392,11 +416,26 @@ class story extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
if($execution->type == 'kanban')
|
||||
{
|
||||
$this->loadModel('kanban');
|
||||
|
||||
$cardPositions = $this->kanban->getCardPositions($executionID, 'story', 'backlog');
|
||||
|
||||
$kanbanLanePairs = array();
|
||||
|
||||
foreach($cardPositions as $cardPosition) $kanbanLanePairs[$cardPosition->laneID] = $cardPosition->name . ' / ' . $cardPosition->laneName;
|
||||
|
||||
$this->view->kanbanLanePairs = $kanbanLanePairs;
|
||||
}
|
||||
|
||||
$this->execution->setMenu($executionID);
|
||||
$this->app->rawModule = 'execution';
|
||||
$this->lang->navGroup->story = 'execution';
|
||||
}
|
||||
$this->view->execution = $execution;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -217,7 +217,7 @@ class storyModel extends model
|
||||
->setIF($bugID > 0, 'fromBug', $bugID)
|
||||
->join('mailto', ',')
|
||||
->stripTags($this->config->story->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('files,labels,reviewer,needNotReview,newStory,uid,contactListMenu,URS')
|
||||
->remove('files,labels,reviewer,needNotReview,newStory,uid,contactListMenu,URS,column,kanbanLane')
|
||||
->get();
|
||||
|
||||
/* Check repeat story. */
|
||||
@@ -286,6 +286,7 @@ class storyModel extends model
|
||||
if($this->config->systemMode == 'new' and $executionID != $this->session->project) $this->linkStory($this->session->project, $this->post->product, $storyID);
|
||||
|
||||
$this->loadModel('kanban');
|
||||
|
||||
if(isset($output['laneID']) and isset($output['columnID'])) $this->kanban->addKanbanCell($executionID, $output['laneID'], $output['columnID'], 'story', $storyID);
|
||||
if(!isset($output['laneID']) or !isset($output['columnID'])) $this->kanban->updateLane($executionID, 'story');
|
||||
}
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
<?php if(!isonlybody()):?>
|
||||
<th class='c-plan<?php echo zget($visibleFields, 'plan', ' hidden') . zget($requiredFields, 'plan', '', ' required');?>'><?php echo $lang->story->plan;?></th>
|
||||
<?php endif;?>
|
||||
<?php if(isset($kanbanLanePairs)):?>
|
||||
<th class='c-lane'><?php echo $lang->kanbancard->lane;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-name required has-btn'><?php echo $lang->story->title;?></th>
|
||||
<th class='c-spec<?php echo zget($visibleFields, 'spec', ' hidden') . zget($requiredFields, 'spec', '', ' required');?>'><?php echo $lang->story->spec;?></th>
|
||||
<th class='c-source<?php echo zget($visibleFields, 'source', ' hidden') . zget($requiredFields, 'source', '', ' required');?>'><?php echo $lang->story->source;?></th>
|
||||
@@ -71,6 +74,9 @@
|
||||
<?php if(!isonlybody()):?>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>' style='overflow:visible'><?php echo html::select('plan[$id]', $plans, $planID, "class='form-control chosen'");?></td>
|
||||
<?php endif;?>
|
||||
<?php if(isset($kanbanLanePairs)):?>
|
||||
<td class='text-left'><?php echo html::select('kanbanLanes[$id]', $kanbanLanePairs, '', "class='form-control chosen' id='lane_\$id'");?>
|
||||
<?php endif;?>
|
||||
<td style='overflow:visible'>
|
||||
<div class="input-group">
|
||||
<div class="input-control has-icon-right">
|
||||
|
||||
@@ -155,9 +155,9 @@
|
||||
<div class='input-group' id='moduleIdBox'>
|
||||
<div class="input-group-addon"><?php echo $lang->story->parent;?></div>
|
||||
<?php echo html::select('parent', $stories, '', "class='form-control chosen'");?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->parent;?></th>
|
||||
@@ -165,6 +165,12 @@
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php if (isset($kanbanLanePairs)):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->lane;?>
|
||||
<td colspan="4"><?php echo html::select('kanbanLane', $kanbanLanePairs, '', "class='form-control chosen'")?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->title;?></th>
|
||||
<td colspan="4">
|
||||
|
||||
@@ -86,6 +86,32 @@ class task extends control
|
||||
$execution = $this->execution->getById($executionID);
|
||||
$taskLink = $this->createLink('execution', 'browse', "executionID=$executionID&tab=task");
|
||||
|
||||
if($execution->type == 'kanban')
|
||||
{
|
||||
$this->loadModel('kanban');
|
||||
|
||||
$cardPositions = $this->kanban->getCardPositions($executionID, 'task', 'wait');
|
||||
|
||||
$kanbanLanePairs = array();
|
||||
if($output)
|
||||
{
|
||||
$lane = $this->kanban->getLaneByID($output['laneID']);
|
||||
$kanbanLanePairs = $this->kanban->getLanePairsByRegion($lane->region, 'task');
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($cardPositions as $cardPosition) $kanbanLanePairs[$cardPosition->laneID] = $cardPosition->name . ' / ' . $cardPosition->laneName;
|
||||
}
|
||||
|
||||
if($this->post->kanbanLane)
|
||||
{
|
||||
$output['laneID'] = $this->post->kanbanLane;
|
||||
$output['columnID'] =$cardPositions[$this->post->kanbanLane]->columnID;
|
||||
}
|
||||
|
||||
$this->view->kanbanLanePairs = $kanbanLanePairs;
|
||||
}
|
||||
|
||||
/* Set menu. */
|
||||
$this->execution->setMenu($execution->id);
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class taskModel extends model
|
||||
->cleanINT('execution,story,module')
|
||||
->stripTags($this->config->task->editor->create['id'], $this->config->allowedTags)
|
||||
->join('mailto', ',')
|
||||
->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync,otherLane,region')
|
||||
->remove('after,files,labels,assignedTo,uid,storyEstimate,storyDesc,storyPri,team,teamEstimate,teamMember,multiple,teams,contactListMenu,selectTestStory,testStory,testPri,testEstStarted,testDeadline,testAssignedTo,testEstimate,sync,otherLane,region,kanbanLane')
|
||||
->add('version', 1)
|
||||
->get();
|
||||
|
||||
|
||||
@@ -139,6 +139,14 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(isset($kanbanLanePairs)):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->kanbancard->lane;?></th>
|
||||
<td colspan='3'>
|
||||
<div class="input group"><?php echo html::select('kanbanLane', $kanbanLanePairs, '', "class='form-control chosen'");?></div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->task->name;?></th>
|
||||
<td colspan='3'>
|
||||
|
||||
Reference in New Issue
Block a user