diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/Task.php | 2 | ||||
-rw-r--r-- | app/Model/Task.php | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/Controller/Task.php b/app/Controller/Task.php index 97751947..b0bb9d5b 100644 --- a/app/Controller/Task.php +++ b/app/Controller/Task.php @@ -30,7 +30,7 @@ class Task extends Base $values = array( 'title' => $this->request->getStringParam('title'), 'description' => $this->request->getStringParam('description'), - 'color_id' => $this->request->getStringParam('color_id', 'blue'), + 'color_id' => $this->request->getStringParam('color_id'), 'project_id' => $this->request->getIntegerParam('project_id', $defaultProject['id']), 'owner_id' => $this->request->getIntegerParam('owner_id'), 'column_id' => $this->request->getIntegerParam('column_id'), diff --git a/app/Model/Task.php b/app/Model/Task.php index 09333008..e35bd383 100644 --- a/app/Model/Task.php +++ b/app/Model/Task.php @@ -400,6 +400,11 @@ class Task extends Base $values['column_id'] = $this->board->getFirstColumn($values['project_id']); } + if (empty($values['color_id'])) { + $colors = $this->getColors(); + $values['color_id'] = key($colors); + } + $values['date_creation'] = time(); $values['date_modification'] = $values['date_creation']; $values['position'] = $this->countByColumnId($values['project_id'], $values['column_id']) + 1; @@ -677,7 +682,6 @@ class Task extends Base public function validateCreation(array $values) { $v = new Validator($values, array( - new Validators\Required('color_id', t('The color is required')), new Validators\Required('project_id', t('The project is required')), new Validators\Integer('project_id', t('This value must be an integer')), new Validators\Integer('column_id', t('This value must be an integer')), |