summaryrefslogtreecommitdiff
path: root/app/Model/TaskCreationModel.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-24 15:43:34 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-24 15:43:34 -0400
commit18cb7ad0a4a96be63030f5207b74a195c8b6cd6c (patch)
tree719898528a9df56f6d8ea4abaee54b9542e3d434 /app/Model/TaskCreationModel.php
parentb2e92480c29acb15586bc8ea305c8416927a667c (diff)
Expose tags to the user interface (first prototype)
Diffstat (limited to 'app/Model/TaskCreationModel.php')
-rw-r--r--app/Model/TaskCreationModel.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/Model/TaskCreationModel.php b/app/Model/TaskCreationModel.php
index 3800f831..fa2d32c6 100644
--- a/app/Model/TaskCreationModel.php
+++ b/app/Model/TaskCreationModel.php
@@ -22,11 +22,13 @@ class TaskCreationModel extends Base
*/
public function create(array $values)
{
- if (! $this->projectModel->exists($values['project_id'])) {
- return 0;
- }
-
$position = empty($values['position']) ? 0 : $values['position'];
+ $tags = array();
+
+ if (isset($values['tags'])) {
+ $tags = $values['tags'];
+ unset($values['tags']);
+ }
$this->prepare($values);
$task_id = $this->db->table(TaskModel::TABLE)->persist($values);
@@ -36,6 +38,10 @@ class TaskCreationModel extends Base
$this->taskPositionModel->movePosition($values['project_id'], $task_id, $values['column_id'], $position, $values['swimlane_id'], false);
}
+ if (! empty($tags)) {
+ $this->taskTagModel->save($values['project_id'], $task_id, $tags);
+ }
+
$this->fireEvents($task_id, $values);
}