* * 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';
+3
View File
@@ -175,6 +175,9 @@ class programplan extends control
if($parentStage->attribute != 'mix') $plan->attribute = $parentStage->attribute;
}
if(empty($plan->realBegan)) $plan->realBegan = null;
if(empty($plan->realEnd)) $plan->realEnd = null;
$plan = $this->programplanZen->prepareEditPlan($planID, $projectID, $plan, isset($parentStage) ? $parentStage : null);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
+1
View File
@@ -187,6 +187,7 @@ class programplanZen extends programplan
}
}
if(dao::isError()) return false;
/* 如果是调研阶段,设置默认值。*/
/* If it is research stage, set default value. */
if($project->model == 'research')