diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-02-04 22:05:41 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-02-04 22:05:41 -0500 |
commit | 2d070627d751bf5728ec98a5efaf163532594cd9 (patch) | |
tree | 2f1781baea559e40230bb10dc394b56e8a7d6f22 /app | |
parent | 24300f828a684eedf71d63374effb2be95c13b1a (diff) |
Add user dashboard view
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/App.php | 20 | ||||
-rw-r--r-- | app/Locale/da_DK/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/de_DE/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/es_ES/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/fi_FI/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/fr_FR/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/hu_HU/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/it_IT/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/ja_JP/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/pl_PL/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/pt_BR/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/ru_RU/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/sv_SE/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/th_TH/translations.php | 1 | ||||
-rw-r--r-- | app/Locale/zh_CN/translations.php | 1 | ||||
-rw-r--r-- | app/Model/Acl.php | 1 | ||||
-rw-r--r-- | app/Template/user/sidebar.php | 6 |
17 files changed, 36 insertions, 5 deletions
diff --git a/app/Controller/App.php b/app/Controller/App.php index 6eab2bcd..11e3915c 100644 --- a/app/Controller/App.php +++ b/app/Controller/App.php @@ -23,33 +23,43 @@ class App extends Base } /** + * User dashboard view for admins + * + * @access public + */ + public function dashboard() + { + $this->index($this->request->getIntegerParam('user_id'), 'dashboard'); + } + + /** * Dashboard for the current user * * @access public */ - public function index() + public function index($user_id = 0, $action = 'index') { $status = array(SubTaskModel::STATUS_TODO, SubTaskModel::STATUS_INPROGRESS); - $user_id = $this->userSession->getId(); + $user_id = $user_id ?: $this->userSession->getId(); $projects = $this->projectPermission->getActiveMemberProjects($user_id); $project_ids = array_keys($projects); $task_paginator = $this->paginator - ->setUrl('app', 'index', array('pagination' => 'tasks')) + ->setUrl('app', $action, array('pagination' => 'tasks')) ->setMax(10) ->setOrder('tasks.id') ->setQuery($this->taskFinder->getUserQuery($user_id)) ->calculateOnlyIf($this->request->getStringParam('pagination') === 'tasks'); $subtask_paginator = $this->paginator - ->setUrl('app', 'index', array('pagination' => 'subtasks')) + ->setUrl('app', $action, array('pagination' => 'subtasks')) ->setMax(10) ->setOrder('tasks.id') ->setQuery($this->subTask->getUserQuery($user_id, $status)) ->calculateOnlyIf($this->request->getStringParam('pagination') === 'subtasks'); $project_paginator = $this->paginator - ->setUrl('app', 'index', array('pagination' => 'projects')) + ->setUrl('app', $action, array('pagination' => 'projects')) ->setMax(10) ->setOrder('name') ->setQuery($this->project->getQueryColumnStats($project_ids)) diff --git a/app/Locale/da_DK/translations.php b/app/Locale/da_DK/translations.php index 0946d143..b117a6e7 100644 --- a/app/Locale/da_DK/translations.php +++ b/app/Locale/da_DK/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/de_DE/translations.php b/app/Locale/de_DE/translations.php index 30662cff..6d7ef520 100644 --- a/app/Locale/de_DE/translations.php +++ b/app/Locale/de_DE/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/es_ES/translations.php b/app/Locale/es_ES/translations.php index 9bb0eb0e..bd17dbdb 100644 --- a/app/Locale/es_ES/translations.php +++ b/app/Locale/es_ES/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', 'Moved to column %s' => 'Movido a columna %s', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/fi_FI/translations.php b/app/Locale/fi_FI/translations.php index 608f5250..a7a422f4 100644 --- a/app/Locale/fi_FI/translations.php +++ b/app/Locale/fi_FI/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/fr_FR/translations.php b/app/Locale/fr_FR/translations.php index 0a2321c3..d520635a 100644 --- a/app/Locale/fr_FR/translations.php +++ b/app/Locale/fr_FR/translations.php @@ -700,4 +700,5 @@ return array( 'Add a comment logging moving the task between columns' => 'Ajouter un commentaire de log lorsqu\'une tâche est déplacée dans une autre colonne', 'Moved to column %s' => 'Tâche déplacée à la colonne %s', 'Change description' => 'Changer la description', + 'User dashboard' => 'Tableau de bord de l\'utilisateur', ); diff --git a/app/Locale/hu_HU/translations.php b/app/Locale/hu_HU/translations.php index 0fe260e7..06cf6242 100644 --- a/app/Locale/hu_HU/translations.php +++ b/app/Locale/hu_HU/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/it_IT/translations.php b/app/Locale/it_IT/translations.php index 6438a977..4dac7782 100644 --- a/app/Locale/it_IT/translations.php +++ b/app/Locale/it_IT/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/ja_JP/translations.php b/app/Locale/ja_JP/translations.php index 5817843c..abeac938 100644 --- a/app/Locale/ja_JP/translations.php +++ b/app/Locale/ja_JP/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/pl_PL/translations.php b/app/Locale/pl_PL/translations.php index 246f0dfc..301afa34 100644 --- a/app/Locale/pl_PL/translations.php +++ b/app/Locale/pl_PL/translations.php @@ -700,4 +700,5 @@ return array( 'Add a comment logging moving the task between columns' => 'Dodaj komentarz dokumentujący przeniesienie zadania pomiędzy kolumnami', 'Moved to column %s' => 'Przeniosiono do kolumny %s', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/pt_BR/translations.php b/app/Locale/pt_BR/translations.php index 28aedb39..d108e5f3 100644 --- a/app/Locale/pt_BR/translations.php +++ b/app/Locale/pt_BR/translations.php @@ -700,4 +700,5 @@ return array( 'Add a comment logging moving the task between columns' => 'Adicionar un comentário de log ao mover uma tarefa em outra coluna', 'Moved to column %s' => 'Mover para a coluna %s', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/ru_RU/translations.php b/app/Locale/ru_RU/translations.php index 6d080335..eaf8ea7e 100644 --- a/app/Locale/ru_RU/translations.php +++ b/app/Locale/ru_RU/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/sv_SE/translations.php b/app/Locale/sv_SE/translations.php index 7e78a7ad..14984dab 100644 --- a/app/Locale/sv_SE/translations.php +++ b/app/Locale/sv_SE/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/th_TH/translations.php b/app/Locale/th_TH/translations.php index 7c1b5725..5107950f 100644 --- a/app/Locale/th_TH/translations.php +++ b/app/Locale/th_TH/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Locale/zh_CN/translations.php b/app/Locale/zh_CN/translations.php index a9d1baac..ab867a7a 100644 --- a/app/Locale/zh_CN/translations.php +++ b/app/Locale/zh_CN/translations.php @@ -700,4 +700,5 @@ return array( // 'Add a comment logging moving the task between columns' => '', // 'Moved to column %s' => '', // 'Change description' => '', + // 'User dashboard' => '', ); diff --git a/app/Model/Acl.php b/app/Model/Acl.php index d1757a85..56f2980b 100644 --- a/app/Model/Acl.php +++ b/app/Model/Acl.php @@ -64,6 +64,7 @@ class Acl extends Base * @var array */ private $admin_acl = array( + 'app' => array('dashboard'), 'user' => array('index', 'create', 'save', 'remove'), 'config' => '*', 'project' => array('remove'), diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php index f74c8b01..4376aa18 100644 --- a/app/Template/user/sidebar.php +++ b/app/Template/user/sidebar.php @@ -29,6 +29,12 @@ <?= $this->a(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?> </li> <?php endif ?> + + <?php if ($this->userSession->isAdmin()): ?> + <li> + <?= $this->a(t('User dashboard'), 'app', 'dashboard', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> <?php if ($this->userSession->isAdmin() && ! $this->userSession->isCurrentUser($user['id'])): ?> <li> |