Add category description (merge and modify pull-request #692)

This commit is contained in:
Frederic Guillot
2015-04-11 16:26:45 -04:00
parent 52bc2efc65
commit d3727e92a6
13 changed files with 121 additions and 24 deletions

View File

@@ -73,6 +73,38 @@ class Category extends Base
->findOneColumn('id');
}
/**
* Prepare categories to be displayed on the board
*
* @access public
* @param integer $project_id
* @return array
*/
public function getBoardCategories($project_id)
{
$descriptions = array();
$listing = array(
-1 => t('All categories'),
0 => t('No category'),
);
$categories = $this->db->table(self::TABLE)
->eq('project_id', $project_id)
->asc('name')
->findAll();
foreach ($categories as $category) {
$listing[$category['id']] = $category['name'];
$descriptions[$category['id']] = $category['description'];
}
return array(
$listing,
$descriptions,
);
}
/**
* Return the list of all categories
*