From e6f8a76a188960512ced32133b85686d9a8d9090 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 3 Nov 2017 10:57:00 -0700 Subject: Use task description templates in bulk task creation --- app/Model/PredefinedTaskDescriptionModel.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/Model/PredefinedTaskDescriptionModel.php') 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( -- cgit v1.2.3