Add cost breakdown for project budget

This commit is contained in:
Frederic Guillot
2015-03-15 17:28:46 -04:00
parent 253996901a
commit 084272c60e
7 changed files with 142 additions and 6 deletions

View File

@@ -20,6 +20,24 @@ class HourlyRate extends Base
*/
const TABLE = 'hourly_rates';
/**
* Get all user rates for a given project
*
* @access public
* @param integer $project_id
* @return array
*/
public function getAllByProject($project_id)
{
$members = $this->projectPermission->getMembers($project_id);
if (empty($members)) {
return array();
}
return $this->db->table(self::TABLE)->in('user_id', array_keys($members))->desc('date_effective')->findAll();
}
/**
* Get all rates for a given user
*