37 lines
1.0 KiB
PHP
37 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Controller;
|
|
|
|
use Model\Project as ProjectModel;
|
|
use Model\SubTask;
|
|
|
|
/**
|
|
* Application controller
|
|
*
|
|
* @package controller
|
|
* @author Frederic Guillot
|
|
*/
|
|
class App extends Base
|
|
{
|
|
/**
|
|
* Dashboard for the current user
|
|
*
|
|
* @access public
|
|
*/
|
|
public function index()
|
|
{
|
|
$user_id = $this->acl->getUserId();
|
|
$projects = $this->projectPermission->getMemberProjects($user_id);
|
|
$project_ids = array_keys($projects);
|
|
|
|
$this->response->html($this->template->layout('app/index', array(
|
|
'board_selector' => $this->projectPermission->getAllowedProjects($user_id),
|
|
'events' => $this->projectActivity->getProjects($project_ids, 10),
|
|
'tasks' => $this->taskFinder->getAllTasksByUser($user_id),
|
|
'subtasks' => $this->subTask->getAllByUser($user_id, array(SubTask::STATUS_TODO, SubTask::STATUS_INPROGRESS)),
|
|
'projects' => $this->project->getSummary($project_ids),
|
|
'title' => t('Dashboard'),
|
|
)));
|
|
}
|
|
}
|