* * Optimized module code.

This commit is contained in:
tanghucheng
2024-05-10 16:09:22 +08:00
parent 21c8197bb0
commit 1a824e87fd
3 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -1247,6 +1247,9 @@ class executionModel extends model
}
if(dao::isError()) return;
$project->begin = !empty($project->realBegan) ? $project->realBegan : $project->begin;
$project->end = !empty($project->realEnd) ? $project->realEnd : $project->end;
if($begin < $project->begin) dao::$errors['begin'] = sprintf($this->lang->execution->errorCommonBegin, $project->begin);
if($end > $project->end) dao::$errors['end'] = sprintf($this->lang->execution->errorCommonEnd, $project->end);
}
@@ -3854,7 +3857,7 @@ class executionModel extends model
$action = strtolower($action);
if($action == 'start') return $execution->status == 'wait';
if($action == 'close') return $execution->status != 'closed' && (!empty($execution->isIpdStage) || !isset($execution->isParent) || (isset($execution->isParent) && !$execution->isParent));
if($action == 'close') return $execution->status != 'closed' && (!empty($execution->isIpdStage) || (!isset($execution->isParent) || (isset($execution->isParent) && !$execution->isParenti)));
if($action == 'suspend') return $execution->status == 'wait' || $execution->status == 'doing';
if($action == 'putoff') return $execution->status == 'wait' || $execution->status == 'doing';
if($action == 'activate') return $execution->status == 'suspended' || $execution->status == 'closed';