diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-16 20:55:21 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-16 20:55:21 -0400 |
commit | 4514bc1d4b4abff23902e46da76e70f13a3647eb (patch) | |
tree | fb4f03d47f49bd8acc6fbae943ac44ac58df9540 /app/Template | |
parent | abdf6f97800e7e838b5841820815385b183bab67 (diff) |
Improve user controllers and views
Diffstat (limited to 'app/Template')
37 files changed, 129 insertions, 133 deletions
diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index b6c27ae0..fa7c0ca6 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -15,7 +15,7 @@ 'autofocus', 'required', 'placeholder="'.t('Leave a comment').'"', - 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"', + 'data-mention-search-url="'.$this->url->href('UserAjaxController', 'mention', array('project_id' => $task['project_id'])).'"', ), 'markdown-editor' ) ?> diff --git a/app/Template/comments/create.php b/app/Template/comments/create.php index a638d3b8..633f4392 100644 --- a/app/Template/comments/create.php +++ b/app/Template/comments/create.php @@ -12,7 +12,7 @@ 'data-markdown-editor-disable-toolbar="true"', 'required', 'placeholder="'.t('Leave a comment').'"', - 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"', + 'data-mention-search-url="'.$this->url->href('UserAjaxController', 'mention', array('project_id' => $task['project_id'])).'"', ), 'markdown-editor' ) ?> diff --git a/app/Template/group/index.php b/app/Template/group/index.php index 74e074c3..1062e18c 100644 --- a/app/Template/group/index.php +++ b/app/Template/group/index.php @@ -1,7 +1,7 @@ <section id="main"> <div class="page-header"> <ul> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'UserListController', 'show') ?></li> <li><i class="fa fa-user-plus fa-fw"></i><?= $this->url->link(t('New group'), 'GroupCreationController', 'show', array(), false, 'popover') ?></li> </ul> </div> diff --git a/app/Template/group/users.php b/app/Template/group/users.php index 0f802146..a4895ab7 100644 --- a/app/Template/group/users.php +++ b/app/Template/group/users.php @@ -19,10 +19,10 @@ <?php foreach ($paginator->getCollection() as $user): ?> <tr> <td> - <?= $this->url->link('#'.$user['id'], 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link('#'.$user['id'], 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </td> <td> - <?= $this->url->link($this->text->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link($this->text->e($user['username']), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </td> <td> <?= $this->text->e($user['name']) ?> diff --git a/app/Template/header.php b/app/Template/header.php index bac026d3..23906a9e 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -67,16 +67,16 @@ </li> <li> <i class="fa fa-home fa-fw"></i> - <?= $this->url->link(t('My profile'), 'user', 'show', array('user_id' => $this->user->getId())) ?> + <?= $this->url->link(t('My profile'), 'UserViewController', 'show', array('user_id' => $this->user->getId())) ?> </li> <li> <i class="fa fa-folder fa-fw"></i> <?= $this->url->link(t('Projects management'), 'project', 'index') ?> </li> - <?php if ($this->user->hasAccess('user', 'index')): ?> + <?php if ($this->user->hasAccess('UserListController', 'show')): ?> <li> <i class="fa fa-user fa-fw"></i> - <?= $this->url->link(t('Users management'), 'user', 'index') ?> + <?= $this->url->link(t('Users management'), 'UserListController', 'show') ?> </li> <li> <i class="fa fa-group fa-fw"></i> diff --git a/app/Template/layout.php b/app/Template/layout.php index 701b297d..ff29e18f 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -44,7 +44,7 @@ <?= $this->hook->render('template:layout:head') ?> </head> - <body data-status-url="<?= $this->url->href('UserHelper', 'status') ?>" + <body data-status-url="<?= $this->url->href('UserAjaxController', 'status') ?>" data-login-url="<?= $this->url->href('auth', 'login') ?>" data-keyboard-shortcut-url="<?= $this->url->href('Doc', 'shortcuts') ?>" data-timezone="<?= $this->app->getTimezone() ?>" diff --git a/app/Template/project_permission/index.php b/app/Template/project_permission/index.php index 6d1fc15c..6c454a28 100644 --- a/app/Template/project_permission/index.php +++ b/app/Template/project_permission/index.php @@ -51,7 +51,7 @@ 'placeholder="'.t('Enter user name...').'"', 'title="'.t('Enter user name...').'"', 'data-dst-field="user_id"', - 'data-search-url="'.$this->url->href('UserHelper', 'autocomplete').'"', + 'data-search-url="'.$this->url->href('UserAjaxController', 'autocomplete').'"', ), 'autocomplete') ?> diff --git a/app/Template/task/time_tracking_details.php b/app/Template/task/time_tracking_details.php index c51b8f5a..d86273c5 100644 --- a/app/Template/task/time_tracking_details.php +++ b/app/Template/task/time_tracking_details.php @@ -18,7 +18,7 @@ </tr> <?php foreach ($subtask_paginator->getCollection() as $record): ?> <tr> - <td><?= $this->url->link($this->text->e($record['user_fullname'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td> + <td><?= $this->url->link($this->text->e($record['user_fullname'] ?: $record['username']), 'UserViewController', 'show', array('user_id' => $record['user_id'])) ?></td> <td><?= t($record['subtask_title']) ?></td> <td><?= $this->dt->datetime($record['start']) ?></td> <td><?= $this->dt->datetime($record['end']) ?></td> @@ -28,4 +28,4 @@ </table> <?= $subtask_paginator ?> -<?php endif ?>
\ No newline at end of file +<?php endif ?> diff --git a/app/Template/task/transitions.php b/app/Template/task/transitions.php index 83040177..9e04c4e1 100644 --- a/app/Template/task/transitions.php +++ b/app/Template/task/transitions.php @@ -22,9 +22,9 @@ <td><?= $this->dt->datetime($transition['date']) ?></td> <td><?= $this->text->e($transition['src_column']) ?></td> <td><?= $this->text->e($transition['dst_column']) ?></td> - <td><?= $this->url->link($this->text->e($transition['name'] ?: $transition['username']), 'user', 'show', array('user_id' => $transition['user_id'])) ?></td> + <td><?= $this->url->link($this->text->e($transition['name'] ?: $transition['username']), 'UserViewController', 'show', array('user_id' => $transition['user_id'])) ?></td> <td><?= $this->dt->duration($transition['time_spent']) ?></td> </tr> <?php endforeach ?> </table> -<?php endif ?>
\ No newline at end of file +<?php endif ?> diff --git a/app/Template/task_creation/show.php b/app/Template/task_creation/show.php index d3991177..cecf459d 100644 --- a/app/Template/task_creation/show.php +++ b/app/Template/task_creation/show.php @@ -18,7 +18,7 @@ array( 'placeholder="'.t('Leave a description').'"', 'tabindex="2"', - 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $values['project_id'])).'"' + 'data-mention-search-url="'.$this->url->href('UserAjaxController', 'mention', array('project_id' => $values['project_id'])).'"' ), 'markdown-editor' ) ?> diff --git a/app/Template/task_internal_link/table.php b/app/Template/task_internal_link/table.php index 8f25b29b..57a3536c 100644 --- a/app/Template/task_internal_link/table.php +++ b/app/Template/task_internal_link/table.php @@ -52,7 +52,7 @@ <td> <?php if (! empty($link['task_assignee_username'])): ?> <?php if ($editable): ?> - <?= $this->url->link($this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?> + <?= $this->url->link($this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'UserViewController', 'show', array('user_id' => $link['task_assignee_id'])) ?> <?php else: ?> <?= $this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?> <?php endif ?> @@ -82,4 +82,4 @@ <?php endforeach ?> <?php endforeach ?> </table> -<?php endif ?>
\ No newline at end of file +<?php endif ?> diff --git a/app/Template/task_modification/edit_description.php b/app/Template/task_modification/edit_description.php index 8c149f4f..801b4005 100644 --- a/app/Template/task_modification/edit_description.php +++ b/app/Template/task_modification/edit_description.php @@ -14,7 +14,7 @@ array( 'autofocus', 'placeholder="'.t('Leave a description').'"', - 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"' + 'data-mention-search-url="'.$this->url->href('UserAjaxController', 'mention', array('project_id' => $task['project_id'])).'"' ), 'markdown-editor' ) ?> diff --git a/app/Template/twofactor/disable.php b/app/Template/twofactor/disable.php index 36be4ef9..bdbe1233 100644 --- a/app/Template/twofactor/disable.php +++ b/app/Template/twofactor/disable.php @@ -9,6 +9,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'twofactor', 'disable', array('user_id' => $user['id'], 'disable' => 'yes'), true, 'btn btn-red') ?> - <?= t('or') ?> <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= t('or') ?> <?= $this->url->link(t('cancel'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </div> -</div>
\ No newline at end of file +</div> diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php deleted file mode 100644 index 9da43ced..00000000 --- a/app/Template/user/sidebar.php +++ /dev/null @@ -1,83 +0,0 @@ -<div class="sidebar"> - <h2><?= t('Information') ?></h2> - <ul> - <?php if ($this->user->hasAccess('user', 'show')): ?> - <li <?= $this->app->checkMenuSelection('user', 'show') ?>> - <?= $this->url->link(t('Summary'), 'user', 'show', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - <?php if ($this->user->isAdmin()): ?> - <li> - <?= $this->url->link(t('User dashboard'), 'DashboardController', 'show', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - <?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?> - <li <?= $this->app->checkMenuSelection('user', 'timesheet') ?>> - <?= $this->url->link(t('Time tracking'), 'user', 'timesheet', array('user_id' => $user['id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('user', 'last') ?>> - <?= $this->url->link(t('Last logins'), 'user', 'last', array('user_id' => $user['id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('user', 'sessions') ?>> - <?= $this->url->link(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('user', 'passwordReset') ?>> - <?= $this->url->link(t('Password reset history'), 'user', 'passwordReset', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - - <?= $this->hook->render('template:user:sidebar:information', array('user' => $user)) ?> - </ul> - - <h2><?= t('Actions') ?></h2> - <ul> - <?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?> - - <?php if ($this->user->hasAccess('user', 'edit')): ?> - <li <?= $this->app->checkMenuSelection('user', 'edit') ?>> - <?= $this->url->link(t('Edit profile'), 'user', 'edit', array('user_id' => $user['id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('AvatarFile') ?>> - <?= $this->url->link(t('Avatar'), 'AvatarFile', 'show', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - - <?php if ($user['is_ldap_user'] == 0): ?> - <li <?= $this->app->checkMenuSelection('user', 'password') ?>> - <?= $this->url->link(t('Change password'), 'user', 'password', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - - <?php if ($this->user->isCurrentUser($user['id'])): ?> - <li <?= $this->app->checkMenuSelection('twofactor', 'index') ?>> - <?= $this->url->link(t('Two factor authentication'), 'twofactor', 'index', array('user_id' => $user['id'])) ?> - </li> - <?php elseif ($this->user->hasAccess('twofactor', 'disable') && $user['twofactor_activated'] == 1): ?> - <li <?= $this->app->checkMenuSelection('twofactor', 'disable') ?>> - <?= $this->url->link(t('Two factor authentication'), 'twofactor', 'disable', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - - <li <?= $this->app->checkMenuSelection('user', 'share') ?>> - <?= $this->url->link(t('Public access'), 'user', 'share', array('user_id' => $user['id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('user', 'notifications') ?>> - <?= $this->url->link(t('Notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('user', 'external') ?>> - <?= $this->url->link(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?> - </li> - <li <?= $this->app->checkMenuSelection('user', 'integrations') ?>> - <?= $this->url->link(t('Integrations'), 'user', 'integrations', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - - <?php if ($this->user->hasAccess('user', 'authentication')): ?> - <li <?= $this->app->checkMenuSelection('user', 'authentication') ?>> - <?= $this->url->link(t('Edit Authentication'), 'user', 'authentication', array('user_id' => $user['id'])) ?> - </li> - <?php endif ?> - - <?= $this->hook->render('template:user:sidebar:actions', array('user' => $user)) ?> - </ul> -</div> diff --git a/app/Template/user_creation/local.php b/app/Template/user_creation/local.php index a83074e8..4c224cec 100644 --- a/app/Template/user_creation/local.php +++ b/app/Template/user_creation/local.php @@ -40,6 +40,6 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + <?= $this->url->link(t('cancel'), 'UserListController', 'show', array(), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/user_creation/remote.php b/app/Template/user_creation/remote.php index 5266fce8..dc4981a4 100644 --- a/app/Template/user_creation/remote.php +++ b/app/Template/user_creation/remote.php @@ -39,7 +39,7 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + <?= $this->url->link(t('cancel'), 'UserListController', 'show', array(), false, 'close-popover') ?> </div> </form> <div class="alert alert-info"> diff --git a/app/Template/user_import/show.php b/app/Template/user_import/show.php index 54a66237..663f107e 100644 --- a/app/Template/user_import/show.php +++ b/app/Template/user_import/show.php @@ -36,6 +36,6 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Import') ?></button> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + <?= $this->url->link(t('cancel'), 'UserListController', 'show', array(), false, 'close-popover') ?> </div> </form> diff --git a/app/Template/user/dropdown.php b/app/Template/user_list/dropdown.php index 086bf01b..9e90c230 100644 --- a/app/Template/user/dropdown.php +++ b/app/Template/user_list/dropdown.php @@ -3,7 +3,7 @@ <ul> <li> <i class="fa fa-user fa-fw"></i> - <?= $this->url->link(t('View profile'), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link(t('View profile'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </li> <?php if ($user['is_active'] == 1 && $this->user->hasAccess('UserStatusController', 'disable') && ! $this->user->isCurrentUser($user['id'])): ?> <li> diff --git a/app/Template/user/index.php b/app/Template/user_list/show.php index 15923e84..b2bd9377 100644 --- a/app/Template/user/index.php +++ b/app/Template/user_list/show.php @@ -30,7 +30,7 @@ <?= '#'.$user['id'] ?> </td> <td> - <?= $this->url->link($this->text->e($user['username']), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link($this->text->e($user['username']), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </td> <td> <?= $this->text->e($user['name']) ?> @@ -55,7 +55,7 @@ <?php endif ?> </td> <td> - <?= $this->render('user/dropdown', array('user' => $user)) ?> + <?= $this->render('user_list/dropdown', array('user' => $user)) ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/user_status/disable.php b/app/Template/user_status/disable.php index b551b3b8..d30b0c20 100644 --- a/app/Template/user_status/disable.php +++ b/app/Template/user_status/disable.php @@ -8,6 +8,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'UserStatusController', 'disable', array('user_id' => $user['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + <?= $this->url->link(t('cancel'), 'UserListController', 'show', array(), false, 'close-popover') ?> </div> </div> diff --git a/app/Template/user_status/enable.php b/app/Template/user_status/enable.php index fe527047..29d25eee 100644 --- a/app/Template/user_status/enable.php +++ b/app/Template/user_status/enable.php @@ -8,6 +8,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'UserStatusController', 'enable', array('user_id' => $user['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + <?= $this->url->link(t('cancel'), 'UserListController', 'show', array(), false, 'close-popover') ?> </div> </div> diff --git a/app/Template/user_status/remove.php b/app/Template/user_status/remove.php index c8458092..2b8f2df5 100644 --- a/app/Template/user_status/remove.php +++ b/app/Template/user_status/remove.php @@ -8,6 +8,6 @@ <div class="form-actions"> <?= $this->url->link(t('Yes'), 'UserStatusController', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'index', array(), false, 'close-popover') ?> + <?= $this->url->link(t('cancel'), 'UserListController', 'show', array(), false, 'close-popover') ?> </div> </div> diff --git a/app/Template/user/authentication.php b/app/Template/user_view/authentication.php index 6cfd4e57..44643388 100644 --- a/app/Template/user/authentication.php +++ b/app/Template/user_view/authentication.php @@ -1,8 +1,7 @@ <div class="page-header"> <h2><?= t('Edit Authentication') ?></h2> </div> -<form method="post" action="<?= $this->url->href('user', 'authentication', array('user_id' => $user['id'])) ?>" autocomplete="off"> - +<form method="post" action="<?= $this->url->href('UserViewController', 'authentication', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> @@ -16,7 +15,7 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link(t('cancel'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </div> <div class="alert alert-info"> @@ -25,4 +24,4 @@ <li><?= t('If you check the box "Disallow login form", credentials entered in the login form will be ignored.') ?></li> </ul> </div> -</form>
\ No newline at end of file +</form> diff --git a/app/Template/user/edit.php b/app/Template/user_view/edit.php index 7b51eb73..18947905 100644 --- a/app/Template/user/edit.php +++ b/app/Template/user_view/edit.php @@ -1,7 +1,7 @@ <div class="page-header"> <h2><?= t('Edit user') ?></h2> </div> -<form method="post" action="<?= $this->url->href('user', 'edit', array('user_id' => $user['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('UserViewController', 'edit', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> @@ -30,6 +30,6 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link(t('cancel'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </div> -</form>
\ No newline at end of file +</form> diff --git a/app/Template/user/external.php b/app/Template/user_view/external.php index 22c25af2..22c25af2 100644 --- a/app/Template/user/external.php +++ b/app/Template/user_view/external.php diff --git a/app/Template/user/integrations.php b/app/Template/user_view/integrations.php index ef9d8e71..4a237346 100644 --- a/app/Template/user/integrations.php +++ b/app/Template/user_view/integrations.php @@ -2,7 +2,7 @@ <h2><?= t('Integrations') ?></h2> </div> -<form method="post" action="<?= $this->url->href('user', 'integrations', array('user_id' => $user['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('UserViewController', 'integrations', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?php $hooks = $this->hook->render('template:user:integrations', array('values' => $values)) ?> <?php if (! empty($hooks)): ?> diff --git a/app/Template/user/last.php b/app/Template/user_view/last.php index 3de4d5e2..3de4d5e2 100644 --- a/app/Template/user/last.php +++ b/app/Template/user_view/last.php diff --git a/app/Template/user/layout.php b/app/Template/user_view/layout.php index 2c4bb7be..c3604b99 100644 --- a/app/Template/user/layout.php +++ b/app/Template/user_view/layout.php @@ -2,7 +2,7 @@ <div class="page-header"> <?php if ($this->user->hasAccess('UserCreationController', 'show')): ?> <ul> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> + <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'UserListController', 'show') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New local user'), 'UserCreationController', 'show', array(), false, 'popover') ?></li> <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('New remote user'), 'UserCreationController', 'show', array('remote' => 1), false, 'popover') ?></li> <li><i class="fa fa-upload fa-fw"></i><?= $this->url->link(t('Import'), 'UserImportController', 'show', array(), false, 'popover') ?></li> @@ -11,7 +11,7 @@ <?php endif ?> </div> <section class="sidebar-container" id="user-section"> - <?= $this->render('user/sidebar', array('user' => $user)) ?> + <?= $this->render('user_view/sidebar', array('user' => $user)) ?> <div class="sidebar-content"> <?= $content_for_sublayout ?> </div> diff --git a/app/Template/user/notifications.php b/app/Template/user_view/notifications.php index 6e1a0004..84ca1282 100644 --- a/app/Template/user/notifications.php +++ b/app/Template/user_view/notifications.php @@ -2,7 +2,7 @@ <h2><?= t('Notifications') ?></h2> </div> -<form method="post" action="<?= $this->url->href('user', 'notifications', array('user_id' => $user['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('UserViewController', 'notifications', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <h4><?= t('Notification methods:') ?></h4> @@ -21,6 +21,6 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link(t('cancel'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </div> -</form>
\ No newline at end of file +</form> diff --git a/app/Template/user/password.php b/app/Template/user_view/password.php index ea6e997d..32ff9d5c 100644 --- a/app/Template/user/password.php +++ b/app/Template/user_view/password.php @@ -2,7 +2,7 @@ <h2><?= t('Password modification') ?></h2> </div> -<form method="post" action="<?= $this->url->href('user', 'password', array('user_id' => $user['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('UserViewController', 'password', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->hidden('id', $values) ?> <?= $this->form->csrf() ?> @@ -21,6 +21,6 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> + <?= $this->url->link(t('cancel'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> </div> </form> diff --git a/app/Template/user/password_reset.php b/app/Template/user_view/password_reset.php index 1371ce11..1371ce11 100644 --- a/app/Template/user/password_reset.php +++ b/app/Template/user_view/password_reset.php diff --git a/app/Template/user/profile.php b/app/Template/user_view/profile.php index 9c9d3282..9c9d3282 100644 --- a/app/Template/user/profile.php +++ b/app/Template/user_view/profile.php diff --git a/app/Template/user/sessions.php b/app/Template/user_view/sessions.php index d7fe895d..eda3ef7f 100644 --- a/app/Template/user/sessions.php +++ b/app/Template/user_view/sessions.php @@ -19,7 +19,7 @@ <td><?= $this->dt->datetime($session['expiration']) ?></td> <td><?= $this->text->e($session['ip']) ?></td> <td><?= $this->text->e($session['user_agent']) ?></td> - <td><?= $this->url->link(t('Remove'), 'User', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td> + <td><?= $this->url->link(t('Remove'), 'UserViewController', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td> </tr> <?php endforeach ?> </table> diff --git a/app/Template/user/share.php b/app/Template/user_view/share.php index 56dc8675..9ef150e8 100644 --- a/app/Template/user/share.php +++ b/app/Template/user_view/share.php @@ -3,16 +3,13 @@ </div> <?php if (! empty($user['token'])): ?> - <div class="listing"> <ul class="no-bullet"> <li><strong><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'feed', 'user', array('token' => $user['token']), false, '', '', true) ?></strong></li> <li><strong><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ical', 'user', array('token' => $user['token']), false, '', '', true) ?></strong></li> </ul> </div> - - <?= $this->url->link(t('Disable public access'), 'user', 'share', array('user_id' => $user['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> - + <?= $this->url->link(t('Disable public access'), 'UserViewController', 'share', array('user_id' => $user['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> <?php else: ?> - <?= $this->url->link(t('Enable public access'), 'user', 'share', array('user_id' => $user['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> + <?= $this->url->link(t('Enable public access'), 'UserViewController', 'share', array('user_id' => $user['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?> <?php endif ?> diff --git a/app/Template/user/show.php b/app/Template/user_view/show.php index df0affb8..df0affb8 100644 --- a/app/Template/user/show.php +++ b/app/Template/user_view/show.php diff --git a/app/Template/user_view/sidebar.php b/app/Template/user_view/sidebar.php new file mode 100644 index 00000000..9a25df16 --- /dev/null +++ b/app/Template/user_view/sidebar.php @@ -0,0 +1,83 @@ +<div class="sidebar"> + <h2><?= t('Information') ?></h2> + <ul> + <?php if ($this->user->hasAccess('UserViewController', 'show')): ?> + <li <?= $this->app->checkMenuSelection('UserViewController', 'show') ?>> + <?= $this->url->link(t('Summary'), 'UserViewController', 'show', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + <?php if ($this->user->isAdmin()): ?> + <li> + <?= $this->url->link(t('User dashboard'), 'DashboardController', 'show', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + <?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?> + <li <?= $this->app->checkMenuSelection('UserViewController', 'timesheet') ?>> + <?= $this->url->link(t('Time tracking'), 'UserViewController', 'timesheet', array('user_id' => $user['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('UserViewController', 'lastLogin') ?>> + <?= $this->url->link(t('Last logins'), 'UserViewController', 'lastLogin', array('user_id' => $user['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('UserViewController', 'sessions') ?>> + <?= $this->url->link(t('Persistent connections'), 'UserViewController', 'sessions', array('user_id' => $user['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('UserViewController', 'passwordReset') ?>> + <?= $this->url->link(t('Password reset history'), 'UserViewController', 'passwordReset', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + + <?= $this->hook->render('template:user:sidebar:information', array('user' => $user)) ?> + </ul> + + <h2><?= t('Actions') ?></h2> + <ul> + <?php if ($this->user->isAdmin() || $this->user->isCurrentUser($user['id'])): ?> + + <?php if ($this->user->hasAccess('UserViewController', 'edit')): ?> + <li <?= $this->app->checkMenuSelection('UserViewController', 'edit') ?>> + <?= $this->url->link(t('Edit profile'), 'UserViewController', 'edit', array('user_id' => $user['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('AvatarFile') ?>> + <?= $this->url->link(t('Avatar'), 'AvatarFile', 'show', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + + <?php if ($user['is_ldap_user'] == 0): ?> + <li <?= $this->app->checkMenuSelection('UserViewController', 'password') ?>> + <?= $this->url->link(t('Change password'), 'UserViewController', 'password', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + + <?php if ($this->user->isCurrentUser($user['id'])): ?> + <li <?= $this->app->checkMenuSelection('twofactor', 'index') ?>> + <?= $this->url->link(t('Two factor authentication'), 'twofactor', 'index', array('user_id' => $user['id'])) ?> + </li> + <?php elseif ($this->user->hasAccess('twofactor', 'disable') && $user['twofactor_activated'] == 1): ?> + <li <?= $this->app->checkMenuSelection('twofactor', 'disable') ?>> + <?= $this->url->link(t('Two factor authentication'), 'twofactor', 'disable', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + + <li <?= $this->app->checkMenuSelection('UserViewController', 'share') ?>> + <?= $this->url->link(t('Public access'), 'UserViewController', 'share', array('user_id' => $user['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('UserViewController', 'notifications') ?>> + <?= $this->url->link(t('Notifications'), 'UserViewController', 'notifications', array('user_id' => $user['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('UserViewController', 'external') ?>> + <?= $this->url->link(t('External accounts'), 'UserViewController', 'external', array('user_id' => $user['id'])) ?> + </li> + <li <?= $this->app->checkMenuSelection('UserViewController', 'integrations') ?>> + <?= $this->url->link(t('Integrations'), 'UserViewController', 'integrations', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + + <?php if ($this->user->hasAccess('UserViewController', 'authentication')): ?> + <li <?= $this->app->checkMenuSelection('UserViewController', 'authentication') ?>> + <?= $this->url->link(t('Edit Authentication'), 'UserViewController', 'authentication', array('user_id' => $user['id'])) ?> + </li> + <?php endif ?> + + <?= $this->hook->render('template:user:sidebar:actions', array('user' => $user)) ?> + </ul> +</div> diff --git a/app/Template/user/timesheet.php b/app/Template/user_view/timesheet.php index 92ebafb5..92ebafb5 100644 --- a/app/Template/user/timesheet.php +++ b/app/Template/user_view/timesheet.php |