Sprint/228 zg tasks and units

This commit is contained in:
曾刚
2022-08-18 07:15:14 +00:00
committed by 王怡栋
parent c586a24d50
commit 3172961404
27 changed files with 315 additions and 73 deletions
+25 -6
View File
@@ -1005,17 +1005,24 @@ class executionModel extends model
}
}
$changes = common::createChanges($oldExecution, $execution);
if($this->post->comment != '' or !empty($changes))
{
$this->loadModel('action');
$actionID = $this->action->create('execution', $executionID, 'Activated', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
/* Update the status of the parent stage. */
if($oldExecution->type == 'stage')
{
$parent = $this->getByID($oldExecution->parent);
if($parent->type == 'stage' and $parent->status == 'closed')
if($parent->type == 'stage' and in_array($parent->status, array('closed', 'wait')))
{
$this->dao->update(TABLE_EXECUTION)->set('status')->eq('doing')->where('id')->eq($parent->id)->exec();
$this->loadModel('action')->create('execution', $parent->id, 'startbychildactivate');
}
}
if(!dao::isError()) return common::createChanges($oldExecution, $execution);
}
/**
@@ -1058,6 +1065,15 @@ class executionModel extends model
if(!dao::isError())
{
$changes = common::createChanges($oldExecution, $execution);
if($this->post->comment != '' or !empty($changes))
{
$this->loadModel('action');
$actionID = $this->action->create('execution', $executionID, 'Closed', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
/* Update the status of the parent stage. */
if($oldExecution->type == 'stage')
{
@@ -1071,12 +1087,15 @@ class executionModel extends model
if($childExecution->status != 'closed') $isClosed = false;
}
if($isClosed) $this->dao->update(TABLE_EXECUTION)->set('status')->eq('closed')->where('id')->eq($parent->id)->exec();
if($isClosed)
{
$this->dao->update(TABLE_EXECUTION)->set('status')->eq('closed')->where('id')->eq($parent->id)->exec();
$this->loadModel('action')->create('execution', $parent->id, 'closebychildclose');
}
}
}
$this->loadModel('score')->create('execution', 'close', $oldExecution);
return common::createChanges($oldExecution, $execution);
}
}
@@ -1411,7 +1430,7 @@ class executionModel extends model
/**
* Get execution stat data.
* @param int $projectID
* @param string $browseType all|undone|wait|doing|suspended|closed|involved|bySearch|review
* @param int $productID