* * Optimized module code.
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user