summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-rw-r--r--app/Controller/App.php18
-rw-r--r--app/Controller/Project.php4
-rw-r--r--app/Controller/User.php2
3 files changed, 15 insertions, 9 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'),
+ )));
}
}
diff --git a/app/Controller/Project.php b/app/Controller/Project.php
index 1fac3ffb..503eb3a5 100644
--- a/app/Controller/Project.php
+++ b/app/Controller/Project.php
@@ -379,7 +379,7 @@ class Project extends Base
$project = $this->getProject();
$this->response->html($this->template->layout('project_activity', array(
- 'events' => $this->projectActivity->getAll($project['id']),
+ 'events' => $this->projectActivity->getProject($project['id']),
'menu' => 'projects',
'project' => $project,
'title' => t('%s\'s activity', $project['name'])
@@ -427,6 +427,7 @@ class Project extends Base
'project_id' => $project['id'],
),
'project' => $project,
+ 'menu' => 'projects',
'columns' => $this->board->getColumnsList($project['id']),
'categories' => $this->category->getList($project['id'], false),
'title' => $project['name'].($nb_tasks > 0 ? ' ('.$nb_tasks.')' : '')
@@ -461,6 +462,7 @@ class Project extends Base
'limit' => $limit,
),
'project' => $project,
+ 'menu' => 'projects',
'columns' => $this->board->getColumnsList($project['id']),
'categories' => $this->category->getList($project['id'], false),
'tasks' => $tasks,
diff --git a/app/Controller/User.php b/app/Controller/User.php
index bbed9f6f..834b2379 100644
--- a/app/Controller/User.php
+++ b/app/Controller/User.php
@@ -59,7 +59,7 @@ class User extends Base
$this->response->redirect('?'.$redirect_query);
}
else {
- $this->response->redirect('?controller=board');
+ $this->response->redirect('?controller=app');
}
}