* Finish task #53668.

This commit is contained in:
tianshujie
2022-05-10 17:05:49 +08:00
parent 4e2de99018
commit 5bdb7f521c
7 changed files with 64 additions and 38 deletions
+24 -16
View File
@@ -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 + '&regionID=' + 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 + '&regionID=' + 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)
+25 -17
View File
@@ -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)
+1
View File
@@ -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'),
)
);
+2 -1
View File
@@ -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')
)
);
?>
+9 -3
View File
@@ -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);
+1 -1
View File
@@ -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');
+2
View File
@@ -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')