summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-11-03 10:57:00 -0700
committerFrederic Guillot <fred@kanboard.net>2017-11-03 10:57:00 -0700
commite6f8a76a188960512ced32133b85686d9a8d9090 (patch)
treea7d4ff84eb127a8d542244e276c4775886c88a85 /app/Model
parent78a2d3142c8da35ed072fdb035a2351594b128cc (diff)
Use task description templates in bulk task creation
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/PredefinedTaskDescriptionModel.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/Model/PredefinedTaskDescriptionModel.php b/app/Model/PredefinedTaskDescriptionModel.php
index 7b8e6de2..aaa4d23e 100644
--- a/app/Model/PredefinedTaskDescriptionModel.php
+++ b/app/Model/PredefinedTaskDescriptionModel.php
@@ -13,11 +13,21 @@ class PredefinedTaskDescriptionModel extends Base
return $this->db->table(self::TABLE)->eq('project_id', $projectId)->findAll();
}
+ public function getList($projectId)
+ {
+ return array('' => t('None')) + $this->db->hashtable(self::TABLE)->eq('project_id', $projectId)->getAll('id', 'title');
+ }
+
public function getById($projectId, $id)
{
return $this->db->table(self::TABLE)->eq('project_id', $projectId)->eq('id', $id)->findOne();
}
+ public function getDescriptionById($projectId, $id)
+ {
+ return $this->db->table(self::TABLE)->eq('project_id', $projectId)->eq('id', $id)->findOneColumn('description');
+ }
+
public function create($projectId, $title, $description)
{
return $this->db->table(self::TABLE)->persist(array(