Add errorBegin and errorEnd for batchUpdate of stage.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user