Improve group controllers and views
This commit is contained in:
@@ -5,12 +5,12 @@ namespace Kanboard\Controller;
|
|||||||
use Kanboard\Formatter\GroupAutoCompleteFormatter;
|
use Kanboard\Formatter\GroupAutoCompleteFormatter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group Helper
|
* Group Ajax Controller
|
||||||
*
|
*
|
||||||
* @package controller
|
* @package Kanboard\Controller
|
||||||
* @author Frederic Guillot
|
* @author Frederic Guillot
|
||||||
*/
|
*/
|
||||||
class GroupHelper extends BaseController
|
class GroupAjaxController extends BaseController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Group auto-completion (Ajax)
|
* Group auto-completion (Ajax)
|
||||||
49
app/Controller/GroupCreationController.php
Normal file
49
app/Controller/GroupCreationController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,10 +5,10 @@ namespace Kanboard\Controller;
|
|||||||
/**
|
/**
|
||||||
* Group Controller
|
* Group Controller
|
||||||
*
|
*
|
||||||
* @package controller
|
* @package Kanboard\Controller
|
||||||
* @author Frederic Guillot
|
* @author Frederic Guillot
|
||||||
*/
|
*/
|
||||||
class Group extends BaseController
|
class GroupListController extends BaseController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* List all groups
|
* List all groups
|
||||||
@@ -18,7 +18,7 @@ class Group extends BaseController
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$paginator = $this->paginator
|
$paginator = $this->paginator
|
||||||
->setUrl('group', 'index')
|
->setUrl('GroupListController', 'index')
|
||||||
->setMax(30)
|
->setMax(30)
|
||||||
->setOrder('name')
|
->setOrder('name')
|
||||||
->setQuery($this->group->getQuery())
|
->setQuery($this->group->getQuery())
|
||||||
@@ -41,7 +41,7 @@ class Group extends BaseController
|
|||||||
$group = $this->group->getById($group_id);
|
$group = $this->group->getById($group_id);
|
||||||
|
|
||||||
$paginator = $this->paginator
|
$paginator = $this->paginator
|
||||||
->setUrl('group', 'users', array('group_id' => $group_id))
|
->setUrl('GroupListController', 'users', array('group_id' => $group_id))
|
||||||
->setMax(30)
|
->setMax(30)
|
||||||
->setOrder('username')
|
->setOrder('username')
|
||||||
->setQuery($this->groupMember->getQuery($group_id))
|
->setQuery($this->groupMember->getQuery($group_id))
|
||||||
@@ -54,86 +54,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
|
* Form to associate a user to a group
|
||||||
*
|
*
|
||||||
@@ -150,12 +70,11 @@ class Group extends BaseController
|
|||||||
$values['group_id'] = $group_id;
|
$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)),
|
'users' => $this->user->prepareList($this->groupMember->getNotMembers($group_id)),
|
||||||
'group' => $group,
|
'group' => $group,
|
||||||
'errors' => $errors,
|
'errors' => $errors,
|
||||||
'values' => $values,
|
'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 (isset($values['group_id']) && isset($values['user_id'])) {
|
||||||
if ($this->groupMember->addUser($values['group_id'], $values['user_id'])) {
|
if ($this->groupMember->addUser($values['group_id'], $values['user_id'])) {
|
||||||
$this->flash->success(t('Group member added successfully.'));
|
$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 {
|
} else {
|
||||||
$this->flash->failure(t('Unable to add group member.'));
|
$this->flash->failure(t('Unable to add group member.'));
|
||||||
}
|
}
|
||||||
@@ -192,10 +111,9 @@ class Group extends BaseController
|
|||||||
$group = $this->group->getById($group_id);
|
$group = $this->group->getById($group_id);
|
||||||
$user = $this->user->getById($user_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,
|
'group' => $group,
|
||||||
'user' => $user,
|
'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->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_id = $this->request->getIntegerParam('group_id');
|
||||||
$group = $this->group->getById($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,
|
'group' => $group,
|
||||||
'title' => t('Remove group'),
|
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,6 +168,6 @@ class Group extends BaseController
|
|||||||
$this->flash->failure(t('Unable to remove this group.'));
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
53
app/Controller/GroupModificationController.php
Normal file
53
app/Controller/GroupModificationController.php
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -132,7 +132,9 @@ class AuthenticationProvider implements ServiceProviderInterface
|
|||||||
$acl->add('Config', '*', Role::APP_ADMIN);
|
$acl->add('Config', '*', Role::APP_ADMIN);
|
||||||
$acl->add('Currency', '*', Role::APP_ADMIN);
|
$acl->add('Currency', '*', Role::APP_ADMIN);
|
||||||
$acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER);
|
$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('Link', '*', Role::APP_ADMIN);
|
||||||
$acl->add('ProjectCreation', 'create', Role::APP_MANAGER);
|
$acl->add('ProjectCreation', 'create', Role::APP_MANAGER);
|
||||||
$acl->add('Projectuser', '*', Role::APP_MANAGER);
|
$acl->add('Projectuser', '*', Role::APP_MANAGER);
|
||||||
|
|||||||
@@ -161,13 +161,8 @@ class RouteProvider implements ServiceProviderInterface
|
|||||||
$container['route']->addRoute('user/:user_id/avatar', 'AvatarFile', 'show');
|
$container['route']->addRoute('user/:user_id/avatar', 'AvatarFile', 'show');
|
||||||
|
|
||||||
// Groups
|
// Groups
|
||||||
$container['route']->addRoute('groups', 'group', 'index');
|
$container['route']->addRoute('groups', 'GroupListController', 'index');
|
||||||
$container['route']->addRoute('groups/create', 'group', 'create');
|
$container['route']->addRoute('group/:group_id/members', 'GroupListController', 'users');
|
||||||
$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');
|
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
$container['route']->addRoute('settings', 'config', 'index');
|
$container['route']->addRoute('settings', 'config', 'index');
|
||||||
|
|||||||
@@ -1,25 +1,20 @@
|
|||||||
<section id="main">
|
<div class="page-header">
|
||||||
<div class="page-header">
|
<h2><?= t('Add group member to "%s"', $group['name']) ?></h2>
|
||||||
<ul>
|
</div>
|
||||||
<li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li>
|
<?php if (empty($users)): ?>
|
||||||
<li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li>
|
<p class="alert"><?= t('There is no user available.') ?></p>
|
||||||
</ul>
|
<?php else: ?>
|
||||||
</div>
|
<form class="popover-form" method="post" action="<?= $this->url->href('GroupListController', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off">
|
||||||
<?php if (empty($users)): ?>
|
<?= $this->form->csrf() ?>
|
||||||
<p class="alert"><?= t('There is no user available.') ?></p>
|
<?= $this->form->hidden('group_id', $values) ?>
|
||||||
<?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) ?>
|
|
||||||
|
|
||||||
<?= $this->form->label(t('User'), 'user_id') ?>
|
<?= $this->form->label(t('User'), 'user_id') ?>
|
||||||
<?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?>
|
<?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||||
<?= t('or') ?>
|
<?= t('or') ?>
|
||||||
<?= $this->url->link(t('cancel'), 'group', 'index') ?>
|
<?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</section>
|
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -1,17 +1,12 @@
|
|||||||
<section id="main">
|
<div class="page-header">
|
||||||
<div class="page-header">
|
<h2><?= t('Remove user from group "%s"', $group['name']) ?></h2>
|
||||||
<ul>
|
</div>
|
||||||
<li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li>
|
<div class="confirm">
|
||||||
<li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li>
|
<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>
|
||||||
</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="form-actions">
|
<div class="form-actions">
|
||||||
<?= $this->url->link(t('Yes'), 'group', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?>
|
<?= $this->url->link(t('Yes'), 'GroupListController', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?>
|
||||||
<?= t('or') ?>
|
<?= t('or') ?>
|
||||||
<?= $this->url->link(t('cancel'), 'group', 'users', array('group_id' => $group['id'])) ?>
|
<?= $this->url->link(t('cancel'), 'GroupListController', 'users', array('group_id' => $group['id']), false, 'close-popover') ?>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div>
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul>
|
<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'), '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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($paginator->isEmpty()): ?>
|
<?php if ($paginator->isEmpty()): ?>
|
||||||
@@ -24,16 +24,16 @@
|
|||||||
<?= $this->text->e($group['external_id']) ?>
|
<?= $this->text->e($group['external_id']) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->text->e($group['name']) ?>
|
<?= $this->url->link($this->text->e($group['name']), 'GroupListController', 'users', array('group_id' => $group['id'])) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="dropdown">
|
<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>
|
<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>
|
<ul>
|
||||||
<li><?= $this->url->link(t('Add group member'), 'group', 'associate', 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'), 'group', 'users', array('group_id' => $group['id'])) ?></li>
|
<li><?= $this->url->link(t('Members'), 'GroupListController', '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('Edit'), 'GroupModificationController', 'show', array('group_id' => $group['id']), false, 'popover') ?></li>
|
||||||
<li><?= $this->url->link(t('Remove'), 'group', 'confirm', array('group_id' => $group['id'])) ?></li>
|
<li><?= $this->url->link(t('Remove'), 'GroupListController', 'confirm', array('group_id' => $group['id']), false, 'popover') ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -1,17 +1,12 @@
|
|||||||
<section id="main">
|
<div class="page-header">
|
||||||
<div class="page-header">
|
<h2><?= t('Remove group') ?></h2>
|
||||||
<ul>
|
</div>
|
||||||
<li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li>
|
<div class="confirm">
|
||||||
<li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li>
|
<p class="alert alert-info"><?= t('Do you really want to remove this group: "%s"?', $group['name']) ?></p>
|
||||||
</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="form-actions">
|
<div class="form-actions">
|
||||||
<?= $this->url->link(t('Yes'), 'group', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?>
|
<?= $this->url->link(t('Yes'), 'GroupListController', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?>
|
||||||
<?= t('or') ?>
|
<?= t('or') ?>
|
||||||
<?= $this->url->link(t('cancel'), 'group', 'index') ?>
|
<?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<section id="main">
|
<section id="main">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<ul>
|
<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-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'), 'group', 'associate', array('group_id' => $group['id'])) ?></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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php if ($paginator->isEmpty()): ?>
|
<?php if ($paginator->isEmpty()): ?>
|
||||||
@@ -31,7 +31,8 @@
|
|||||||
<a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a>
|
<a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a>
|
||||||
</td>
|
</td>
|
||||||
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|||||||
15
app/Template/group_creation/show.php
Normal file
15
app/Template/group_creation/show.php
Normal file
@@ -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>
|
||||||
18
app/Template/group_modification/show.php
Normal file
18
app/Template/group_modification/show.php
Normal file
@@ -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>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-group fa-fw"></i>
|
<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>
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-cog fa-fw"></i>
|
<i class="fa fa-cog fa-fw"></i>
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
'title="'.t('Enter group name...').'"',
|
'title="'.t('Enter group name...').'"',
|
||||||
'data-dst-field="group_id"',
|
'data-dst-field="group_id"',
|
||||||
'data-dst-extra-field="external_id"',
|
'data-dst-extra-field="external_id"',
|
||||||
'data-search-url="'.$this->url->href('GroupHelper', 'autocomplete').'"',
|
'data-search-url="'.$this->url->href('GroupAjaxController', 'autocomplete').'"',
|
||||||
),
|
),
|
||||||
'autocomplete') ?>
|
'autocomplete') ?>
|
||||||
|
|
||||||
|
|||||||
@@ -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 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-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-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>
|
</ul>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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 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-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-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>
|
</ul>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user