diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-11-03 10:57:00 -0700 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-11-03 10:57:00 -0700 |
commit | e6f8a76a188960512ced32133b85686d9a8d9090 (patch) | |
tree | a7d4ff84eb127a8d542244e276c4775886c88a85 /app/Controller/TaskBulkController.php | |
parent | 78a2d3142c8da35ed072fdb035a2351594b128cc (diff) |
Use task description templates in bulk task creation
Diffstat (limited to 'app/Controller/TaskBulkController.php')
-rw-r--r-- | app/Controller/TaskBulkController.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/Controller/TaskBulkController.php b/app/Controller/TaskBulkController.php index 4345a68f..0f49fb76 100644 --- a/app/Controller/TaskBulkController.php +++ b/app/Controller/TaskBulkController.php @@ -35,6 +35,7 @@ class TaskBulkController extends BaseController 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id'], true, false, $project['is_private'] == 1), 'colors_list' => $this->colorModel->getList(), 'categories_list' => $this->categoryModel->getList($project['id']), + 'task_description_templates' => $this->predefinedTaskDescriptionModel->getList($project['id']), ))); } @@ -85,8 +86,18 @@ class TaskBulkController extends BaseController 'owner_id' => empty($values['owner_id']) ? 0 : $values['owner_id'], 'color_id' => $values['color_id'], 'project_id' => $project['id'], + 'description' => $this->getTaskDescription($project, $values), )); } } } + + protected function getTaskDescription(array $project, array $values) + { + if (empty($values['task_description_template_id'])) { + return ''; + } + + return $this->predefinedTaskDescriptionModel->getDescriptionById($project['id'], $values['task_description_template_id']); + } } |