2012-12-12 16:15:01 +01:00
|
|
|
<div class="roles form">
|
|
|
|
<?php echo $this->Form->create('Role');?>
|
2012-06-28 17:24:12 +02:00
|
|
|
<fieldset>
|
2013-06-01 08:13:18 +02:00
|
|
|
<legend>Add Role</legend>
|
2012-06-28 17:24:12 +02:00
|
|
|
<?php
|
2012-10-31 17:10:59 +01:00
|
|
|
echo $this->Form->input('name');?>
|
2013-06-02 14:41:41 +02:00
|
|
|
<?php echo $this->Form->input('permission', array('type' => 'select', 'options' => $options), array('value' => '3'));?>
|
|
|
|
<div class = 'input clear'></div>
|
2013-06-01 08:13:18 +02:00
|
|
|
<?php echo $this->Form->input('perm_sync', array(
|
|
|
|
'type' => 'checkbox',
|
|
|
|
'checked' => false,
|
2013-06-02 14:41:41 +02:00
|
|
|
));?>
|
2013-03-07 11:51:43 +01:00
|
|
|
<?php echo $this->Form->input('perm_admin', array('type' => 'checkbox', 'checked' => false));?>
|
|
|
|
<?php echo $this->Form->input('perm_audit', array('type' => 'checkbox', 'checked' => false));?>
|
|
|
|
<?php echo $this->Form->input('perm_auth', array('type' => 'checkbox', 'checked' => false));?>
|
2012-10-31 17:10:59 +01:00
|
|
|
</fieldset>
|
2013-06-01 08:13:18 +02:00
|
|
|
<?php
|
|
|
|
echo $this->Form->button('Add', array('class' => 'btn btn-primary'));
|
|
|
|
echo $this->Form->end();
|
|
|
|
?>
|
|
|
|
</div>
|
2013-07-04 13:35:04 +02:00
|
|
|
<div class="actions <?php echo $debugMode;?>">
|
2013-06-01 08:13:18 +02:00
|
|
|
<ul class="nav nav-list">
|
|
|
|
<li><?php echo $this->Html->link('New User', array('controller' => 'users', 'action' => 'add', 'admin' => true)); ?> </li>
|
|
|
|
<li><?php echo $this->Html->link('List Users', array('controller' => 'users', 'action' => 'index', 'admin' => true)); ?> </li>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<?php if ($isSiteAdmin): ?>
|
|
|
|
<li class="active"><?php echo $this->Html->link('New Role', array('controller' => 'roles', 'action' => 'add', 'admin' => true)); ?> </li>
|
|
|
|
<?php endif; ?>
|
|
|
|
<li><?php echo $this->Html->link('List Roles', array('controller' => 'roles', 'action' => 'index', 'admin' => true)); ?> </li>
|
|
|
|
<?php if ($isSiteAdmin): ?>
|
|
|
|
<li class="divider"></li>
|
|
|
|
<li><?php echo $this->Html->link('Contact users', array('controller' => 'users', 'action' => 'email', 'admin' => true)); ?> </li>
|
|
|
|
<?php endif; ?>
|
|
|
|
</ul>
|
2012-06-28 17:24:12 +02:00
|
|
|
</div>
|
2012-12-12 10:36:17 +01:00
|
|
|
|
|
|
|
<?php
|
2013-06-02 14:41:41 +02:00
|
|
|
$this->Js->get('#RolePermission')->event('change', 'deactivateActions()');
|
2012-12-12 10:36:17 +01:00
|
|
|
|
2012-12-12 16:15:01 +01:00
|
|
|
$this->Js->get('#RolePermSync')->event('change', 'checkPerms("RolePermSync")');
|
|
|
|
$this->Js->get('#RolePermAdmin')->event('change', 'checkPerms("RolePermAdmin")');
|
|
|
|
$this->Js->get('#RolePermAudit')->event('change', 'checkPerms("RolePermAudit")');
|
2012-12-12 10:36:17 +01:00
|
|
|
?>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
// only be able to tick perm_sync if manage org events and above.
|
|
|
|
|
|
|
|
function deactivateActions() {
|
2013-06-02 14:41:41 +02:00
|
|
|
var e = document.getElementById("RolePermission");
|
|
|
|
if (e.options[e.selectedIndex].value == '0' || e.options[e.selectedIndex].value == '1') {
|
|
|
|
document.getElementById("RolePermSync").checked = false;
|
|
|
|
document.getElementById("RolePermAdmin").checked = false;
|
|
|
|
document.getElementById("RolePermAudit").checked = false;
|
|
|
|
}
|
2012-12-12 10:36:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function checkPerms(id) {
|
2013-06-02 14:41:41 +02:00
|
|
|
var e = document.getElementById("RolePermission");
|
|
|
|
if (e.options[e.selectedIndex].value == '0' || e.options[e.selectedIndex].value == '1') {
|
2012-12-12 10:36:17 +01:00
|
|
|
document.getElementById(id).checked = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<?php echo $this->Js->writeBuffer();
|