Add tab for create, update and remove user group

refs #5543
This commit is contained in:
Eric Lippmann 2015-10-01 10:03:29 +02:00
parent 631f5d8071
commit 380c8743c0
9 changed files with 46 additions and 36 deletions

View File

@ -156,8 +156,7 @@ class GroupController extends AuthBackendController
$form->setRepository($backend);
$form->add()->handleRequest();
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New User Group'));
}
/**
@ -181,8 +180,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Update User Group'));
}
/**
@ -204,8 +202,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Remove User Group'));
}
/**
@ -232,8 +229,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
}
$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New User Group Member'));
}
/**

View File

@ -3,7 +3,7 @@
</div>
<div class="content">
<?= $this->qlink(
$this->translate('Create A New Resource') ,
$this->translate('Create a New Resource') ,
'config/createresource',
null,
array(

View File

@ -3,7 +3,7 @@
</div>
<div class="content">
<?= $this->qlink(
$this->translate('Create A New User Backend') ,
$this->translate('Create a New User Backend') ,
'config/createuserbackend',
null,
array(

View File

@ -25,12 +25,29 @@ if (! isset($backend)) {
$extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible;
}
?>
<?php if ($extensible): ?>
<?= $this->qlink(
$this->translate('Add a New User Group') ,
'group/add',
array('backend' => $backend->getName()),
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user')
)
) ?>
<?php endif ?>
<?php
// @TODO(el): Remove $firstRow stuff
$firstRow = true;
foreach ($groups as $group): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false; ?>
<table data-base-target="_next" class="action group-list alternating">
<table data-base-target="_next" class="action-table listing-table">
<thead>
<tr>
<th class="group-name"><?= $this->translate('Group'); ?></th>
@ -72,11 +89,4 @@ foreach ($groups as $group): ?>
<?php else: ?>
<p><?= $this->translate('No groups found matching the filter'); ?></p>
<?php endif ?>
<?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new group'), 'group/add', array('backend' => $backend->getName()), array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'group-add'
)); ?>
<?php endif ?>
</div>
</div>

View File

@ -1,4 +1,4 @@
<?php
<?php
use Icinga\Data\Extensible;
use Icinga\Data\Updatable;
@ -50,6 +50,20 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
<?php endif ?>
</div>
<div class="content members" data-base-target="_next">
<?php if ($extensible): ?>
<?= $this->qlink(
$this->translate('Add User to Group') ,
'group/addmember',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Add user to group')
)
) ?>
<?php endif ?>
<?php
$firstRow = true;
@ -97,14 +111,4 @@ foreach ($members as $member): ?>
<?php else: ?>
<p><?= $this->translate('No group member found matching the filter'); ?></p>
<?php endif ?>
<?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new member'), 'group/addmember', array(
'backend' => $backend->getName(),
'group' => $group->group_name
), array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'member-add'
)); ?>
<?php endif ?>
</div>
</div>

View File

@ -9,7 +9,7 @@
<?php endif ?>
<div class="content">
<?= $this->qlink(
$this->translate('Create A New Navigation Item') ,
$this->translate('Create a New Navigation Item') ,
'navigation/add',
null,
array(

View File

@ -3,7 +3,7 @@
</div>
<div class="content">
<?= $this->qlink(
$this->translate('Create A New Role') ,
$this->translate('Create a New Role') ,
'role/add',
null,
array(

View File

@ -3,7 +3,7 @@
</div>
<div class="content">
<?= $this->qlink(
$this->translate('Create A New User Group Backend') ,
$this->translate('Create a New User Group Backend') ,
'usergroupbackend/create',
null,
array(

View File

@ -6,7 +6,7 @@
<div>
<h2><?= $this->translate('Monitoring Backends') ?></h2>
<?= $this->qlink(
$this->translate('Create A New Monitoring Backend') ,
$this->translate('Create a New Monitoring Backend') ,
'monitoring/config/createbackend',
null,
array(
@ -61,7 +61,7 @@
<div>
<h2><?= $this->translate('Command Transports') ?></h2>
<?= $this->qlink(
$this->translate('Create A New Command Transport') ,
$this->translate('Create a New Command Transport') ,
'monitoring/config/createtransport',
null,
array(