summaryrefslogtreecommitdiff
path: root/app/Controller/App.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-10-14 22:02:35 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-10-14 22:02:35 -0400
commit286b1935663ef3071ad6a0aae3078ad3a42b48e4 (patch)
tree80469612ac9feba9bea28c1ac7f263e680f52d49 /app/Controller/App.php
parentd0e6d2e1f177cfe533ea7819bf79b0469b8d0cc2 (diff)
Add a dashboard (first version)
Diffstat (limited to 'app/Controller/App.php')
-rw-r--r--app/Controller/App.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/app/Controller/App.php b/app/Controller/App.php
index b7f79b1d..feec4221 100644
--- a/app/Controller/App.php
+++ b/app/Controller/App.php
@@ -13,17 +13,21 @@ use Model\Project as ProjectModel;
class App extends Base
{
/**
- * Redirect to the project creation page or the board controller
+ * Dashboard for the current user
*
* @access public
*/
public function index()
{
- if ($this->project->countByStatus(ProjectModel::ACTIVE)) {
- $this->response->redirect('?controller=board');
- }
- else {
- $this->redirectNoProject();
- }
+ $user_id = $this->acl->getUserId();
+ $projects = $this->projectPermission->getAllowedProjects($user_id);
+
+ $this->response->html($this->template->layout('app_index', array(
+ 'board_selector' => $projects,
+ 'events' => $this->projectActivity->getProjects(array_keys($projects), 10),
+ 'tasks' => $this->taskFinder->getAllTasksByUser($user_id),
+ 'menu' => 'dashboard',
+ 'title' => t('Dashboard'),
+ )));
}
}