* Finish task #53668.
This commit is contained in:
@@ -961,27 +961,35 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car
|
||||
/* Story lane. */
|
||||
if(cardType == 'story')
|
||||
{
|
||||
if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
|
||||
if(toColType == 'closed' && priv.canCloseStory)
|
||||
{
|
||||
bootbox.alert(executionLang.storyDragError);
|
||||
return false;
|
||||
var link = createLink('story', 'close', 'storyID=' + objectID, '', true);
|
||||
showIframe = true;
|
||||
}
|
||||
|
||||
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy + '®ionID=' + regionID+ '&orderBy=' + orderBy );
|
||||
$.ajax(
|
||||
else
|
||||
{
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
url: link,
|
||||
success: function(data)
|
||||
if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
|
||||
{
|
||||
updateRegion(regionID, data[regionID]);
|
||||
},
|
||||
error: function(xhr, status, error)
|
||||
{
|
||||
showErrorMessager(error || lang.timeout);
|
||||
bootbox.alert(executionLang.storyDragError);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy + '®ionID=' + regionID+ '&orderBy=' + orderBy );
|
||||
$.ajax(
|
||||
{
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
url: link,
|
||||
success: function(data)
|
||||
{
|
||||
updateRegion(regionID, data[regionID]);
|
||||
},
|
||||
error: function(xhr, status, error)
|
||||
{
|
||||
showErrorMessager(error || lang.timeout);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if(showIframe)
|
||||
|
||||
@@ -687,28 +687,36 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car
|
||||
/* Story lane. */
|
||||
if(cardType == 'story')
|
||||
{
|
||||
if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
|
||||
if(toColType == 'closed' && priv.canCloseStory)
|
||||
{
|
||||
bootbox.alert(executionLang.storyDragError);
|
||||
return false;
|
||||
var link = createLink('story', 'close', 'storyID=' + objectID, '', true);
|
||||
showIframe = true;
|
||||
}
|
||||
|
||||
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy);
|
||||
$.get(link, function(data)
|
||||
else
|
||||
{
|
||||
if(data)
|
||||
if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
|
||||
{
|
||||
kanbanGroup = $.parseJSON(data);
|
||||
if(groupBy == 'default')
|
||||
{
|
||||
updateKanban('story', kanbanGroup.story);
|
||||
}
|
||||
else
|
||||
{
|
||||
updateKanban(browseType, kanbanGroup[groupBy]);
|
||||
}
|
||||
bootbox.alert(executionLang.storyDragError);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy);
|
||||
$.get(link, function(data)
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
kanbanGroup = $.parseJSON(data);
|
||||
if(groupBy == 'default')
|
||||
{
|
||||
updateKanban('story', kanbanGroup.story);
|
||||
}
|
||||
else
|
||||
{
|
||||
updateKanban(browseType, kanbanGroup[groupBy]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if(showIframe)
|
||||
|
||||
@@ -105,6 +105,7 @@ js::set('priv',
|
||||
'canEditStory' => common::hasPriv('story', 'edit'),
|
||||
'canDeleteStory' => common::hasPriv('story', 'delete'),
|
||||
'canChangeStory' => common::hasPriv('story', 'change'),
|
||||
'canCloseStory' => common::hasPriv('story', 'close'),
|
||||
'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -193,7 +193,8 @@ js::set('priv',
|
||||
'canStartTask' => common::hasPriv('task', 'start'),
|
||||
'canAssignBug' => common::hasPriv('bug', 'assignto'),
|
||||
'canConfirmBug' => common::hasPriv('bug', 'confirmBug'),
|
||||
'canActivateBug' => common::hasPriv('bug', 'activate')
|
||||
'canActivateBug' => common::hasPriv('bug', 'activate'),
|
||||
'canCloseStory' => common::hasPriv('story', 'close')
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -1666,9 +1666,15 @@ class kanban extends control
|
||||
$toColumn = $this->kanban->getColumnByID($toColID);
|
||||
if($toColumn->laneType == 'story' and in_array($toColumn->type, array('tested', 'verified', 'released', 'closed')))
|
||||
{
|
||||
$stage = $toColumn->type;
|
||||
$this->dao->update(TABLE_STORY)->set('stage')->eq($stage)->where('id')->eq($cardID)->exec();
|
||||
$this->dao->update(TABLE_STORYSTAGE)->set('stage')->eq($stage)->where('story')->eq($cardID)->exec();
|
||||
$data = new stdclass();
|
||||
$data->stage = $toColumn->type;
|
||||
if($toColumn->type == 'released')
|
||||
{
|
||||
$fromColumn = $this->kanban->getColumnByID($fromColID);
|
||||
if($fromColumn->type == 'closed') $data->status = 'active';
|
||||
}
|
||||
$this->dao->update(TABLE_STORY)->data($data)->where('id')->eq($cardID)->exec();
|
||||
$this->dao->update(TABLE_STORYSTAGE)->set('stage')->eq($toColumn->type)->where('story')->eq($cardID)->exec();
|
||||
}
|
||||
|
||||
$kanbanGroup = $regionID == 0 ? $this->kanban->getExecutionKanban($executionID, $browseType, $groupBy) : $this->kanban->getRDKanban($executionID, $browseType, $orderBy, $regionID, $groupBy);
|
||||
|
||||
@@ -1351,7 +1351,7 @@ 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')
|
||||
{
|
||||
$this->loadModel('kanban')->updateLane($this->session->execution, 'story', $storyID);
|
||||
$kanbanData = $this->kanban->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all');
|
||||
|
||||
@@ -3042,6 +3042,8 @@ class storyModel extends model
|
||||
public function closeParentRequirement($storyID)
|
||||
{
|
||||
$parentID = $this->dao->select('BID')->from(TABLE_RELATION)->where('AID')->eq($storyID)->fetch();
|
||||
if(empty($parentID)) return;
|
||||
|
||||
$stories = $this->dao->select('t2.id, t2.status')->from(TABLE_RELATION)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t2.id=t1.AID')
|
||||
->where('t1.BType')->eq('requirement')
|
||||
|
||||
Reference in New Issue
Block a user