Add a dashboard (first version)

This commit is contained in:
Frédéric Guillot
2014-10-14 22:02:35 -04:00
parent d0e6d2e1f1
commit 286b193566
23 changed files with 218 additions and 44 deletions

View File

@@ -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'),
)));
}
}