Add errorBegin and errorEnd for batchUpdate of stage.

This commit is contained in:
zhouxin
2022-03-17 06:00:58 +00:00
parent cc9fad8baa
commit 109d4049e0
+6
View File
@@ -577,6 +577,7 @@ class executionModel extends model
public function batchUpdate()
{
$this->loadModel('user');
$this->loadModel('project');
$executions = array();
$allChanges = array();
@@ -657,6 +658,11 @@ class executionModel extends model
$oldExecution = $oldExecutions[$executionID];
$team = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution');
$projectID = isset($execution->project) ? $execution->project : $oldExecution->project;
$project = $this->project->getByID($projectID);
if($execution->begin < $project->begin) dao::$errors['begin'] = sprintf($this->lang->execution->errorBegin, $project->begin);
if($execution->end > $project->end) dao::$errors['end'] = sprintf($this->lang->execution->errorEnd, $project->end);
if(dao::isError()) return print(js::error(dao::getError()));
$this->dao->update(TABLE_EXECUTION)->data($execution)
->autoCheck($skipFields = 'begin,end')