Use task description templates in bulk task creation

This commit is contained in:
Frederic Guillot
2017-11-03 10:57:00 -07:00
parent 78a2d3142c
commit e6f8a76a18
32 changed files with 54 additions and 2 deletions

View File

@@ -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(