summaryrefslogtreecommitdiff
path: root/app/Model/TaskCreation.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/TaskCreation.php')
-rw-r--r--app/Model/TaskCreation.php8
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'];