{* $Id$ *} {title help="Permissions"}{if $objectType eq 'global'}{tr}Assign global permissions{/tr}{else}{tr}Assign permissions to {/tr}{$objectType}: {$objectName}{/if}{/title}
{if !empty($referer)}{button href="$referer" _class="btn btn-link" _type="link" _icon_name="back" _text="{tr}Back{/tr}"}{/if} {if $tiki_p_admin eq 'y'} {* only full admins can manage groups, not tiki_p_admin_users *} {button href="tiki-admingroups.php" class="btn btn-link" _type="link" _icon_name="group" _text="{tr}Admin Groups{/tr}"} {/if} {if $tiki_p_admin_users eq 'y'} {button href="tiki-adminusers.php" class="btn btn-link" _type="link" _icon_name="user" _text="{tr}Admin users{/tr}"} {/if} {if $tiki_p_admin_categories eq 'y'} {button href="tiki-admin_categories.php" class="btn btn-link" _type="link" _icon_name="admin_category" _text="{tr}Admin Categories{/tr}"} {/if} {button href="tiki-list_object_permissions.php" class="btn btn-link" _type="link" _icon_name="permission" _text="{tr}Object Permissions List{/tr}"}
{tabset name='tabs_objectpermissions'} {tab name="{tr}Assign Permissions{/tr}"} {if $prefs.feature_tabs neq 'y'}

{tr}Edit Permissions{/tr}

{/if}
{ticket} {capture name="notices"} {if empty($filegals_manager)} {if $objectType eq 'global'} {remarksbox type="note" title="{tr}Note{/tr}"} {tr}Currently editing Global permissions.{/tr} {/remarksbox} {elseif $permissions_displayed eq 'direct'} {remarksbox type="warning" title="{tr}Warning{/tr}"} {if $objectType neq 'category'} {tr}This object's direct permissions override any global permissions or category permissions affecting this object.{/tr} {else} {tr}This category's direct permissions override any global permissions affecting objects in it.{/tr} {/if}
{tr}To edit global permissions{/tr} {self_link objectType='global' objectId='' objectName='' permType=$permType _class='alert-link'}{tr}click here{/tr}{/self_link}. {/remarksbox} {elseif $permissions_displayed eq 'category'} {remarksbox type="warning" title="{tr}Warning{/tr}"} {tr}No permissions yet applied to this object but category permissions affect this object and are displayed below.{/tr}
{if $tiki_p_admin eq 'y'}{tr}To edit category permissions{/tr} {self_link _script='tiki-admin_categories.php' _class='alert-link'}{tr}click here{/tr}{/self_link}.{/if} {/remarksbox} {elseif $permissions_displayed eq 'parent'} {remarksbox type="warning" title="{tr}Warning{/tr}"} {tr}No permissions yet applied to this object but parent object's permissions affect this object and are displayed below.{/tr}
{if $tiki_p_admin eq 'y'}{tr}To edit parent object's permissions{/tr} {self_link objectType=$permissions_parent_type objectId=$permissions_parent_id objectName=$permissions_parent_name _class='alert-link'}{tr}click here{/tr}{/self_link}.{/if} {/remarksbox} {elseif $permissions_displayed eq 'global'} {remarksbox type="warning" title="{tr}Warning{/tr}" highlight="y"} {tr}No direct permissions yet applied to this object. Global permissions apply.{/tr}
{if $tiki_p_admin eq 'y'}{tr}To edit global permissions{/tr} {self_link objectType='global' permType=$permType _class='alert-link'}{tr}click here{/tr}{/self_link}.{/if}

{tr}Currently inherited permissions displayed.{/tr} {/remarksbox} {/if} {/if} {if $objectType eq 'category' and $groupRole} {remarksbox type="warning" title="{tr}Warning{/tr}"} {tr}This category's permissions are being managed by a Group Role.{/tr}
{/remarksbox} {/if} {/capture} {$smarty.capture.notices}

{if $objectType eq 'global'}{tr}Assign global permissions{/tr}{elseif $objectType eq 'category'}{tr}Assign permissions to this category{/tr}{else}{tr}Assign permissions to this object{/tr}{/if} {icon name="cog" id="perms_busy" style="vertical-align:top; display:none;"}

{if $permissions_displayed eq 'direct' and $objectType neq 'global'} {if $objectType == 'category'} {$value="{tr}Delete category permissions{/tr}"} {$title="{tr}This will remove all the settings here and permissions will be reset to inherit the global sitewide permissions.{/tr}"} {$confirm="{tr}Delete category permissions?{/tr}"} {else} {$value="{tr}Delete object permissions{/tr}"} {$title="{tr}This will remove all the settings here and permissions will be reset to inherit any category permissions that are set, or the global sitewide permissions.{/tr}"} {$confirm="{tr}Delete object permissions?{/tr}"} {/if} {if !empty($perms_clipboard_source)}{/if}
{if $objectType eq 'category'}

{jq} $("input[name='assign'],input[name='remove']").click(function(){ if ($("#propagate_category").prop("checked")) { return confirm("{tr}Are you sure you want to affect all child categories?\nThere is no undo.{/tr}"); } }); {/jq} {/if} {if ($objectType eq 'wiki' or $objectType eq 'wiki page') and !empty($inStructure)} {jq} $("input[name='assign'],input[name='remove']").click(function(){ if ($("#assignstructure").prop("checked")) { return confirm("{tr}Are you sure you want to affect all pages in this sub-structure?\nThere is no undo.{/tr}"); } }); {/jq} {/if}

{tr}Permissions{/tr}

{treetable _data=$perms _checkbox=$permGroups _checkboxTitles=$groupNames _checkboxTooltips=['_checkboxTitles', 'permDesc', 'permName'] _checkboxTooltipFormat='%0: %1 [%2]' _checkboxColumnIndex=$permGroupCols _valueColumnIndex="permName" _columns="\"label\"=\"{tr}Permission{/tr}\"" _groupColumn='type' _openall='y' _showSelected='y' _columnsContainHtml='y' class='table objectperms'}
{if ($perms|@count) eq '0'}{remarksbox type="warning" title="{tr}Warning{/tr}"}{tr}You must select at least one feature{/tr}.{/remarksbox}{/if}
{if $permissions_displayed eq 'direct' and $objectType neq 'global'} {/if}
{/tab} {if !empty($permissions_added) or !empty($permissions_removed)} {tab name="{tr}View Differences{/tr}"} {if !empty($permissions_added)}

{tr}Permissions added:{/tr}

{$permissions_added}
{/if} {if !empty($permissions_removed)}

{tr}Permissions removed:{/tr}

{$permissions_removed}
{/if} {/tab} {/if} {tab name="{tr}Select groups{/tr}"}
{if isset($groupsFiltered)} {remarksbox type="warning" title="{tr}Note{/tr}"} {tr}Some of your groups have been automatically hidden.
Select the groups below to assign permissions for.{/tr} {tr}These groups are not the groups that have permissions on the object. It is only the groups you can see in the columns of the first tab.{/tr} {/remarksbox} {else} {remarksbox type="note" title="{tr}Note{/tr}"} {tr}These groups are not the groups that have permissions on the object. It is only the groups you can see in the columns of the first tab.{/tr} {/remarksbox} {/if} {if $objectId}
{/if}

{tr}Groups{/tr}

{treetable _data=$groups _checkbox="group_filter" _checkboxTitles="{tr}Select all{/tr}" _checkboxColumnIndex="in_group_filter" _valueColumnIndex="id" _columns='"groupName"="{tr}Group name{/tr}","groupDesc"="{tr}Description{/tr}"' _sortColumn='parents' _collapseMaxSections=20 _sortColumnDelimiter=',' _selectAllHiddenToo='y'}
{/tab} {tab name="{tr}Select features{/tr}"}
{if isset($featuresFiltered)} {remarksbox type="warning" title="{tr}Warning{/tr}"} {tr}Some of your features have been automatically hidden.
Select the features below to assign permissions for.{/tr} {/remarksbox} {/if}

{tr}Features{/tr}

{treetable _data=$features _checkbox="feature_filter" _checkboxTitles="{tr}Select all{/tr}" _checkboxColumnIndex="in_feature_filter" _valueColumnIndex="featureName" _columns='"featureName"="{tr}Feature name{/tr}"' _sortColumn="featureName" _sortColumnDelimiter='*' _collapseMaxSections=20 _listFilter='n'}
{/tab} {* Quickperms *} {if $prefs.feature_quick_object_perms eq 'y'} {tab name="{tr}Quick Permissions{/tr}"}
{if $prefs.feature_tabs neq 'y'}

{tr}Quick Permissions{/tr}

{/if} {$smarty.capture.notices}

{tr}Assign Quick-Permissions to this object{/tr}

{foreach item=permgroup from=$quickperms} {/foreach} {section name=grp loop=$groups} {if $groups[grp].groupName neq 'Admins'} {foreach item=permgroup from=$quickperms} {/foreach} {/if} {/section}
{tr}Groups{/tr}{$permgroup.name}Advanced
{$groups[grp].groupName|escape}
{ticket}
{if empty($filegals_manager)} {remarksbox type="note" icon="bricks" title="{tr}Experimental{/tr}"} {tr}Quick permissions should be considered as an experimental feature.{/tr}
{tr}Although permissions will be set as expected using this form, it doesn't necessarily show the current permissions reliably.{/tr}

{tr}There is also no undo - Use with care!{/tr} {/remarksbox} {/if}
{/tab} {/if} {* Quickperms END *} {/tabset}