From ed54d852dbd07c757c2a558bda71a2dab6981425 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 21 Mar 2015 18:16:04 -0400 Subject: Display projects on the dashboard and board selector when everybody allowed is checked --- app/Model/ProjectPermission.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'app/Model') diff --git a/app/Model/ProjectPermission.php b/app/Model/ProjectPermission.php index 12bd9309..d4f44f66 100644 --- a/app/Model/ProjectPermission.php +++ b/app/Model/ProjectPermission.php @@ -316,7 +316,10 @@ class ProjectPermission extends Base { return $this->db ->hashtable(Project::TABLE) - ->eq('user_id', $user_id) + ->beginOr() + ->eq(self::TABLE.'.user_id', $user_id) + ->eq(Project::TABLE.'.is_everybody_allowed', 1) + ->closeOr() ->join(self::TABLE, 'project_id', 'id') ->getAll('projects.id', 'name'); } @@ -332,7 +335,10 @@ class ProjectPermission extends Base { return $this->db ->table(Project::TABLE) - ->eq('user_id', $user_id) + ->beginOr() + ->eq(self::TABLE.'.user_id', $user_id) + ->eq(Project::TABLE.'.is_everybody_allowed', 1) + ->closeOr() ->join(self::TABLE, 'project_id', 'id') ->findAllByColumn('projects.id'); } @@ -348,7 +354,10 @@ class ProjectPermission extends Base { return $this->db ->table(Project::TABLE) - ->eq('user_id', $user_id) + ->beginOr() + ->eq(self::TABLE.'.user_id', $user_id) + ->eq(Project::TABLE.'.is_everybody_allowed', 1) + ->closeOr() ->eq(Project::TABLE.'.is_active', Project::ACTIVE) ->join(self::TABLE, 'project_id', 'id') ->findAllByColumn('projects.id'); @@ -365,7 +374,10 @@ class ProjectPermission extends Base { return $this->db ->hashtable(Project::TABLE) - ->eq('user_id', $user_id) + ->beginOr() + ->eq(self::TABLE.'.user_id', $user_id) + ->eq(Project::TABLE.'.is_everybody_allowed', 1) + ->closeOr() ->eq(Project::TABLE.'.is_active', Project::ACTIVE) ->join(self::TABLE, 'project_id', 'id') ->getAll('projects.id', 'name'); -- cgit v1.2.3