diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-03-21 18:16:04 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-03-21 18:16:04 -0400 |
commit | ed54d852dbd07c757c2a558bda71a2dab6981425 (patch) | |
tree | 480ad475e24339aaf36433f79c9098187c7847a3 /app/Model | |
parent | dd066290e5b647639eadaca18d4c794e99b9ed4a (diff) |
Display projects on the dashboard and board selector when everybody allowed is checked
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/ProjectPermission.php | 20 |
1 files changed, 16 insertions, 4 deletions
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'); |