summaryrefslogtreecommitdiff
path: root/app/Model/ProjectPermission.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-01-25 11:55:12 -0500
committerFrederic Guillot <fred@kanboard.net>2015-01-25 11:55:12 -0500
commite506648cbcda0b6021cf0a3b5e2f6381d8f1d0ea (patch)
treecbb12b785f0ef33e725ef24a277fef7a682af5ff /app/Model/ProjectPermission.php
parent655d75a3cf154d14b10ffbf2baa42a549cf214f7 (diff)
Do not show inactive projects info on the dashboard and update picodb (merge #546)
Diffstat (limited to 'app/Model/ProjectPermission.php')
-rw-r--r--app/Model/ProjectPermission.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/app/Model/ProjectPermission.php b/app/Model/ProjectPermission.php
index 02f3b428..352677d9 100644
--- a/app/Model/ProjectPermission.php
+++ b/app/Model/ProjectPermission.php
@@ -315,10 +315,27 @@ class ProjectPermission extends Base
public function getMemberProjects($user_id)
{
return $this->db
- ->table(Project::TABLE)
+ ->hashtable(Project::TABLE)
+ ->eq('user_id', $user_id)
+ ->join(self::TABLE, 'project_id', 'id')
+ ->getAll('projects.id', 'name');
+ }
+
+ /**
+ * Return a list of active projects where the user is member
+ *
+ * @access public
+ * @param integer $user_id User id
+ * @return array
+ */
+ public function getActiveMemberProjects($user_id)
+ {
+ return $this->db
+ ->hashtable(Project::TABLE)
->eq('user_id', $user_id)
+ ->eq(Project::TABLE.'.is_active', Project::ACTIVE)
->join(self::TABLE, 'project_id', 'id')
- ->listing('projects.id', 'name');
+ ->getAll('projects.id', 'name');
}
/**