{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
{$hide_disabled_users = ConfigHelper::checkConfig('rt.hide_disabled_users', ConfigHelper::checkConfig('phpui.helpdesk_hide_disabled_users'))}
<!--// $Id$ //-->
<h1>{$layout.pagetitle}</h1>
<form method="POST" name="category" action="?m=rtcategoryadd">
<input type="submit" class="hiddenbtn">
<table class="lmsbox">
	<colgroup>
		<col style="width: 1%;">
		<col style="width: 1%;">
		<col style="width: 98%;">
	</colgroup>
	<thead>
		<tr>
			<td>
				{icon name="queue"}
			</td>
			<td>
				<strong>{trans("Name:")}</strong>
			</td>
			<td>
				<input type="text" name="category[name]" value="{$category.name}"
					{tip text="Enter name" trigger="name" bold=1}>
			</td>
		</tr>
	</thead>
	<tbody class="lms-ui-multi-check">
		<tr>
			<td>
				{icon name="optional-info"}
			</td>
			<td>
				<strong>{trans("Description")}</strong>
			</td>
			<td>
				<textarea name="category[description]" cols="50" rows="2"
					{tip text="Enter additional information (optional)"}>{$category.description}</textarea>
			</td>
		</tr>
		<tr>
			<td>
				{icon name="color"}
			</td>
			<td>
				<label for="background-style">
					<strong>{trans("<!rt-category>Background:")}</strong>
				</label>
			</td>
			<td>
				<input id="background-style" type="color" name="category[background-style]"
					value="{if empty($category['background-style'])}#ffffff{else}{$category['background-style']}{/if}">
			</td>
		</tr>
		<tr>
			<td>
				{icon name="color"}
			</td>
			<td>
				<label for="text-style">
					<strong>{trans("<!rt-category>Text:")}</strong>
				</label>
			</td>
			<td>
				<input id="text-style" type="color" name="category[text-style]"
					value="{if empty($category['text-style'])}#000000{else}{$category['text-style']}{/if}">
			</td>
		</tr>
		<tr>
			<td>
				{icon name="owner"}
			</td>
			<td>
				<strong>{trans("Users")}</strong>
			</td>
			<td>
				<table class="lmsbox lms-ui-background-cycle">
					<colgroup>
						<col style="width: 99%;">
						<col style="width: 1%;">
					</colgroup>
					<thead>
						<TR>
							<TD class="bold">{trans("User")}
							</TD>
							<TD class="bold text-center nobr">{trans("Owner")}</TD>
						</TR>
					</thead>
					<tbody>
						{foreach $category.owners as $user}
							<tr class="highlight{if empty($users[$user.id].access)} blend{/if}"
								{if empty($users[$user.id].access) && $hide_disabled_users} style="display: none;"{/if}>
								<td>
									<a href="?m=userinfo&id={$user.id}">{$user.rname|escape} ({$user.login})</a>
								</td>
								<td class="text-center">
									<input type="checkbox" name="category[users][{$user.id}]"
										class="lms-ui-multi-check" value="1"{if $user.owner > 0} checked{/if}>
								</td>
							</tr>
							{if empty($users[$user.id].access) && $hide_disabled_users}
								<tr style="display: none;">
									<td colspan="2"></td>
								</tr>
							{/if}
						{/foreach}
						<tr>
							<td class="text-right">
								<label for="allbox">
									{trans("Check All")}
								</label>
							</td>
							<td class="text-center">
								<input type="checkbox" name="allbox" id="allbox" class="lms-ui-multi-check-all">
							</td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="3" class="lms-ui-box-buttons">
				{button type="submit" icon="save" label="Submit"}
				{button icon="cancel" label="Cancel" href="?m=rtcategorylist"}
			</td>
		</tr>
    </tbody>
</table>
</form>
<script>

	$(function() {
		$('[name="category[name]"]').focus();
	});

</script>
{/block}
