<div id="bookdoc3">
<div class="ui-menu">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-corner-all" style="padding: 0px 0px 3px 0px">
<li class="ui-state-default ui-corner-all"><div id="saveit" style="display: none"><a href="#" title="Сохранить изменения" onclick="$('#grouperr').granatLoad({blockname: 'upderr', data: document.groupform, event: 'DocumentSetGroupsRights', success: function(){alert('Изменения сохранены.')}}); return false"><span>Сохранить</span></a></div></li>
</ul>
</div>

<div style="display: none"><div id="grouperr"><block name="upderr" /></div></div>


<form class="xF1" method="post" action="" name="groupform">
<div class="xWrap">

	<module package="customer" type="grouplist" dataset="grouplist" page="#_url_param_page">
		
		<table cellspacing="0" class="xT1" width="100%">
		<col width="15%" />
		<col width="20%" />
		<col width="20%" />
		<col width="5%" />
		<col width="5%" />
		<col width="5%" />
		<col width="5%" />
		<col width="5%" />
		<thead>
		<tr>
			<th>Имя группы</th>
			<td>Название</td>
			<td>Описание</td>
			<td class="center" title="Применить также ко всем дочерним документам"><img src="/i/ic/structure_brunch.png" alt="Поддерево"></td>
			<td class="center" title="Чтение текущего документа"><img src="/i/ic/page.png" alt="R"></td>
			<td class="center" title="Запись текущего документа"><img src="/i/ic/page_edit.png" alt="W"></td>
			<td class="center" title="Удаление текущего документа"><img src="/i/ic/page_delete.png" alt="D"></td>
			<td class="center" title="Добавление дочерних документов"><img src="/i/ic/page_add.png" alt="A"></td>
		</tr>
		</thead>
		<tbody>
		<list>
		<elem>
			<tr>
				<th>&nbsp;{#name}</th>
				<td>&nbsp;{#description}</td>
				<td>&nbsp;{#comments}</td>
				
				<td><input type="checkbox" title="Выставить этиже права на все поддерево" name="subtree[{#group_id}]" value="1" /></td>
				
				<td>
				<input type="hidden" name="rights[{#group_id}][permission_read]" value="0" />
				<input type="hidden" name="rights[{#group_id}][permission_write]" value="0" />
				<input type="hidden" name="rights[{#group_id}][permission_delete]" value="0" />
				<input type="hidden" name="rights[{#group_id}][permission_add_child]" value="0" />
				    <input type="checkbox" title="Права на чтение текущего документа" name="rights[{#group_id}][permission_read]" value="1" {permission_read()} /></td>
				<td><input type="checkbox" title="Права на изменение текущего документа" name="rights[{#group_id}][permission_write]" value="1" {permission_write()} /></td>
				<td><input type="checkbox" title="Права на удаление текущего документа" name="rights[{#group_id}][permission_delete]" value="1" {permission_delete()} /></td>
				<td><input type="checkbox" title="Права на добавление дочернего документа" name="rights[{#group_id}][permission_add_child]" value="1" {permission_add_child()} /></td>
			</tr>
		</elem>
		</list>
		</tbody>
		</table>
		
		<block name="pages"  block="bookdoc3" /><p>&nbsp;</p>
		<noscript>
		<input class="xITB sbmt" type="submit" name="event[DocumentSetGroupsRights]" value="Установить права" onclick="$('#grouperr').granatLoad({blockname: 'upderr', data: this.form, event: 'DocumentSetGroupsRights', success: function(){alert('Изменения сохранены.')}}); return false"/>
		</noscript>
	</module>
</div>	
</form>

<script>
$(function(){
 $(document.groupform).find('input[type=checkbox]').one('click', function(){
 	$('#saveit').fadeIn('slow');
 });
});
</script>
</div>

<switch granatid="permission_read" hidden="true">
<case cond="#permission_read">checked="checked"</case>
</switch>

<switch granatid="permission_write" hidden="true">
<case cond="#permission_write">checked="checked"</case>
</switch>

<switch granatid="permission_delete" hidden="true">
<case cond="#permission_delete">checked="checked"</case>
</switch>

<switch granatid="permission_add_child" hidden="true">
<case cond="#permission_add_child">checked="checked"</case>
</switch>