* task #731
This commit is contained in:
zhaohaibo
2020-05-19 18:07:44 +08:00
2 changed files with 91 additions and 0 deletions

View File

@@ -2813,6 +2813,11 @@ class storyModel extends model
echo $story->sourceNote;
break;
case 'status':
if(isset($this->config->qcVersion) && $story->storyChanged)
{
print("<span class='status-story status-changed'>{$this->lang->story->storyChanged}</span>");
break;
}
echo "<span class='status-{$story->status}'>";
echo $this->processStatus('story', $story);
echo '</span>';
@@ -2898,6 +2903,12 @@ class storyModel extends model
break;
case 'actions':
$vars = "story={$story->id}";
if(isset($this->config->qcVersion) && $story->storyChanged)
{
common::printIcon('story', 'processStoryChange', "storyID=$story->id", '', 'list', 'search', '', 'iframe', true, '', $this->lang->story->process);
break;
}
common::printIcon('story', 'change', $vars, $story, 'list', 'fork');
common::printIcon('story', 'review', $vars, $story, 'list', 'glasses');
common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true);

View File

@@ -55,6 +55,9 @@ class taskModel extends model
->get();
if($task->type != 'test') $this->post->set('selectTestStory', 0);
/* Record task version. */
if(isset($this->config->qcVersion)) $task->version = 1;
foreach($this->post->assignedTo as $assignedTo)
{
/* When type is affair and has assigned then ignore none. */
@@ -101,6 +104,29 @@ class taskModel extends model
if(dao::isError()) return false;
$taskID = $this->dao->lastInsertID();
/* Mark design version.*/
if(isset($this->config->qcVersion) && $task->design)
{
$design = $this->loadModel('design')->getByID($task->design);
$this->dao->update(TABLE_TASK)->set('designVersion')->eq($design->version)->where('id')->eq($taskID)->exec();
}
if(isset($this->config->qcVersion))
{
$taskSpec = new stdClass();
$taskSpec->task = $taskID;
$taskSpec->version = $task->version;
$taskSpec->name = $task->name;
$taskSpec->estStarted = $task->estStarted;
$taskSpec->deadline = $task->deadline;
$this->dao->insert(TABLE_TASKSPEC)->data($taskSpec)
->autoCheck()
->exec();
if(dao::isError()) return false;
}
if($this->post->story) $this->loadModel('story')->setStage($this->post->story);
if($this->post->selectTestStory)
{
@@ -308,6 +334,9 @@ class taskModel extends model
foreach($data as $i => $task)
{
/* Record task version.*/
if(isset($this->config->qcVersion)) $task->version = 1;
$this->dao->insert(TABLE_TASK)->data($task)
->autoCheck()
->batchCheck($requiredFields, 'notempty')
@@ -317,6 +346,22 @@ class taskModel extends model
if(dao::isError()) die(js::error(dao::getError()));
$taskID = $this->dao->lastInsertID();
if(isset($this->config->qcVersion))
{
$taskSpec = new stdClass();
$taskSpec->task = $taskID;
$taskSpec->version = $task->version;
$taskSpec->name = $task->name;
$taskSpec->estStarted = $task->estStarted;
$taskSpec->deadline = $task->deadline;
$this->dao->insert(TABLE_TASKSPEC)->data($taskSpec)
->autoCheck()
->exec();
if(dao::isError()) die(js::error(dao::getError()));
}
$childTasks .= $taskID . ',';
if($story) $this->story->setStage($task->story);
$actionID = $this->action->create('task', $taskID, 'Opened', '');
@@ -784,6 +829,24 @@ class taskModel extends model
}
}
/* Record task version.*/
if(isset($this->config->qcVersion))
{
if($oldTask->name != $task->name || $oldTask->estStarted != $task->estStarted || $oldTask->deadline != $task->deadline)
{
$task->version = $oldTask->version + 1;
$taskSpec = new stdClass();
$taskSpec->task = $taskID;
$taskSpec->version = $task->version;
$taskSpec->name = $task->name;
$taskSpec->estStarted = $task->estStarted;
$taskSpec->deadline = $task->deadline;
$this->dao->insert(TABLE_TASKSPEC)->data($taskSpec)
->autoCheck()
->exec();
}
}
$this->dao->update(TABLE_TASK)->data($task)
->autoCheck()
->batchCheckIF($task->status != 'cancel', $this->config->task->edit->requiredFields, 'notempty')
@@ -926,6 +989,23 @@ class taskModel extends model
$task->lastEditedDate = $now;
$task->consumed = $oldTask->consumed;
/* Record task version.*/
if(isset($this->config->qcVersion))
{
if($oldTask->name != $data->name || $oldTask->estStarted != $data->estStarted || $oldTask->deadline != $da
{
$task->version = $oldTask->version + 1;
$taskSpec = new stdClass();
$taskSpec->task = $taskID;
$taskSpec->version = $task->version;
$taskSpec->name = $task->name;
$taskSpec->estStarted = $task->estStarted;
$taskSpec->deadline = $task->deadline;
$this->dao->insert(TABLE_TASKSPEC)->data($taskSpec)->autoCheck()->exec();
}
}
if($data->consumeds[$taskID])
{
if($data->consumeds[$taskID] < 0)