From 631f5d8071b150ccf1cf113f8f13ebad7d27e325 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 1 Oct 2015 09:39:21 +0200 Subject: [PATCH] Add tab for create, update and remove user refs #5543 --- application/controllers/UserController.php | 9 ++--- application/views/scripts/simple-form.phtml | 2 +- application/views/scripts/user/list.phtml | 23 ++++++++----- application/views/scripts/user/show.phtml | 38 ++++++++++----------- 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index 6160c40ae..d080c1dae 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -162,8 +162,7 @@ class UserController extends AuthBackendController $form->setRepository($backend); $form->add()->handleRequest(); - $this->view->form = $form; - $this->render('form'); + $this->renderForm($form, $this->translate('New User')); } /** @@ -185,8 +184,7 @@ class UserController extends AuthBackendController $this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName)); } - $this->view->form = $form; - $this->render('form'); + $this->renderForm($form, $this->translate('Update User')); } /** @@ -208,8 +206,7 @@ class UserController extends AuthBackendController $this->httpNotFound(sprintf($this->translate('User "%s" not found'), $userName)); } - $this->view->form = $form; - $this->render('form'); + $this->renderForm($form, $this->translate('Remove User')); } /** diff --git a/application/views/scripts/simple-form.phtml b/application/views/scripts/simple-form.phtml index 954edc263..9bcba74e2 100644 --- a/application/views/scripts/simple-form.phtml +++ b/application/views/scripts/simple-form.phtml @@ -2,5 +2,5 @@
- setTitle(null) ?> + create()->setTitle(null) // @TODO(el): create() has to be called because the UserForm is setting the title there ?>
diff --git a/application/views/scripts/user/list.phtml b/application/views/scripts/user/list.phtml index 6cc110628..c6b2b4ae4 100644 --- a/application/views/scripts/user/list.phtml +++ b/application/views/scripts/user/list.phtml @@ -29,11 +29,17 @@ $extensible = $this->hasPermission('config/authentication/users/add') && $backen $reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible; ?> - qlink($this->translate('Add a new user'), 'user/add', array('backend' => $backend->getName()), array( - 'icon' => 'plus', - 'data-base-target' => '_next', - 'class' => 'action-link button' - )) ?> + qlink( + $this->translate('Add a New User') , + 'user/add', + array('backend' => $backend->getName()), + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Create a new user') + ) + ) ?> @@ -59,7 +65,7 @@ $reducible = $this->hasPermission('config/authentication/users/remove') && $back ) ) ?> - diff --git a/application/views/scripts/user/show.phtml b/application/views/scripts/user/show.phtml index a5b9850e1..ee3aa6809 100644 --- a/application/views/scripts/user/show.phtml +++ b/application/views/scripts/user/show.phtml @@ -26,8 +26,8 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc compact): ?> -

escape($user->user_name); ?>

-
qlink( + qlink( null, 'user/remove', array( @@ -67,8 +73,9 @@ $reducible = $this->hasPermission('config/authentication/users/remove') && $back 'user' => $user->user_name ), array( - 'title' => sprintf($this->translate('Remove user %s'), $user->user_name), - 'icon' => 'cancel' + 'class' => 'action-link', + 'icon' => 'cancel', + 'title' => sprintf($this->translate('Remove user %s'), $user->user_name) ) ) ?>
+

escape($user->user_name) ?>

+
@@ -52,13 +52,26 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
+ + qlink( + $this->translate('Add User to Group') , + 'user/createmembership', + array('backend' => $backend->getName()), + array( + 'class' => 'button-link', + 'data-base-target' => '_next', + 'icon' => 'plus', + 'title' => $this->translate('Add user to user group') + ) + ) ?> + -
translate('State'); ?> is_active === null ? '-' : ($user->is_active ? $this->translate('Active') : $this->translate('Inactive')); ?>
+
@@ -98,19 +111,4 @@ foreach ($memberships as $membership): ?>

translate('No memberships found matching the filter'); ?>

- -qlink( - $this->translate('Create New Membership'), - 'user/createmembership', - array( - 'backend' => $backend->getName(), - 'user' => $user->user_name - ), - array( - 'icon' => 'plus', - 'data-base-target' => '_next', - 'class' => 'membership-create' - ) -); ?> - - \ No newline at end of file +
translate('Group'); ?>