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>
|
2012-11-08 10:31:50 +01:00
|
|
|
<legend><?php echo __('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-03-07 11:51:43 +01:00
|
|
|
<?php echo $this->Form->radio('permission', $options, array('value' => '3'));?>
|
|
|
|
<?php echo $this->Form->input('perm_sync', array('type' => 'checkbox', 'checked' => false));?>
|
|
|
|
<?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>
|
2012-06-28 17:24:12 +02:00
|
|
|
<?php echo $this->Form->end(__('Submit'));?>
|
|
|
|
</div>
|
2012-12-12 10:36:17 +01:00
|
|
|
|
|
|
|
<?php
|
2012-12-12 16:15:01 +01:00
|
|
|
$this->Js->get('#RolePermission0')->event('change', 'deactivateActions()');
|
|
|
|
$this->Js->get('#RolePermission1')->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() {
|
2012-12-12 16:15:01 +01:00
|
|
|
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) {
|
2012-12-12 16:15:01 +01:00
|
|
|
if ((document.getElementById("RolePermission0").checked) || (document.getElementById("RolePermission1").checked)) {
|
2012-12-12 10:36:17 +01:00
|
|
|
document.getElementById(id).checked = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<?php echo $this->Js->writeBuffer();
|