Unverified Commit 5beec17f authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(aclrole) Fix ACL edition screen

issue #6119
Showing with 12 additions and 16 deletions
+12 -16
...@@ -7,9 +7,10 @@ ...@@ -7,9 +7,10 @@
<input type="submit" formnovalidate="formnovalidate" name="add_cancel" value="{msgPool type=cancelButton}"/> <input type="submit" formnovalidate="formnovalidate" name="add_cancel" value="{msgPool type=cancelButton}"/>
</p> </p>
{elseif $dialogState eq 'edit'} {elseif $dialogState eq 'edit'}
{function makeCheckbox id='' label='' checked=false} {function makeCheckbox key='' infos='' attr='' acl='' rights=''}
<input id="acl_{$id}" type="checkbox" name="acl_{$id}"{if $checked} checked="checked"{/if}/> {$checked = (strpos($rights, $acl) !== FALSE)}
<label for="acl_{$id}">{$label}</label> <input id="acl_{$infos.tname}_{$attr}_{$acl}" type="checkbox" name="acl_{$key}_{$attr}_{$acl}"{if $checked} checked="checked"{/if}/>
<label for="acl_{$infos.tname}_{$attr}_{$acl}">{$label}</label>
{/function} {/function}
<input type="hidden" name="acl_dummy_0_0_0" value="1"/> <input type="hidden" name="acl_dummy_0_0_0" value="1"/>
...@@ -55,26 +56,26 @@ ...@@ -55,26 +56,26 @@
<tr> <tr>
<td colspan="2"> <td colspan="2">
{if $infos.rights.create} {if $infos.rights.create}
{makeCheckbox id={$infos.tname|cat:'_0_c'} label=_("Create objects") checked=preg_match('/c/', $infos.globalAcl)}&nbsp;&nbsp; {makeCheckbox key=$key infos=$infos attr=0 acl=c label=_("Create objects") rights=$infos.globalAcl}&nbsp;&nbsp;
{/if} {/if}
{if $infos.rights.move} {if $infos.rights.move}
{makeCheckbox id={$infos.tname|cat:'_0_m'} label=_("Move objects") checked=preg_match('/m/', $infos.globalAcl)}&nbsp;&nbsp; {makeCheckbox key=$key infos=$infos attr=0 acl=m label=_("Move objects") rights=$infos.globalAcl}&nbsp;&nbsp;
{/if} {/if}
{if $infos.rights.remove} {if $infos.rights.remove}
{makeCheckbox id={$infos.tname|cat:'_0_d'} label=_("Remove objects") checked=preg_match('/d/', $infos.globalAcl)}&nbsp;&nbsp; {makeCheckbox key=$key infos=$infos attr=0 acl=d label=_("Remove objects") rights=$infos.globalAcl}&nbsp;&nbsp;
{/if} {/if}
{if $infos.rights.self} {if $infos.rights.self}
{makeCheckbox id={$infos.tname|cat:'_0_s'} label=_("Grant permission to owner") checked=preg_match('/s/', $infos.globalAcl)}&nbsp;&nbsp; {makeCheckbox key=$key infos=$infos attr=0 acl=s label=_("Grant permission to owner") rights=$infos.globalAcl}&nbsp;&nbsp;
{/if} {/if}
</td> </td>
<td> <td>
{if ($infos.rights.read||$infos.rights.write)} {if ($infos.rights.read||$infos.rights.write)}
&nbsp;{t}Complete object{/t}: &nbsp;{t}Complete object{/t}:
{if $infos.rights.read} {if $infos.rights.read}
{makeCheckbox id={$infos.tname|cat:'_0_r'} label=_("read") checked=preg_match('/r/', $infos.globalAcl)}&nbsp;&nbsp; {makeCheckbox key=$key infos=$infos attr=0 acl=r label=_("read") rights=$infos.globalAcl}&nbsp;&nbsp;
{/if} {/if}
{if $infos.rights.write} {if $infos.rights.write}
{makeCheckbox id={$infos.tname|cat:'_0_w'} label=_("write") checked=preg_match('/w/', $infos.globalAcl)} {makeCheckbox key=$key infos=$infos attr=0 acl=w label=_("write") rights=$infos.globalAcl}
{/if} {/if}
{/if} {/if}
</td> </td>
...@@ -104,13 +105,8 @@ ...@@ -104,13 +105,8 @@
{/if} {/if}
<td> <td>
<b>{$dsc}</b> ({$attr})<br/> <b>{$dsc}</b> ({$attr})<br/>
{$rchecked = preg_match('/r/', $state)} {makeCheckbox key=$key infos=$infos attr=$attr acl=r label=_("read") rights=$state}
{$wchecked = preg_match('/w/', $state)} {makeCheckbox key=$key infos=$infos attr=$attr acl=w label=_("write") rights=$state}
<input id="acl_{$infos.tname}_{$attr}_r" type="checkbox" name="acl_{$key}_{$attr}_r"{if $rchecked} checked="checked"{/if}/>
<label for="acl_{$infos.tname}_{$attr}_r">{t}read{/t}</label>
<input id="acl_{$infos.tname}_{$attr}_w" type="checkbox" name="acl_{$key}_{$attr}_w"{if $wchecked} checked="checked"{/if}/>
<label for="acl_{$infos.tname}_{$attr}_w">{t}write{/t}</label>
</td> </td>
{* Close table row *} {* Close table row *}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment