diff --git a/app/Controller/App.php b/app/Controller/App.php index c4ed0fb8a..ef0a08a90 100644 --- a/app/Controller/App.php +++ b/app/Controller/App.php @@ -68,10 +68,11 @@ class App extends Base $this->response->html($this->template->layout('app/dashboard', array( 'title' => t('Dashboard'), 'board_selector' => $this->projectPermission->getAllowedProjects($user_id), - 'events' => $this->projectActivity->getProjects($project_ids, 10), + 'events' => $this->projectActivity->getProjects($project_ids, 5), 'task_paginator' => $task_paginator, 'subtask_paginator' => $subtask_paginator, 'project_paginator' => $project_paginator, + 'user_id' => $user_id, ))); } diff --git a/app/Controller/Calendar.php b/app/Controller/Calendar.php index 6b0c86196..abbcab7f0 100644 --- a/app/Controller/Calendar.php +++ b/app/Controller/Calendar.php @@ -2,6 +2,8 @@ namespace Controller; +use Model\Task; + /** * Project Calendar controller * @@ -35,7 +37,7 @@ class Calendar extends Base } /** - * Get tasks to display on the calendar + * Get tasks to display on the calendar (project view) * * @access public */ @@ -52,8 +54,30 @@ class Calendar extends Base ->filterByColor($this->request->getStringParam('color_id')) ->filterByStatus($this->request->getIntegerParam('is_active', -1)) ->filterByDueDateRange( - $this->request->getStringParam('start'), - $this->request->getStringParam('end') + $this->request->getStringParam('start'), + $this->request->getStringParam('end') + ) + ->toCalendarEvents() + ); + } + + /** + * Get tasks to display on the calendar (user view) + * + * @access public + */ + public function user() + { + $user_id = $this->request->getIntegerParam('user_id'); + + $this->response->json( + $this->taskFilter + ->create() + ->filterByOwner($user_id) + ->filterByStatus(Task::STATUS_OPEN) + ->filterByDueDateRange( + $this->request->getStringParam('start'), + $this->request->getStringParam('end') ) ->toCalendarEvents() ); diff --git a/app/Controller/User.php b/app/Controller/User.php index 91141241c..3736f20e5 100644 --- a/app/Controller/User.php +++ b/app/Controller/User.php @@ -189,6 +189,20 @@ class User extends Base ))); } + /** + * Display user calendar + * + * @access public + */ + public function calendar() + { + $user = $this->getUser(); + + $this->response->html($this->layout('user/calendar', array( + 'user' => $user, + ))); + } + /** * Display timesheet * diff --git a/app/Core/Helper.php b/app/Core/Helper.php index 25d580e96..c3ffe95a3 100644 --- a/app/Core/Helper.php +++ b/app/Core/Helper.php @@ -12,6 +12,7 @@ use Pimple\Container; * * @property \Core\Session $session * @property \Model\Acl $acl + * @property \Model\Config $config * @property \Model\User $user * @property \Model\UserSession $userSession */ diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index b312e29d3..07c05b895 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index bd3883420..af15c6b23 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index ec42cc9c3..b39e97933 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index c5f45e2da..9adc19e4b 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 8148361c8..2542a6fea 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -678,4 +678,6 @@ return array( 'Show/hide subtasks' => 'Afficher/cacher les sous-tâches', 'Show/hide tasks' => 'Afficher/cacher les tâches', 'Disable login form' => 'Désactiver le formulaire d\'authentification', + 'Show/hide calendar' => 'Afficher/cacher le calendrier', + 'User calendar' => 'Calendrier de l\'utilisateur', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index 25e330a23..8cbe6d8d0 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index ff8ac1cb9..98ed4a91e 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 12dfb9538..229622c5a 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 53e9e5504..e2cc3ab8b 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 368ce0e64..db640901b 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 134133ca5..513436af9 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index c0babf5ab..4958189fa 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index 3455739c0..962971f4f 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index ed9ab82bb..4c76d7ab6 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -676,4 +676,6 @@ return array( // 'Show/hide subtasks' => '', // 'Show/hide tasks' => '', // 'Disable login form' => '', + // 'Show/hide calendar' => '', + // 'User calendar' => '', ); diff --git a/app/Model/Acl.php b/app/Model/Acl.php index 56f2980bc..b6c0e6b8b 100644 --- a/app/Model/Acl.php +++ b/app/Model/Acl.php @@ -38,7 +38,7 @@ class Acl extends Base 'project' => array('show', 'tasks', 'search', 'activity'), 'subtask' => '*', 'task' => '*', - 'calendar' => '*', + 'calendar' => array('show', 'events', 'save'), ); /** diff --git a/app/Template/app/dashboard.php b/app/Template/app/dashboard.php index c29ae02e8..80f32feec 100644 --- a/app/Template/app/dashboard.php +++ b/app/Template/app/dashboard.php @@ -24,6 +24,9 @@