diff options
author | Frédéric Guillot <fred@kanboard.net> | 2015-01-02 21:11:19 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2015-01-02 21:11:19 -0500 |
commit | 45c95d74fc2115fe4cc7214553c0927d3ce9df8d (patch) | |
tree | 5135be8a33752cce4f1b457a5c379e02aaa65038 /app/Model/TaskCreation.php | |
parent | 3076ba22dd8346725b4e1ad757532c00df5b18d9 (diff) |
Various fixes and improvements
Diffstat (limited to 'app/Model/TaskCreation.php')
-rw-r--r-- | app/Model/TaskCreation.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/Model/TaskCreation.php b/app/Model/TaskCreation.php index e99bf6d2..17e5ff70 100644 --- a/app/Model/TaskCreation.php +++ b/app/Model/TaskCreation.php @@ -21,6 +21,10 @@ class TaskCreation extends Base */ public function create(array $values) { + if (! $this->project->exists($values['project_id'])) { + return 0; + } + $this->prepare($values); $task_id = $this->persist(Task::TABLE, $values); @@ -51,6 +55,10 @@ class TaskCreation extends Base $values['color_id'] = $this->color->getDefaultColor(); } + if (empty($values['title'])) { + $values['title'] = t('Untitled'); + } + $values['swimlane_id'] = empty($values['swimlane_id']) ? 0 : $values['swimlane_id']; $values['date_creation'] = time(); $values['date_modification'] = $values['date_creation']; |