summaryrefslogtreecommitdiff
path: root/app/Controller/App.php
blob: 7fa97d4f7a3af7a2bfa7cc0a09319d618e386fc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

namespace Controller;

use Model\Project as ProjectModel;

/**
 * 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),
            'projects' => $this->project->getSummary($project_ids),
            'title' => t('Dashboard'),
        )));
    }
}