Merge branch 'zentaopms_284' of https://gitlab.zcorp.cc/easycorp/zentaopms into zentaopms_284

This commit is contained in:
Yagami
2023-02-07 16:05:30 +08:00
17 changed files with 293 additions and 84 deletions
+13
View File
@@ -1809,6 +1809,8 @@ class execution extends control
$comment = $project->hasProduct ? join(',', $_POST['products']) : '';
$this->loadModel('action')->create($this->objectType, $executionID, 'opened', '', $comment);
$this->loadModel('programplan')->computeProgress($executionID, 'create');
$message = $this->executeHooks($executionID);
if($message) $this->lang->saveSuccess = $message;
@@ -2233,6 +2235,8 @@ class execution extends control
$this->action->logHistory($actionID, $changes);
}
if($execution->type == 'stage') $this->loadModel('programplan')->computeProgress($executionID, 'start');
$this->loadModel('common')->syncPPEStatus($executionID);
$this->executeHooks($executionID);
if(isonlybody() and $from == 'kanban')
@@ -2322,6 +2326,9 @@ class execution extends control
$actionID = $this->action->create($this->objectType, $executionID, 'Suspended', $this->post->comment);
$this->action->logHistory($actionID, $changes);
}
if($execution->type == 'stage') $this->loadModel('programplan')->computeProgress($executionID, 'suspend');
$this->executeHooks($executionID);
if(isonlybody() and $from == 'kanban')
{
@@ -2360,6 +2367,8 @@ class execution extends control
$this->execution->activate($executionID);
if(dao::isError()) return print(js::error(dao::getError()));
if($execution->type == 'stage') $this->loadModel('programplan')->computeProgress($executionID, 'activate');
$this->executeHooks($executionID);
if(isonlybody() and $from == 'kanban')
{
@@ -2406,6 +2415,8 @@ class execution extends control
$this->execution->close($executionID);
if(dao::isError()) return print(js::error(dao::getError()));
if($execution->type == 'stage') $this->loadModel('programplan')->computeProgress($executionID, 'close');
$this->executeHooks($executionID);
if(isonlybody() and $from == 'kanban')
{
@@ -3078,6 +3089,8 @@ class execution extends control
$this->execution->updateUserView($executionID);
$this->loadModel('common')->syncPPEStatus($executionID);
if($execution->type == 'stage') $this->loadModel('programplan')->computeProgress($executionID);
$this->session->set('execution', '');
$message = $this->executeHooks($executionID);
if($message) $this->lang->saveSuccess = $message;
+18
View File
@@ -547,11 +547,29 @@ $lang->execution->action->startbychildactivate = '$date, activating the sub stag
$lang->execution->action->waitbychilddelete = '$date, deleting the sub stage sets the execution status as waitting.' . "\n";
$lang->execution->action->closebychilddelete = '$date, deleting the sub stage sets the execution status as closing.' . "\n";
$lang->execution->action->closebychildclose = '$date, closing the sub stage sets the execution status as closing.' . "\n";
$lang->execution->action->waitbychild = '$date, the stage status is <strong>Wait</strong> as the system judges that all its sub-stages statuses are <strong>Wait</strong>.';
$lang->execution->action->suspendedbychild = '$date, the stage status is <strong>Suspended</strong> as the system judges that all its sub-stages statuses are <strong>Suspended</strong>.';
$lang->execution->action->closedbychild = '$date, the stage status is <strong>Closed</strong> as the system judges that all its sub-stages are <strong>Closed</strong>.';
$lang->execution->action->startbychildstart = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Started</strong>.';
$lang->execution->action->startbychildactivate = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Activated</strong>.';
$lang->execution->action->startbychildsuspend = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Suspended</strong>.';
$lang->execution->action->startbychildclose = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Closed</strong>.';
$lang->execution->action->startbychildcreate = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Created</strong>. ';
$lang->execution->action->startbychild = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Activated</strong>.';
$lang->execution->startbychildactivate = 'activated';
$lang->execution->waitbychilddelete = 'stop';
$lang->execution->closebychilddelete = 'closed';
$lang->execution->closebychildclose = 'closed';
$lang->execution->waitbychild = 'activated';
$lang->execution->suspendedbychild = 'suspended';
$lang->execution->closedbychild = 'closed';
$lang->execution->startbychildstart = 'started';
$lang->execution->startbychildactivate = 'activated';
$lang->execution->startbychildsuspend = 'activated';
$lang->execution->startbychildclose = 'activated';
$lang->execution->startbychildcreate = 'activated';
$lang->execution->startbychild = 'activated';
$lang->execution->statusColorList = array();
$lang->execution->statusColorList['wait'] = '#0991FF';
+18
View File
@@ -547,11 +547,29 @@ $lang->execution->action->startbychildactivate = '$date, activating the sub stag
$lang->execution->action->waitbychilddelete = '$date, deleting the sub stage sets the execution status as waitting.' . "\n";
$lang->execution->action->closebychilddelete = '$date, deleting the sub stage sets the execution status as closing.' . "\n";
$lang->execution->action->closebychildclose = '$date, closing the sub stage sets the execution status as closing.' . "\n";
$lang->execution->action->waitbychild = '$date, the stage status is <strong>Wait</strong> as the system judges that all its sub-stages statuses are <strong>Wait</strong>.';
$lang->execution->action->suspendedbychild = '$date, the stage status is <strong>Suspended</strong> as the system judges that all its sub-stages statuses are <strong>Suspended</strong>.';
$lang->execution->action->closedbychild = '$date, the stage status is <strong>Closed</strong> as the system judges that all its sub-stages are <strong>Closed</strong>.';
$lang->execution->action->startbychildstart = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Started</strong>.';
$lang->execution->action->startbychildactivate = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Activated</strong>.';
$lang->execution->action->startbychildsuspend = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Suspended</strong>.';
$lang->execution->action->startbychildclose = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Closed</strong>.';
$lang->execution->action->startbychildcreate = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Created</strong>. ';
$lang->execution->action->startbychild = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Activated</strong>.';
$lang->execution->startbychildactivate = 'activated';
$lang->execution->waitbychilddelete = 'stop';
$lang->execution->closebychilddelete = 'closed';
$lang->execution->closebychildclose = 'closed';
$lang->execution->waitbychild = 'activated';
$lang->execution->suspendedbychild = 'suspended';
$lang->execution->closedbychild = 'closed';
$lang->execution->startbychildstart = 'started';
$lang->execution->startbychildactivate = 'activated';
$lang->execution->startbychildsuspend = 'activated';
$lang->execution->startbychildclose = 'activated';
$lang->execution->startbychildcreate = 'activated';
$lang->execution->startbychild = 'activated';
$lang->execution->statusColorList = array();
$lang->execution->statusColorList['wait'] = '#0991FF';
+18
View File
@@ -547,11 +547,29 @@ $lang->execution->action->startbychildactivate = '$date, activating the sub stag
$lang->execution->action->waitbychilddelete = '$date, deleting the sub stage sets the execution status as waitting.' . "\n";
$lang->execution->action->closebychilddelete = '$date, deleting the sub stage sets the execution status as closing.' . "\n";
$lang->execution->action->closebychildclose = '$date, closing the sub stage sets the execution status as closing.' . "\n";
$lang->execution->action->waitbychild = '$date, the stage status is <strong>Wait</strong> as the system judges that all its sub-stages statuses are <strong>Wait</strong>.';
$lang->execution->action->suspendedbychild = '$date, the stage status is <strong>Suspended</strong> as the system judges that all its sub-stages statuses are <strong>Suspended</strong>.';
$lang->execution->action->closedbychild = '$date, the stage status is <strong>Closed</strong> as the system judges that all its sub-stages are <strong>Closed</strong>.';
$lang->execution->action->startbychildstart = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Started</strong>.';
$lang->execution->action->startbychildactivate = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Activated</strong>.';
$lang->execution->action->startbychildsuspend = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Suspended</strong>.';
$lang->execution->action->startbychildclose = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Closed</strong>.';
$lang->execution->action->startbychildcreate = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Created</strong>. ';
$lang->execution->action->startbychild = '$date, the stage status is <strong>Doing</strong> as the system judges that its sub-stages are <strong>Activated</strong>.';
$lang->execution->startbychildactivate = 'activated';
$lang->execution->waitbychilddelete = 'stop';
$lang->execution->closebychilddelete = 'closed';
$lang->execution->closebychildclose = 'closed';
$lang->execution->waitbychild = 'activated';
$lang->execution->suspendedbychild = 'suspended';
$lang->execution->closedbychild = 'closed';
$lang->execution->startbychildstart = 'started';
$lang->execution->startbychildactivate = 'activated';
$lang->execution->startbychildsuspend = 'activated';
$lang->execution->startbychildclose = 'activated';
$lang->execution->startbychildcreate = 'activated';
$lang->execution->startbychild = 'activated';
$lang->execution->statusColorList = array();
$lang->execution->statusColorList['wait'] = '#0991FF';
+19
View File
@@ -547,11 +547,30 @@ $lang->execution->action->startbychildactivate = '$date, 系统判断由于子
$lang->execution->action->waitbychilddelete = '$date, 系统判断由于子阶段删除,将' . $lang->executionCommon . '状态置为未开始。' . "\n";
$lang->execution->action->closebychilddelete = '$date, 系统判断由于子阶段删除,将' . $lang->executionCommon . '状态置为已关闭。' . "\n";
$lang->execution->action->closebychildclose = '$date, 系统判断由于子阶段关闭,将' . $lang->executionCommon . '状态置为已关闭。' . "\n";
$lang->execution->action->waitbychild = '$date, 系统判断由于子阶段 <strong>全部为未开始</strong> ,将阶段状态置为 <strong>未开始</strong> 。';
$lang->execution->action->suspendedbychild = '$date, 系统判断由于子阶段 <strong>全部挂起</strong> ,将阶段状态置为 <strong>已挂起</strong> 。';
$lang->execution->action->closedbychild = '$date, 系统判断由于子阶段 <strong>全部关闭</strong> ,将阶段状态置为 <strong>已关闭</strong> 。';
$lang->execution->action->startbychildstart = '$date, 系统判断由于子阶段 <strong>开始</strong> ,将阶段状态置为 <strong>进行中</strong> 。';
$lang->execution->action->startbychildactivate = '$date, 系统判断由于子阶段 <strong>激活</strong> ,将阶段状态置为 <strong>进行中</strong> 。';
$lang->execution->action->startbychildsuspend = '$date, 系统判断由于子阶段 <strong>挂起</strong> ,将阶段状态置为 <strong>进行中</strong> 。';
$lang->execution->action->startbychildclose = '$date, 系统判断由于子阶段 <strong>关闭</strong> ,将阶段状态置为 <strong>进行中</strong> 。';
$lang->execution->action->startbychildcreate = '$date, 系统判断由于 <strong>创建</strong> 子阶段 ,将阶段状态置为 <strong>进行中</strong> 。';
$lang->execution->action->startbychild = '$date, 系统判断由于子阶段 <strong>激活</strong> ,将阶段状态置为 <strong>进行中</strong> 。';
$lang->execution->startbychildactivate = '激活了';
$lang->execution->waitbychilddelete = '停止了';
$lang->execution->closebychilddelete = '关闭了';
$lang->execution->closebychildclose = '关闭了';
$lang->execution->waitbychild = '激活了';
$lang->execution->suspendedbychild = '挂起了';
$lang->execution->closedbychild = '关闭了';
$lang->execution->startbychildstart = '开始了';
$lang->execution->startbychildactivate = '激活了';
$lang->execution->startbychildsuspend = '激活了';
$lang->execution->startbychildclose = '激活了';
$lang->execution->startbychildcreate = '激活了';
$lang->execution->startbychild = '激活了';
$lang->execution->statusColorList = array();
$lang->execution->statusColorList['wait'] = '#0991FF';
+25 -34
View File
@@ -1078,17 +1078,6 @@ class executionModel extends model
$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 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');
}
}
return $changes;
}
@@ -1141,27 +1130,6 @@ class executionModel extends model
$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')
{
$isClosed = true;
$children = $this->getChildExecutions($oldExecution->parent);
foreach($children as $childID => $childExecution)
{
if($childExecution->status != 'closed') $isClosed = false;
}
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 $changes;
}
@@ -1319,7 +1287,7 @@ class executionModel extends model
*
* @param int $projectID
* @param string $type all|sprint|stage|kanban
* @param string $mode all|noclosed|stagefilter|withdelete|multiple or empty
* @param string $mode all|noclosed|stagefilter|withdelete|multiple|leaf or empty
* @access public
* @return array
*/
@@ -1356,16 +1324,34 @@ class executionModel extends model
->orderBy($orderBy)
->fetchAll();
/* If mode == leaf, only show leaf executions. */
$allExecutions = $this->dao->select('id,name,parent')->from(TABLE_EXECUTION)
->where('type')->notin(array('program', 'project'))
->beginIf($projectID)->andWhere('project')->eq($projectID)->fi()
->fetchAll('id');
$parents = array();
foreach($allExecutions as $exec)
{
$parents[$exec->parent] = true;
}
$pairs = array();
$noMultiples = array();
foreach($executions as $execution)
{
if(strpos($mode, 'leaf') !== false and isset($parents[$execution->id])) continue; // Only show leaf.
if(strpos($mode, 'noclosed') !== false and ($execution->status == 'done' or $execution->status == 'closed')) continue;
if(strpos($mode, 'stagefilter') !== false and isset($executionModel) and $executionModel == 'waterfall' and in_array($execution->attribute, array('request', 'design', 'review'))) continue; // Some stages of waterfall not need.
if(empty($execution->multiple)) $noMultiples[$execution->id] = $execution->project;
$pairs[$execution->id] = $execution->name;
/* Set execution name. */
$paths = array_slice(explode(',', trim($execution->path, ',')), 1);
$executionName = '';
foreach($paths as $path) $executionName .= '/' . $allExecutions[$path]->name;
$pairs[$execution->id] = $executionName;
}
if($noMultiples)
@@ -1671,6 +1657,11 @@ class executionModel extends model
if($execution->parent < 0 and $execution->type == 'stage') unset($executions[$key]);
if($execution->projectName) $execution->name = $execution->projectName . ' / ' . $execution->name;
}
elseif($param === 'hasParentName')
{
$parentExecutions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('id')->in(trim($execution->path, ','))->andWhere('type')->in('stage,kanban,sprint')->orderBy('grade')->fetchPairs();
$executions[$execution->id]->name = implode('/', $parentExecutions);
}
else
{
if(isset($executions[$execution->parent]) and $execution->type == 'stage')