Finis task #44486,44487,44488.

This commit is contained in:
zhouxin
2021-11-17 15:49:24 +08:00
parent 87597eccbb
commit b7e3fe9003
13 changed files with 202 additions and 0 deletions
+7
View File
@@ -150,6 +150,9 @@ $lang->action->desc->resolved = '$date, resolved by <strong>$actor</stron
$lang->action->desc->managed = '$date, by <strong>$actor</strong> managed.' . "\n";
$lang->action->desc->estimated = '$date, by <strong>$actor</strong> estimated.' . "\n";
$lang->action->desc->run = '$date, by <strong>$actor</strong> executed.' . "\n";
$lang->action->desc->syncprogram = '$date, started by <strong>$actor</strong>(The start of the project sets the status of the program as Ongoing)' . "\n";
$lang->action->desc->syncproject = '$date, The start of the execution sets the status of the project as Ongoing' . "\n";
$lang->action->desc->syncexecution = '$date, The start of the task sets the status of the execution as Ongoing' . "\n";
/* 子任务修改父任务的历史操作记录 */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
@@ -265,6 +268,10 @@ $lang->action->label->reviewrejected = 'Reject';
$lang->action->label->reviewclarified = 'Clarify';
$lang->action->label->commitsummary = 'Commit Summary';
$lang->action->label->updatetrainee = 'Update Trainee';
$lang->action->label->syncprogram = 'start';
$lang->action->label->syncproject = 'start';
$lang->action->label->syncexecution = 'start';
$lang->action->label->startProgram = '(The start of the project sets the status of the program as Ongoing)';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass;
+7
View File
@@ -164,6 +164,9 @@ $lang->action->desc->resolved = '$date, resolved by <strong>$actor</stron
$lang->action->desc->managed = '$date, by <strong>$actor</strong> managed.' . "\n";
$lang->action->desc->estimated = '$date, by <strong>$actor</strong> estimated.' . "\n";
$lang->action->desc->run = '$date, by <strong>$actor</strong> executed.' . "\n";
$lang->action->desc->syncprogram = '$date, started by <strong>$actor</strong>(The start of the project sets the status of the program as Ongoing)' . "\n";
$lang->action->desc->syncproject = '$date, The start of the execution sets the status of the project as Ongoing' . "\n";
$lang->action->desc->syncexecution = '$date, The start of the task sets the status of the execution as Ongoing' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
@@ -280,6 +283,10 @@ $lang->action->label->reviewclarified = 'Clarify';
$lang->action->label->commitsummary = 'Commit Summary';
$lang->action->label->updatetrainee = 'Update Trainee';
$lang->action->label->setdefaultbranch = 'Set default branch';
$lang->action->label->syncprogram = 'start';
$lang->action->label->syncproject = 'start';
$lang->action->label->syncexecution = 'start';
$lang->action->label->startProgram = '(The start of the project sets the status of the program as Ongoing)';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
+7
View File
@@ -150,6 +150,9 @@ $lang->action->desc->resolved = '$date, resolved by <strong>$actor</stron
$lang->action->desc->managed = '$date, by <strong>$actor</strong> managed.' . "\n";
$lang->action->desc->estimated = '$date, by <strong>$actor</strong> estimated.' . "\n";
$lang->action->desc->run = '$date, by <strong>$actor</strong> executed.' . "\n";
$lang->action->desc->syncprogram = '$date, started by <strong>$actor</strong>(The start of the project sets the status of the program as Ongoing)' . "\n";
$lang->action->desc->syncproject = '$date, The start of the execution sets the status of the project as Ongoing' . "\n";
$lang->action->desc->syncexecution = '$date, The start of the task sets the status of the execution as Ongoing' . "\n";
/* 子任务修改父任务的历史操作记录 */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> a créé un sous-tâche <strong>$extra</strong>。' . "\n";
@@ -265,6 +268,10 @@ $lang->action->label->reviewrejected = 'Reject';
$lang->action->label->reviewclarified = 'Clarify';
$lang->action->label->commitsummary = 'Commit Summary';
$lang->action->label->updatetrainee = 'Update Trainee';
$lang->action->label->syncprogram = 'start';
$lang->action->label->syncproject = 'start';
$lang->action->label->syncexecution = 'start';
$lang->action->label->startProgram = '(The start of the project sets the status of the program as Ongoing)';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass();
+7
View File
@@ -150,6 +150,9 @@ $lang->action->desc->resolved = '$date, resolved by <strong>$actor</stron
$lang->action->desc->managed = '$date, by <strong>$actor</strong> managed.' . "\n";
$lang->action->desc->estimated = '$date, by <strong>$actor</strong> estimated.' . "\n";
$lang->action->desc->run = '$date, by <strong>$actor</strong> executed.' . "\n";
$lang->action->desc->syncprogram = '$date, started by <strong>$actor</strong>(The start of the project sets the status of the program as Ongoing)' . "\n";
$lang->action->desc->syncproject = '$date, The start of the execution sets the status of the project as Ongoing' . "\n";
$lang->action->desc->syncexecution = '$date, The start of the task sets the status of the execution as Ongoing' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
@@ -265,6 +268,10 @@ $lang->action->label->reviewrejected = 'Reject';
$lang->action->label->reviewclarified = 'Clarify';
$lang->action->label->commitsummary = 'Commit Summary';
$lang->action->label->updatetrainee = 'Update Trainee';
$lang->action->label->syncprogram = 'start';
$lang->action->label->syncproject = 'start';
$lang->action->label->syncexecution = 'start';
$lang->action->label->startProgram = '(The start of the project sets the status of the program as Ongoing)';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
+8
View File
@@ -164,6 +164,10 @@ $lang->action->desc->resolved = '$date, 由 <strong>$actor</strong> 解
$lang->action->desc->managed = '$date, 由 <strong>$actor</strong> 维护。' . "\n";
$lang->action->desc->estimated = '$date, 由 <strong>$actor</strong> 估算。' . "\n";
$lang->action->desc->run = '$date, 由 <strong>$actor</strong> 执行。' . "\n";
$lang->action->desc->syncprogram = '$date, 由 <strong>$actor</strong> 启动(因项目开始而启动项目集)。' . "\n";
$lang->action->desc->syncproject = '$date, 系统判断由执行开始,将项目状态置为进行中。' . "\n";
$lang->action->desc->syncexecution = '$date, 系统判断由任务开始,将执行状态置为进行中。' . "\n";
/* 用来描述和父子任务相关的操作历史记录。*/
$lang->action->desc->createchildren = '$date, 由 <strong>$actor</strong> 创建子任务 <strong>$extra</strong>。' . "\n";
@@ -280,6 +284,10 @@ $lang->action->label->reviewclarified = '有待明确';
$lang->action->label->commitsummary = '提交培训总结';
$lang->action->label->updatetrainee = '更新培训人员';
$lang->action->label->setdefaultbranch = '设置了默认分支';
$lang->action->label->syncprogram = '开始了';
$lang->action->label->syncproject = '开始了';
$lang->action->label->syncexecution = '开始了';
$lang->action->label->startProgram = '(因项目开始而启动项目集)';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass();
+7
View File
@@ -164,6 +164,9 @@ $lang->action->desc->resolved = '$date, 由 <strong>$actor</strong> 解
$lang->action->desc->managed = '$date, 由 <strong>$actor</strong> 維護。' . "\n";
$lang->action->desc->estimated = '$date, 由 <strong>$actor</strong> 估算。' . "\n";
$lang->action->desc->run = '$date, 由 <strong>$actor</strong> 執行。' . "\n";
$lang->action->desc->syncprogram = '$date, 由 <strong>$actor</strong> 啟動(因項目開始而啟動項目集)。' . "\n";
$lang->action->desc->syncproject = '$date, 系統判斷由執行開始,將項目狀態置為進行中。' . "\n";
$lang->action->desc->syncexecution = '$date, 系統判斷由任務開始,將執行狀態置為進行中。' . "\n";
/* 用來描述和父子任務相關的操作歷史記錄。*/
$lang->action->desc->createchildren = '$date, 由 <strong>$actor</strong> 創建子任務 <strong>$extra</strong>。' . "\n";
@@ -279,6 +282,10 @@ $lang->action->label->reviewrejected = '拒絶';
$lang->action->label->reviewclarified = '有待明確';
$lang->action->label->commitsummary = '提交培訓總結';
$lang->action->label->updatetrainee = '更新培訓人員';
$lang->action->label->syncprogram = '開始了';
$lang->action->label->syncproject = '開始了';
$lang->action->label->syncexecution = '開始了';
$lang->action->label->startProgram = '(因項目開始而啟動項目集)';
/* 動態信息按照對象分組 */
$lang->action->dynamicAction = new stdclass();
+5
View File
@@ -969,6 +969,11 @@ class actionModel extends model
/* Add name field to the actions. */
$action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : '';
if($action->objectType =='program' and strpos('syncexecution,syncproject,syncprogram', $action->action) !==false)
{
$action->objectName .= $this->lang->action->label->startProgram;
}
$projectID = isset($relatedProjects[$action->objectType][$action->objectID]) ? $relatedProjects[$action->objectType][$action->objectID] : 0;
$actionType = strtolower($action->action);
+116
View File
@@ -36,6 +36,122 @@ class commonModel extends model
}
}
/**
* Set the status of execution, project, and program to doing.
*
* @param int $objectID
* @access public
* @return void
*/
public function syncPPEStatus($objectID)
{
global $app;
$thisModule = $app->rawModule;
if($this->config->systemMode == 'classic')
{
if($thisModule == 'task') $this->syncExecutionStatus($objectID);
}
if($this->config->systemMode == 'new')
{
if($thisModule == 'task')
{
$taskID = $objectID;
$execution = $this->syncExecutionStatus($taskID);
$project = $this->syncProjectStatus($execution);
$this->syncProgramStatus($project);
}
if($thisModule == 'execution')
{
$executionID = $objectID;
$execution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch();
$project = $this->syncProjectStatus($execution);
$this->syncProgramStatus($project);
}
if($thisModule == 'project')
{
$projectID = $objectID;
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
$this->syncProgramStatus($project);
}
if($thisModule == 'program')
{
$programID = $objectID;
$program = $this->dao->select('*')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch();
$this->syncProgramStatus($program);
}
}
}
/**
* Set the status of the program to which theproject is linked as Ongoing.
*
* @param object $project
* @access public
* @return void
*/
public function syncProgramStatus($project)
{
if($project->parent == 0) return;
$parentPath = str_replace(",{$project->id},", '', $project->path);
$parentPath = explode(',', trim($parentPath, ','));
$waitList = $this->dao->select('id')->from(TABLE_PROGRAM)
->where('id')->in($parentPath)
->andWhere('status')->eq('wait')
->orderBy('id_desc')
->fetchPairs();
foreach($waitList as $programID)
{
$this->dao->update(TABLE_PROGRAM)->set('status')->eq('doing')->where('id')->eq($programID)->exec();
$this->loadModel('action')->create('program', $programID, 'syncprogram');
}
}
/**
* Set the status of the project to which the execution is linked as Ongoing.
*
* @param object $execution
* @access public
* @return object $project
*/
public function syncProjectStatus($execution)
{
$projectID = $execution->project;
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
if($project->status == 'wait')
{
$this->dao->update(TABLE_PROJECT)->set('status')->eq('doing')->where('id')->eq($projectID)->exec();
$this->loadModel('action')->create('project', $projectID, 'syncproject');
}
return $project;
}
/**
* Set the status of the execution to which the task is linked as Ongoing.
*
* @param int $taskID
* @access public
* @return object $execution
*/
public function syncExecutionStatus($taskID)
{
$execution = $this->dao->select('t1.*')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_TASK)->alias('t2')->on('t1.id=t2.execution')
->where('t2.id')->eq($taskID)
->fetch();
if($execution->status == 'wait')
{
$this->dao->update(TABLE_EXECUTION)->set('status')->eq('doing')->where('id')->eq($execution->id)->exec();
$this->loadModel('action')->create('execution', $execution->id, 'syncexecution');
}
return $execution;
}
/**
* Set the header info.
*
+13
View File
@@ -1469,6 +1469,7 @@ class execution extends control
}
$this->executeHooks($executionID);
if($_POST['status'] == 'doing') $this->loadModel('common')->syncPPEStatus($executionID);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "executionID=$executionID")));
}
@@ -1574,6 +1575,16 @@ class execution extends control
$actionID = $this->loadModel('action')->create($this->objectType, $executionID, 'Edited');
$this->action->logHistory($actionID, $changes);
foreach($changes as $changeField)
{
if($changeField['field'] == 'status' && $changeField['old'] =='wait' && $changeField['new'] =='doing')
{
$syncExecution = $executionID;
break;
}
}
$this->loadModel('common')->syncPPEStatus($syncExecution);
}
}
die(js::locate($this->session->executionList, 'parent'));
@@ -1651,6 +1662,8 @@ class execution extends control
$actionID = $this->action->create($this->objectType, $executionID, 'Started', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->loadModel('common')->syncPPEStatus($executionID);
$this->executeHooks($executionID);
die(js::reload('parent.parent'));
}
+1
View File
@@ -583,6 +583,7 @@ class executionModel extends model
$oldExecutions = $this->getByIdList($this->post->executionIDList);
$nameList = array();
$codeList = array();
$projectModel = '';
/* Replace required language. */
if($this->app->tab == 'project')
+2
View File
@@ -288,6 +288,8 @@ class program extends control
$actionID = $this->action->create('program', $programID, 'Started', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
$this->loadModel('common')->syncPPEStatus($programID);
$this->executeHooks($programID);
die(js::reload('parent.parent'));
}
+1
View File
@@ -1421,6 +1421,7 @@ class project extends control
}
}
}
$this->loadModel('common')->syncPPEStatus($projectID);
$this->executeHooks($projectID);
die(js::reload('parent.parent'));
+21
View File
@@ -395,6 +395,8 @@ class task extends control
$this->executeHooks($taskID);
if($_POST['status'] == 'doing') $this->loadModel('common')->syncPPEStatus($taskID);
if($task->fromBug != 0)
{
foreach($changes as $change)
@@ -464,10 +466,25 @@ class task extends control
if(!empty($allChanges))
{
/* updateStatus is a description of whether to update the responsibility performance*/
$updateStatus = false;
foreach($allChanges as $taskID => $changes)
{
if(empty($changes)) continue;
/* Determine whether the status of a task has been changed, if the status of a task has been changed, set $updateStatus to taskID*/
if($updateStatus == false)
{
foreach($changes as $changeField)
{
if($changeField['field'] == 'status' && $changeField['new'] == 'doing')
{
$updateStatus = $taskID;
break;
}
}
}
$actionID = $this->loadModel('action')->create('task', $taskID, 'Edited');
$this->action->logHistory($actionID, $changes);
@@ -484,6 +501,7 @@ class task extends control
}
}
}
if($updateStatus !== false) $this->loadModel('common')->syncPPEStatus($updateStatus);
}
}
$this->loadModel('score')->create('ajax', 'batchOther');
@@ -792,6 +810,7 @@ class task extends control
}
$this->executeHooks($taskID);
$this->loadModel('common')->syncPPEStatus($taskID);
/* Remind whether to update status of the bug, if task which from that bug has been finished. */
if($changes and $this->task->needUpdateBugStatus($task))
@@ -838,6 +857,8 @@ class task extends control
$changes = $this->task->recordEstimate($taskID);
if(dao::isError()) die(js::error(dao::getError()));
$this->loadModel('common')->syncPPEStatus($taskID);
/* Remind whether to update status of the bug, if task which from that bug has been finished. */
$task = $this->task->getById($taskID);
if($changes and $this->task->needUpdateBugStatus($task))