|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of Jitamin. |
|
5
|
|
|
* |
|
6
|
|
|
* Copyright (C) Jitamin Team |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Jitamin\Http\Controllers\Dashboard; |
|
13
|
|
|
|
|
14
|
|
|
use Jitamin\Http\Controllers\Controller; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Dashboard Controller. |
|
18
|
|
|
*/ |
|
19
|
|
|
class DashboardController extends Controller |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* Dashboard overview. |
|
23
|
|
|
*/ |
|
24
|
|
|
public function index() |
|
25
|
|
|
{ |
|
26
|
|
|
list($className, $method) = $this->helper->app->getDashboard(true); |
|
|
|
|
|
|
27
|
|
|
$controllerObject = new $className($this->container); |
|
28
|
|
|
|
|
29
|
|
|
return $controllerObject->{$method}(); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* My tasks. |
|
34
|
|
|
*/ |
|
35
|
|
View Code Duplication |
public function tasks() |
|
|
|
|
|
|
36
|
|
|
{ |
|
37
|
|
|
$user = $this->getUser(); |
|
38
|
|
|
|
|
39
|
|
|
$this->response->html($this->helper->layout->dashboard('dashboard/tasks', [ |
|
|
|
|
|
|
40
|
|
|
'title' => t('My tasks'), |
|
41
|
|
|
'paginator' => $this->taskPagination->getDashboardPaginator($user['id'], 'tasks', 50), |
|
|
|
|
|
|
42
|
|
|
'user' => $user, |
|
43
|
|
|
])); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* My subtasks. |
|
48
|
|
|
*/ |
|
49
|
|
View Code Duplication |
public function subtasks() |
|
|
|
|
|
|
50
|
|
|
{ |
|
51
|
|
|
$user = $this->getUser(); |
|
52
|
|
|
|
|
53
|
|
|
$this->response->html($this->helper->layout->dashboard('dashboard/subtasks', [ |
|
|
|
|
|
|
54
|
|
|
'title' => t('My subtasks'), |
|
55
|
|
|
'paginator' => $this->subtaskPagination->getDashboardPaginator($user['id'], 'subtasks', 50), |
|
|
|
|
|
|
56
|
|
|
'user' => $user, |
|
57
|
|
|
])); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* My activities. |
|
62
|
|
|
*/ |
|
63
|
|
View Code Duplication |
public function activities() |
|
|
|
|
|
|
64
|
|
|
{ |
|
65
|
|
|
$user = $this->getUser(); |
|
66
|
|
|
|
|
67
|
|
|
$this->response->html($this->helper->layout->dashboard('dashboard/activities', [ |
|
|
|
|
|
|
68
|
|
|
'title' => t('My activities'), |
|
69
|
|
|
'events' => $this->helper->projectActivity->getProjectsEvents($this->projectPermissionModel->getActiveProjectIds($user['id']), 100), |
|
|
|
|
|
|
70
|
|
|
'user' => $user, |
|
71
|
|
|
])); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* My calendar. |
|
76
|
|
|
*/ |
|
77
|
|
View Code Duplication |
public function calendar() |
|
|
|
|
|
|
78
|
|
|
{ |
|
79
|
|
|
$user = $this->getUser(); |
|
80
|
|
|
|
|
81
|
|
|
$this->response->html($this->helper->layout->dashboard('dashboard/calendar', [ |
|
|
|
|
|
|
82
|
|
|
'title' => t('My calendar'), |
|
83
|
|
|
'user' => $user, |
|
84
|
|
|
])); |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* My slider. |
|
89
|
|
|
*/ |
|
90
|
|
View Code Duplication |
public function slider() |
|
|
|
|
|
|
91
|
|
|
{ |
|
92
|
|
|
$user = $this->getUser(); |
|
93
|
|
|
|
|
94
|
|
|
$this->response->html($this->helper->layout->app('dashboard/slider', [ |
|
|
|
|
|
|
95
|
|
|
'title' => t('My slider'), |
|
96
|
|
|
'paginator' => $this->starPagination->getDashboardPaginator($user['id'], 'stars', 5), |
|
|
|
|
|
|
97
|
|
|
'user' => $user, |
|
98
|
|
|
])); |
|
99
|
|
|
} |
|
100
|
|
|
} |
|
101
|
|
|
|
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.