{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}

{$hide_disabled_users = ConfigHelper::checkConfig('finances.hide_disabled_users')}
{$hide_deleted_users = ConfigHelper::checkConfig('finances.hide_deleted_users')}

<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
<TABLE class="lmsbox">
    <THEAD>
	<TR>
	    <TD width="1%">
		<IMG src="img/queue.gif" ALT="">
	    </TD>
	    <TD width="99%" colspan="2"><B>{$registry.name} ({$registry.id|string_format:"%04d"})</B></TD>
	</TR>
    </THEAD>
    <TBODY>
	<TR>
	    <TD width="1%">
		<IMG src="img/id.gif" ALT="">
	    </TD>
	    <TD width="1%" nowrap><B>{trans("Cash-in receipt numbering plan:")}</B></TD>
	    <TD width="98%">{$registry.in_template|default:"%N/LMS/%Y"}</TD>
	</TR>
	<TR>
	    <TD width="1%">
		<IMG src="img/id.gif" ALT="">
	    </TD>
	    <TD width="1%" nowrap><B>{trans("Cash-out receipt numbering plan:")}</B></TD>
	    <TD width="98%">{$registry.out_template|default:"%N/LMS/%Y"}</TD>
	</TR>
	{if $registry.description}
	<TR>
	    <TD width="1%">
		<IMG src="img/info1.gif" ALT="">
	    </TD>
	    <TD width="1%"><B>{trans("Description:")}</B></TD>
	    <TD width="98%">
		<TABLE width="100%" cellpadding="5">
		    <TR>
			<TD class="fall superlight">
			    {$registry.description|replace:"\n":"<BR>"}
			</TD>
		    </TR>
		</TABLE>
	    </TD>
	</TR>
	{/if}
	<TR>
	    <TD width="1%">
		<IMG src="img/wait.gif" ALT="">
	    </TD>
	    <TD width="1%"><B>{trans("Disabled summary:")}</B></TD>
	    <TD width="98%">
		    {if $registry.disabled}{trans("yes")}{else}{trans("no")}{/if}
	    </TD>
	</TR>
	<TR>
	    <TD width="1%">
		<IMG src="img/users.gif" ALT="">
	    </TD>
	    <TD width="1%"><B>{trans("Privileges:")}</B></TD>
	    <TD width="98%">
			<table class="lmsbox lms-ui-background-cycle">
				<colgroup>
					<col style="width: 93%;">
					<col style="width: 1%;">
					<col style="width: 1%;">
					<col style="width: 1%;">
					<col style="width: 1%;">
					<col style="width: 1%;">
					<col style="width: 1%;">
					<col style="width: 1%;">
				</colgroup>
				<thead>
					<tr>
						<td>
							<strong>{trans("User")}</strong>
						</td>
						<td class="text-center nobr">
							<strong>{trans("Read")}</strong>
						</td>
						<td class="text-center nobr" colspan="5">
							<strong>{trans("Write (+R)")}</strong>
						</td>
						<td class="text-center nobr">
							<strong>{trans("Advanced (+R)")}</strong>
						</td>
					</tr>
					<tr>
						<td></td>
						<td class="text-center nobr"></td>
						<td class="text-center">{trans("customer")}</td>
						<td class="text-center nobr">{trans("ass. move")}</td>
						<td class="text-center">{trans("advance")}</td>
						<td class="text-center">{trans("other")}</td>
						<td class="text-center">{trans("mod.")}</td>
						<td class="text-center nobr"></td>
					</tr>
				</thead>
				<tbody>
					{foreach $registry.rights as $right}
						{if $right.rights}
							<tr class="highlight{if empty($right.access)} blend{/if}{if !empty($right.deleted)} crossed{/if}"
								{if empty($right.access) && $hide_disabled_users || !empty($right.deleted) && $hide_deleted_users} style="display: none;"{/if}>
								<td>
									<a href="?m=userinfo&id={$right.id}">{$right.rname|trunescape:40} ({$right.login})</a>
								</td>
								<td class="text-center">
									{if $right.rights > 0}
										{icon name="checked"}
									{/if}
								</td>
								<td class="text-center">
									{if ($right.rights & 2) == 2}
										{icon name="checked"}
									{/if}
								</td>
								<td class="text-center">
									{if ($right.rights & 4) == 4}
										{icon name="checked"}
									{/if}
								</td>
								<td class="text-center">
									{if ($right.rights & 8) == 8}
										{icon name="checked"}
									{/if}
								</td>
								<td class="text-center">
									{if ($right.rights & 16) == 16}
										{icon name="checked"}
									{/if}
								</td>
								<td class="text-center">
									{if ($right.rights & 32) == 32}
										{icon name="checked"}
									{/if}
								</td>
								<td class="text-center">
									{if ($right.rights & 256) == 256}
										{icon name="checked"}
									{/if}
								</td>
							</tr>
							{if empty($right.access) && $hide_disabled_users || !empty($right.deleted) && $hide_deleted_users}
								<tr style="display: none;">
									<td colspan="8"></td>
								</tr>
							{/if}
						{/if}
					{/foreach}
					<tr>
						<td></td>
						<td colspan="7"></td>
					</tr>
				</tbody>
			</table>
	    </TD>
	</TR>
	<TR>
	    <TD width="100%" COLSPAN="3" ALIGN="RIGHT">
	        <A HREF="?m=receiptlist&regid={$registry.id}">{trans("Browse")} <IMG src="img/view.gif" alt=""></A>
	    	<A HREF="?m=cashregedit&id={$registry.id}">{trans("Edit")} <IMG src="img/save.gif" alt=""></A>
	    </TD>
	</TR>
    </TBODY>
</TABLE></P>
{/block}
