summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/GroupMember.php17
-rw-r--r--app/Model/TaskFinder.php2
2 files changed, 19 insertions, 0 deletions
diff --git a/app/Model/GroupMember.php b/app/Model/GroupMember.php
index 7ed5f733..14041704 100644
--- a/app/Model/GroupMember.php
+++ b/app/Model/GroupMember.php
@@ -108,4 +108,21 @@ class GroupMember extends Base
->eq('user_id', $user_id)
->exists();
}
+
+ /**
+ * Get all groups for a given user
+ *
+ * @access public
+ * @param integer $user_id
+ * @return array
+ */
+ public function getGroups($user_id)
+ {
+ return $this->db->table(self::TABLE)
+ ->columns(Group::TABLE.'.id', Group::TABLE.'.name')
+ ->join(Group::TABLE, 'id', 'group_id')
+ ->eq(self::TABLE.'.user_id', $user_id)
+ ->asc(Group::TABLE.'.name')
+ ->findAll();
+ }
}
diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php
index d406b794..0b2cbb84 100644
--- a/app/Model/TaskFinder.php
+++ b/app/Model/TaskFinder.php
@@ -35,6 +35,7 @@ class TaskFinder extends Base
Task::TABLE.'.date_started',
Task::TABLE.'.project_id',
Task::TABLE.'.color_id',
+ Task::TABLE.'.priority',
Task::TABLE.'.time_spent',
Task::TABLE.'.time_estimated',
Project::TABLE.'.name AS project_name',
@@ -67,6 +68,7 @@ class TaskFinder extends Base
'tasks.date_creation',
'tasks.project_id',
'tasks.color_id',
+ 'tasks.priority',
'tasks.time_spent',
'tasks.time_estimated',
'projects.name AS project_name'