Merge pull request #1 from fguillot/master

please merge
This commit is contained in:
Busfreak
2015-12-23 00:18:32 +01:00
33 changed files with 937 additions and 399 deletions

View File

@@ -203,6 +203,7 @@ class Comment extends Base
new Validators\Integer('id', t('This value must be an integer')),
new Validators\Integer('task_id', t('This value must be an integer')),
new Validators\Integer('user_id', t('This value must be an integer')),
new Validators\MaxLength('reference', t('The maximum length is %d characters', 50), 50),
new Validators\Required('comment', t('Comment is required'))
);
}

View File

@@ -100,7 +100,7 @@ class ProjectPermission extends Base
*/
public function getActiveProjectIds($user_id)
{
return array_keys($this->projectUserRole->getProjectsByUser($user_id, array(Project::ACTIVE)));
return array_keys($this->projectUserRole->getActiveProjectsByUser($user_id));
}
/**

View File

@@ -20,7 +20,19 @@ class ProjectUserRole extends Base
const TABLE = 'project_has_users';
/**
* Get the list of project visible by the given user
* Get the list of active project for the given user
*
* @access public
* @param integer $user_id
* @return array
*/
public function getActiveProjectsByUser($user_id)
{
return $this->getProjectsByUser($user_id, $status = array(Project::ACTIVE));
}
/**
* Get the list of project visible for the given user
*
* @access public
* @param integer $user_id