From c83f589b22cd548c6de10bfb0c18f767ba7dffd8 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 17 Dec 2015 21:38:13 -0500 Subject: Show only active projects in board selector --- app/Model/ProjectPermission.php | 2 +- app/Model/ProjectUserRole.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'app/Model') diff --git a/app/Model/ProjectPermission.php b/app/Model/ProjectPermission.php index f74b8587..4ad9bbf1 100644 --- a/app/Model/ProjectPermission.php +++ b/app/Model/ProjectPermission.php @@ -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)); } /** diff --git a/app/Model/ProjectUserRole.php b/app/Model/ProjectUserRole.php index 28e6c8c6..b2c38622 100644 --- a/app/Model/ProjectUserRole.php +++ b/app/Model/ProjectUserRole.php @@ -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 -- cgit v1.2.3