diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-16 20:19:07 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-16 20:19:07 -0400 |
commit | abdf6f97800e7e838b5841820815385b183bab67 (patch) | |
tree | 75576da4a975561d0b93c7bcc7be94a385a4cd75 /app | |
parent | de8ce875f4295e0b3bef20fcca051401f96816ef (diff) |
Improve group controllers and views
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/GroupAjaxController.php (renamed from app/Controller/GroupHelper.php) | 8 | ||||
-rw-r--r-- | app/Controller/GroupCreationController.php | 49 | ||||
-rw-r--r-- | app/Controller/GroupListController.php (renamed from app/Controller/Group.php) | 105 | ||||
-rw-r--r-- | app/Controller/GroupModificationController.php | 53 | ||||
-rw-r--r-- | app/ServiceProvider/AuthenticationProvider.php | 4 | ||||
-rw-r--r-- | app/ServiceProvider/RouteProvider.php | 9 | ||||
-rw-r--r-- | app/Template/group/associate.php | 41 | ||||
-rw-r--r-- | app/Template/group/create.php | 19 | ||||
-rw-r--r-- | app/Template/group/dissociate.php | 25 | ||||
-rw-r--r-- | app/Template/group/edit.php | 22 | ||||
-rw-r--r-- | app/Template/group/index.php | 12 | ||||
-rw-r--r-- | app/Template/group/remove.php | 25 | ||||
-rw-r--r-- | app/Template/group/users.php | 7 | ||||
-rw-r--r-- | app/Template/group_creation/show.php | 15 | ||||
-rw-r--r-- | app/Template/group_modification/show.php | 18 | ||||
-rw-r--r-- | app/Template/header.php | 2 | ||||
-rw-r--r-- | app/Template/project_permission/index.php | 2 | ||||
-rw-r--r-- | app/Template/user/index.php | 2 | ||||
-rw-r--r-- | app/Template/user/layout.php | 2 |
19 files changed, 207 insertions, 213 deletions
diff --git a/app/Controller/GroupHelper.php b/app/Controller/GroupAjaxController.php index 06e5ec71..496e9ef2 100644 --- a/app/Controller/GroupHelper.php +++ b/app/Controller/GroupAjaxController.php @@ -5,12 +5,12 @@ namespace Kanboard\Controller; use Kanboard\Formatter\GroupAutoCompleteFormatter; /** - * Group Helper + * Group Ajax Controller * - * @package controller - * @author Frederic Guillot + * @package Kanboard\Controller + * @author Frederic Guillot */ -class GroupHelper extends BaseController +class GroupAjaxController extends BaseController { /** * Group auto-completion (Ajax) diff --git a/app/Controller/GroupCreationController.php b/app/Controller/GroupCreationController.php new file mode 100644 index 00000000..7d0bb93c --- /dev/null +++ b/app/Controller/GroupCreationController.php @@ -0,0 +1,49 @@ +<?php + +namespace Kanboard\Controller; + +/** + * Class GroupCreationController + * + * @package Kanboard\Controller + * @author Frederic Guillot + */ +class GroupCreationController extends BaseController +{ + /** + * Display a form to create a new group + * + * @access public + * @param array $values + * @param array $errors + */ + public function show(array $values = array(), array $errors = array()) + { + $this->response->html($this->template->render('group_creation/show', array( + 'errors' => $errors, + 'values' => $values, + ))); + } + + /** + * Validate and save a new group + * + * @access public + */ + public function save() + { + $values = $this->request->getValues(); + list($valid, $errors) = $this->groupValidator->validateCreation($values); + + if ($valid) { + if ($this->group->create($values['name']) !== false) { + $this->flash->success(t('Group created successfully.')); + return $this->response->redirect($this->helper->url->to('GroupListController', 'index'), true); + } else { + $this->flash->failure(t('Unable to create your group.')); + } + } + + return $this->show($values, $errors); + } +} diff --git a/app/Controller/Group.php b/app/Controller/GroupListController.php index 2f91e72a..17f3b2a9 100644 --- a/app/Controller/Group.php +++ b/app/Controller/GroupListController.php @@ -5,10 +5,10 @@ namespace Kanboard\Controller; /** * Group Controller * - * @package controller - * @author Frederic Guillot + * @package Kanboard\Controller + * @author Frederic Guillot */ -class Group extends BaseController +class GroupListController extends BaseController { /** * List all groups @@ -18,7 +18,7 @@ class Group extends BaseController public function index() { $paginator = $this->paginator - ->setUrl('group', 'index') + ->setUrl('GroupListController', 'index') ->setMax(30) ->setOrder('name') ->setQuery($this->group->getQuery()) @@ -41,7 +41,7 @@ class Group extends BaseController $group = $this->group->getById($group_id); $paginator = $this->paginator - ->setUrl('group', 'users', array('group_id' => $group_id)) + ->setUrl('GroupListController', 'users', array('group_id' => $group_id)) ->setMax(30) ->setOrder('username') ->setQuery($this->groupMember->getQuery($group_id)) @@ -55,86 +55,6 @@ class Group extends BaseController } /** - * Display a form to create a new group - * - * @access public - * @param array $values - * @param array $errors - */ - public function create(array $values = array(), array $errors = array()) - { - $this->response->html($this->helper->layout->app('group/create', array( - 'errors' => $errors, - 'values' => $values, - 'title' => t('New group') - ))); - } - - /** - * Validate and save a new group - * - * @access public - */ - public function save() - { - $values = $this->request->getValues(); - list($valid, $errors) = $this->groupValidator->validateCreation($values); - - if ($valid) { - if ($this->group->create($values['name']) !== false) { - $this->flash->success(t('Group created successfully.')); - return $this->response->redirect($this->helper->url->to('group', 'index')); - } else { - $this->flash->failure(t('Unable to create your group.')); - } - } - - return $this->create($values, $errors); - } - - /** - * Display a form to update a group - * - * @access public - * @param array $values - * @param array $errors - */ - public function edit(array $values = array(), array $errors = array()) - { - if (empty($values)) { - $values = $this->group->getById($this->request->getIntegerParam('group_id')); - } - - $this->response->html($this->helper->layout->app('group/edit', array( - 'errors' => $errors, - 'values' => $values, - 'title' => t('Edit group') - ))); - } - - /** - * Validate and save a group - * - * @access public - */ - public function update() - { - $values = $this->request->getValues(); - list($valid, $errors) = $this->groupValidator->validateModification($values); - - if ($valid) { - if ($this->group->update($values) !== false) { - $this->flash->success(t('Group updated successfully.')); - return $this->response->redirect($this->helper->url->to('group', 'index')); - } else { - $this->flash->failure(t('Unable to update your group.')); - } - } - - return $this->edit($values, $errors); - } - - /** * Form to associate a user to a group * * @access public @@ -150,12 +70,11 @@ class Group extends BaseController $values['group_id'] = $group_id; } - $this->response->html($this->helper->layout->app('group/associate', array( + $this->response->html($this->template->render('group/associate', array( 'users' => $this->user->prepareList($this->groupMember->getNotMembers($group_id)), 'group' => $group, 'errors' => $errors, 'values' => $values, - 'title' => t('Add group member to "%s"', $group['name']), ))); } @@ -171,7 +90,7 @@ class Group extends BaseController if (isset($values['group_id']) && isset($values['user_id'])) { if ($this->groupMember->addUser($values['group_id'], $values['user_id'])) { $this->flash->success(t('Group member added successfully.')); - return $this->response->redirect($this->helper->url->to('group', 'users', array('group_id' => $values['group_id']))); + return $this->response->redirect($this->helper->url->to('GroupListController', 'users', array('group_id' => $values['group_id'])), true); } else { $this->flash->failure(t('Unable to add group member.')); } @@ -192,10 +111,9 @@ class Group extends BaseController $group = $this->group->getById($group_id); $user = $this->user->getById($user_id); - $this->response->html($this->helper->layout->app('group/dissociate', array( + $this->response->html($this->template->render('group/dissociate', array( 'group' => $group, 'user' => $user, - 'title' => t('Remove user from group "%s"', $group['name']), ))); } @@ -216,7 +134,7 @@ class Group extends BaseController $this->flash->failure(t('Unable to remove this user from the group.')); } - $this->response->redirect($this->helper->url->to('group', 'users', array('group_id' => $group_id))); + $this->response->redirect($this->helper->url->to('GroupListController', 'users', array('group_id' => $group_id)), true); } /** @@ -229,9 +147,8 @@ class Group extends BaseController $group_id = $this->request->getIntegerParam('group_id'); $group = $this->group->getById($group_id); - $this->response->html($this->helper->layout->app('group/remove', array( + $this->response->html($this->template->render('group/remove', array( 'group' => $group, - 'title' => t('Remove group'), ))); } @@ -251,6 +168,6 @@ class Group extends BaseController $this->flash->failure(t('Unable to remove this group.')); } - $this->response->redirect($this->helper->url->to('group', 'index')); + $this->response->redirect($this->helper->url->to('GroupListController', 'index'), true); } } diff --git a/app/Controller/GroupModificationController.php b/app/Controller/GroupModificationController.php new file mode 100644 index 00000000..1f225a14 --- /dev/null +++ b/app/Controller/GroupModificationController.php @@ -0,0 +1,53 @@ +<?php + +namespace Kanboard\Controller; + +/** + * Class GroupModificationController + * + * @package Kanboard\Controller + * @author Frederic Guillot + */ +class GroupModificationController extends BaseController +{ + /** + * Display a form to update a group + * + * @access public + * @param array $values + * @param array $errors + */ + public function show(array $values = array(), array $errors = array()) + { + if (empty($values)) { + $values = $this->group->getById($this->request->getIntegerParam('group_id')); + } + + $this->response->html($this->template->render('group_modification/show', array( + 'errors' => $errors, + 'values' => $values, + ))); + } + + /** + * Validate and save a group + * + * @access public + */ + public function save() + { + $values = $this->request->getValues(); + list($valid, $errors) = $this->groupValidator->validateModification($values); + + if ($valid) { + if ($this->group->update($values) !== false) { + $this->flash->success(t('Group updated successfully.')); + return $this->response->redirect($this->helper->url->to('GroupListController', 'index'), true); + } else { + $this->flash->failure(t('Unable to update your group.')); + } + } + + return $this->show($values, $errors); + } +} diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php index 82f61e11..5540bf88 100644 --- a/app/ServiceProvider/AuthenticationProvider.php +++ b/app/ServiceProvider/AuthenticationProvider.php @@ -132,7 +132,9 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->add('Config', '*', Role::APP_ADMIN); $acl->add('Currency', '*', Role::APP_ADMIN); $acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER); - $acl->add('Group', '*', Role::APP_ADMIN); + $acl->add('GroupListController', '*', Role::APP_ADMIN); + $acl->add('GroupCreationController', '*', Role::APP_ADMIN); + $acl->add('GroupModificationController', '*', Role::APP_ADMIN); $acl->add('Link', '*', Role::APP_ADMIN); $acl->add('ProjectCreation', 'create', Role::APP_MANAGER); $acl->add('Projectuser', '*', Role::APP_MANAGER); diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php index 2788e3a7..a6d6abef 100644 --- a/app/ServiceProvider/RouteProvider.php +++ b/app/ServiceProvider/RouteProvider.php @@ -161,13 +161,8 @@ class RouteProvider implements ServiceProviderInterface $container['route']->addRoute('user/:user_id/avatar', 'AvatarFile', 'show'); // Groups - $container['route']->addRoute('groups', 'group', 'index'); - $container['route']->addRoute('groups/create', 'group', 'create'); - $container['route']->addRoute('group/:group_id/associate', 'group', 'associate'); - $container['route']->addRoute('group/:group_id/dissociate/:user_id', 'group', 'dissociate'); - $container['route']->addRoute('group/:group_id/edit', 'group', 'edit'); - $container['route']->addRoute('group/:group_id/members', 'group', 'users'); - $container['route']->addRoute('group/:group_id/remove', 'group', 'confirm'); + $container['route']->addRoute('groups', 'GroupListController', 'index'); + $container['route']->addRoute('group/:group_id/members', 'GroupListController', 'users'); // Config $container['route']->addRoute('settings', 'config', 'index'); diff --git a/app/Template/group/associate.php b/app/Template/group/associate.php index 9de46f35..87787568 100644 --- a/app/Template/group/associate.php +++ b/app/Template/group/associate.php @@ -1,25 +1,20 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - </ul> - </div> - <?php if (empty($users)): ?> - <p class="alert"><?= t('There is no user available.') ?></p> - <?php else: ?> - <form method="post" action="<?= $this->url->href('group', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - <?= $this->form->hidden('group_id', $values) ?> +<div class="page-header"> + <h2><?= t('Add group member to "%s"', $group['name']) ?></h2> +</div> +<?php if (empty($users)): ?> + <p class="alert"><?= t('There is no user available.') ?></p> +<?php else: ?> + <form class="popover-form" method="post" action="<?= $this->url->href('GroupListController', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('group_id', $values) ?> - <?= $this->form->label(t('User'), 'user_id') ?> - <?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?> + <?= $this->form->label(t('User'), 'user_id') ?> + <?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?> - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> - </form> - <?php endif ?> -</section> + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?> + </div> + </form> +<?php endif ?> diff --git a/app/Template/group/create.php b/app/Template/group/create.php deleted file mode 100644 index 4ce6b1f3..00000000 --- a/app/Template/group/create.php +++ /dev/null @@ -1,19 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - </ul> - </div> - <form method="post" action="<?= $this->url->href('group', 'save') ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> - </form> -</section> diff --git a/app/Template/group/dissociate.php b/app/Template/group/dissociate.php index e1c60764..50ef6d61 100644 --- a/app/Template/group/dissociate.php +++ b/app/Template/group/dissociate.php @@ -1,17 +1,12 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - </ul> - </div> - <div class="confirm"> - <p class="alert alert-info"><?= t('Do you really want to remove the user "%s" from the group "%s"?', $user['name'] ?: $user['username'], $group['name']) ?></p> +<div class="page-header"> + <h2><?= t('Remove user from group "%s"', $group['name']) ?></h2> +</div> +<div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove the user "%s" from the group "%s"?', $user['name'] ?: $user['username'], $group['name']) ?></p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'group', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'users', array('group_id' => $group['id'])) ?> - </div> + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'GroupListController', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'users', array('group_id' => $group['id']), false, 'close-popover') ?> </div> -</section> +</div> diff --git a/app/Template/group/edit.php b/app/Template/group/edit.php deleted file mode 100644 index e9d9dd5a..00000000 --- a/app/Template/group/edit.php +++ /dev/null @@ -1,22 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - </ul> - </div> - <form method="post" action="<?= $this->url->href('group', 'update') ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('external_id', $values) ?> - - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> - </form> -</section> diff --git a/app/Template/group/index.php b/app/Template/group/index.php index 8302e5a8..74e074c3 100644 --- a/app/Template/group/index.php +++ b/app/Template/group/index.php @@ -2,7 +2,7 @@ <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-plus fa-fw"></i><?= $this->url->link(t('New group'), 'group', 'create') ?></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> <?php if ($paginator->isEmpty()): ?> @@ -24,16 +24,16 @@ <?= $this->text->e($group['external_id']) ?> </td> <td> - <?= $this->text->e($group['name']) ?> + <?= $this->url->link($this->text->e($group['name']), 'GroupListController', 'users', array('group_id' => $group['id'])) ?> </td> <td> <div class="dropdown"> <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> - <li><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> - <li><?= $this->url->link(t('Members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - <li><?= $this->url->link(t('Edit'), 'group', 'edit', array('group_id' => $group['id'])) ?></li> - <li><?= $this->url->link(t('Remove'), 'group', 'confirm', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Add group member'), 'GroupListController', 'associate', array('group_id' => $group['id']), false, 'popover') ?></li> + <li><?= $this->url->link(t('Members'), 'GroupListController', 'users', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Edit'), 'GroupModificationController', 'show', array('group_id' => $group['id']), false, 'popover') ?></li> + <li><?= $this->url->link(t('Remove'), 'GroupListController', 'confirm', array('group_id' => $group['id']), false, 'popover') ?></li> </ul> </div> </td> diff --git a/app/Template/group/remove.php b/app/Template/group/remove.php index 1cb007b1..408b3d83 100644 --- a/app/Template/group/remove.php +++ b/app/Template/group/remove.php @@ -1,17 +1,12 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - </ul> - </div> - <div class="confirm"> - <p class="alert alert-info"><?= t('Do you really want to remove this group: "%s"?', $group['name']) ?></p> +<div class="page-header"> + <h2><?= t('Remove group') ?></h2> +</div> +<div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove this group: "%s"?', $group['name']) ?></p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'group', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'GroupListController', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?> </div> -</section> +</div> diff --git a/app/Template/group/users.php b/app/Template/group/users.php index bbd41525..0f802146 100644 --- a/app/Template/group/users.php +++ b/app/Template/group/users.php @@ -1,8 +1,8 @@ <section id="main"> <div class="page-header"> <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'GroupListController', 'index') ?></li> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('Add group member'), 'GroupListController', 'associate', array('group_id' => $group['id']), false, 'popover') ?></li> </ul> </div> <?php if ($paginator->isEmpty()): ?> @@ -31,7 +31,8 @@ <a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a> </td> <td> - <?= $this->url->link(t('Remove this user'), 'group', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id'])) ?> + <i class="fa fa-times fa-fw" aria-hidden="true"></i> + <?= $this->url->link(t('Remove this user'), 'GroupListController', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id']), false, 'popover') ?> </td> </tr> <?php endforeach ?> diff --git a/app/Template/group_creation/show.php b/app/Template/group_creation/show.php new file mode 100644 index 00000000..b219bd70 --- /dev/null +++ b/app/Template/group_creation/show.php @@ -0,0 +1,15 @@ +<div class="page-header"> + <h2><?= t('New group') ?></h2> +</div> +<form class="popover-form" method="post" action="<?= $this->url->href('GroupCreationController', 'save') ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> + + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?> + </div> +</form> diff --git a/app/Template/group_modification/show.php b/app/Template/group_modification/show.php new file mode 100644 index 00000000..ddf07369 --- /dev/null +++ b/app/Template/group_modification/show.php @@ -0,0 +1,18 @@ +<div class="page-header"> + <h2><?= t('Edit group') ?></h2> +</div> +<form class="popover-form" method="post" action="<?= $this->url->href('GroupModificationController', 'save') ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('external_id', $values) ?> + + <?= $this->form->label(t('Name'), 'name') ?> + <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> + + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?> + </div> +</form> diff --git a/app/Template/header.php b/app/Template/header.php index f47b270f..bac026d3 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -80,7 +80,7 @@ </li> <li> <i class="fa fa-group fa-fw"></i> - <?= $this->url->link(t('Groups management'), 'group', 'index') ?> + <?= $this->url->link(t('Groups management'), 'GroupListController', 'index') ?> </li> <li> <i class="fa fa-cog fa-fw"></i> diff --git a/app/Template/project_permission/index.php b/app/Template/project_permission/index.php index a7d666a6..6d1fc15c 100644 --- a/app/Template/project_permission/index.php +++ b/app/Template/project_permission/index.php @@ -113,7 +113,7 @@ 'title="'.t('Enter group name...').'"', 'data-dst-field="group_id"', 'data-dst-extra-field="external_id"', - 'data-search-url="'.$this->url->href('GroupHelper', 'autocomplete').'"', + 'data-search-url="'.$this->url->href('GroupAjaxController', 'autocomplete').'"', ), 'autocomplete') ?> diff --git a/app/Template/user/index.php b/app/Template/user/index.php index b810373f..15923e84 100644 --- a/app/Template/user/index.php +++ b/app/Template/user/index.php @@ -5,7 +5,7 @@ <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> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'GroupListController', 'index') ?></li> </ul> <?php endif ?> </div> diff --git a/app/Template/user/layout.php b/app/Template/user/layout.php index 47df2997..2c4bb7be 100644 --- a/app/Template/user/layout.php +++ b/app/Template/user/layout.php @@ -6,7 +6,7 @@ <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> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'GroupListController', 'index') ?></li> </ul> <?php endif ?> </div> |