* [task#130379,doing,1h] Process story to task.

This commit is contained in:
xieqiyu
2024-10-18 13:44:00 +08:00
committed by 胡方舟
parent daf8928814
commit 3e0e2f3a91
3 changed files with 45 additions and 8 deletions
+14 -1
View File
@@ -2053,7 +2053,20 @@ class storyModel extends model
$this->dao->insert(TABLE_TASKSPEC)->data($taskSpec)->autoCheck()->exec();
if(dao::isError()) return false;
if($task->story) $this->setStage($task->story);
if($task->story)
{
$this->setStage($task->story);
if($this->config->edition != 'open')
{
$relation = new stdClass();
$relation->relation = 'generated';
$relation->AID = $task->story;
$relation->AType = 'story';
$relation->BID = $taskID;
$relation->BType = 'task';
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
}
}
$this->action->create('task', $taskID, 'Opened', '');
}
+15 -1
View File
@@ -510,7 +510,21 @@ class taskModel extends model
if(!$taskID) return false;
/* Update Kanban and story stage. */
if(!empty($task->story)) $this->story->setStage($task->story);
if(!empty($task->story))
{
$this->story->setStage($task->story);
if($this->config->edition != 'open')
{
$relation = new stdClass();
$relation->relation = 'generated';
$relation->AID = $task->story;
$relation->AType = 'story';
$relation->BID = $taskID;
$relation->BType = 'task';
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
}
}
$this->updateKanbanForBatchCreate($taskID, $executionID, $laneID, (int)$columnID);
$taskIdList[$taskID] = $taskID;
+16 -6
View File
@@ -10069,16 +10069,26 @@ class upgradeModel extends model
}
/* Process bug transferred to task. */
$bugTransferredToTask = $this->dao->select('id,fromBug')->from(TABLE_TASK)->where('fromBug')->ne(0)->fetchPairs('id');
foreach($bugTransferredToTask as $taskID => $bugID)
$taskList = $this->dao->select('id,story,fromBug')->from(TABLE_TASK)->where('fromBug')->ne(0)->orWhere('story')->ne(0)->fetchAll('id');
foreach($taskList as $taskID => $task)
{
$relation = new stdClass();
$relation->AType = 'bug';
$relation->AID = $bugID;
$relation->relation = 'transferredto';
$relation->BType = 'task';
$relation->BID = $taskID;
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
if(!empty($task->fromBug))
{
$relation->relation = 'transferredto';
$relation->AType = 'bug';
$relation->AID = $task->fromBug;
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
}
if(!empty($task->story))
{
$relation->relation = 'generated';
$relation->AType = 'story';
$relation->AID = $task->story;
$this->dao->replace(TABLE_RELATION)->data($relation)->exec();
}
}
/* Process bug transferred to story. */