* Fix bug #16564.
This commit is contained in:
@@ -362,10 +362,11 @@ class executionModel extends model
|
||||
$this->lang->project->code = $this->lang->execution->execCode;
|
||||
}
|
||||
|
||||
$sprintProject = isset($sprint->project) ? $sprint->project : '';
|
||||
$this->dao->insert(TABLE_EXECUTION)->data($sprint)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
->batchcheck($this->config->execution->create->requiredFields, 'notempty')
|
||||
->checkIF(!empty($sprint->name), 'name', 'unique', "`type` in ('sprint','stage') and `project` = $sprint->project")
|
||||
->checkIF((!empty($sprint->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`type` in ('sprint','stage') and `project` = $sprintProject")
|
||||
->checkIF(!empty($sprint->code), 'code', 'unique', "`type` in ('sprint','stage')")
|
||||
->checkIF($sprint->begin != '', 'begin', 'date')
|
||||
->checkIF($sprint->end != '', 'end', 'date')
|
||||
@@ -513,13 +514,14 @@ class executionModel extends model
|
||||
}
|
||||
|
||||
/* Update data. */
|
||||
$executionProject = isset($execution->project) ? $execution->project : '';
|
||||
$this->dao->update(TABLE_EXECUTION)->data($execution)
|
||||
->autoCheck($skipFields = 'begin,end')
|
||||
->batchcheck($this->config->execution->edit->requiredFields, 'notempty')
|
||||
->checkIF($execution->begin != '', 'begin', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'date')
|
||||
->checkIF($execution->end != '', 'end', 'ge', $execution->begin)
|
||||
->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $execution->project")
|
||||
->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $executionProject")
|
||||
->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')")
|
||||
->where('id')->eq($executionID)
|
||||
->limit(1)
|
||||
@@ -545,7 +547,7 @@ class executionModel extends model
|
||||
$changedAccounts[$owner] = $owner;
|
||||
$teamMembers[$ownerField] = $member;
|
||||
}
|
||||
if($execution->project) $this->addProjectMembers($execution->project, $teamMembers);
|
||||
if(isset($execution->project) and $execution->project) $this->addProjectMembers($execution->project, $teamMembers);
|
||||
|
||||
$whitelist = explode(',', $execution->whitelist);
|
||||
$this->loadModel('personnel')->updateWhitelist($whitelist, 'sprint', $executionID);
|
||||
|
||||
Reference in New Issue
Block a user