Merge branch 'sprint/194_tianshujie_55257' into 'master'
Sprint/194 tianshujie 55257 See merge request easycorp/zentaopms!3594
This commit is contained in:
+12
-1
@@ -133,6 +133,7 @@ class taskModel extends model
|
||||
|
||||
/* Fix Bug #2466 */
|
||||
if($this->post->multiple) $task->assignedTo = '';
|
||||
if(!$this->post->multiple or count(array_filter($this->post->team)) < 1) $task->mode = '';
|
||||
$this->dao->insert(TABLE_TASK)->data($task, $skip = 'gitlab,gitlabProject')
|
||||
->autoCheck()
|
||||
->batchCheck($requiredFields, 'notempty')
|
||||
@@ -895,6 +896,12 @@ class taskModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
/* If a multiple task is assigned to a team member who is not the task, assign to the team member instead. */
|
||||
if(!$this->post->assignedTo and !empty($_POST['team']) and !in_array($oldTask->assignedTo, $this->post->team))
|
||||
{
|
||||
$_POST['assignedTo'] = reset($_POST['team']);
|
||||
}
|
||||
|
||||
/* When the selected parent task is a common task and has consumption, select other parent tasks. */
|
||||
if($this->post->parent > 0)
|
||||
{
|
||||
@@ -942,7 +949,7 @@ class taskModel extends model
|
||||
|
||||
->setIF($oldTask->name != $this->post->name || $oldTask->estStarted != $this->post->estStarted || $oldTask->deadline != $this->post->deadline, 'version', $oldTask->version + 1)
|
||||
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->setDefault('lastEditedBy', $this->app->user->account)
|
||||
->add('lastEditedDate', $now)
|
||||
->stripTags($this->config->task->editor->edit['id'], $this->config->allowedTags)
|
||||
->cleanINT('execution,story,module')
|
||||
@@ -1007,6 +1014,10 @@ class taskModel extends model
|
||||
$task->assignedTo = key($teams);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$task->mode = '';
|
||||
}
|
||||
|
||||
$executionType = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($task->execution)->fetch('type');
|
||||
$requiredFields = "," . $this->config->task->edit->requiredFields . ",";
|
||||
|
||||
Reference in New Issue
Block a user