{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<h1>{$layout.pagetitle}</h1>
<form method="POST" action="?m=eventnote&id={$event.id}" name="event">
	<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="calendar"}
			</td>
			<td>
				<strong>{trans("Title")}</strong>
			</td>
			<td>
				<strong>{$event.title}</strong>
			</td>
		</tr>
	</thead>
	<tbody>
		{block name="event_note_table"}
			<tr>
				<td>
					{icon name="calendar"}
				</td>
				<td>
					<strong>{trans("Time")}</strong>
				</td>
				<td>
					{$event.date|date_format:"Y-m-d (l)"}
					{if $event.wholedays}
						- {trans("whole day")}
					{else}
						{math equation="floor(x / 3600)" x=$event.begintime format="%02d"}:{math equation="x % 3600" x=$event.begintime format="%02d"}
						{if $event.begintime != $event.endtime}
							- {math equation="floor(x / 3600)" x=$event.endtime format="%02d"}:{math equation="x % 3600" x=$event.endtime format="%02d"}
						{/if}
						{if $event.multiday}
							<br>
							{trans("multi day")}
						{/if}
					{/if}
				</td>
			</tr>
			{if $event.description}
				<tr>
					<td>
						{icon name="description"}
					</td>
					<td>
						<strong>{trans("Description")}</strong>
					</td>
					<td>
						<table style="width: 95%;">
							<tr>
								<td class="fall superlight">
									{$event.description|escape|replace:"\n":"<BR>"}
								</td>
							</tr>
						</table>
					</td>
				</tr>
			{/if}
			<tr>
				<td>
					{icon name="permissions"}
				</td>
				<td>
					<strong>{trans("Status")}</strong>
				</td>
				<td class="nobr">
					{if $event.private}
						{trans("private")}
					{else}
						{trans("public")}
					{/if}
				</td>
			</tr>
			<tr>
				<td>
					{icon name="customer"}
				</td>
				<td>
					<strong>{trans("Customer")}</strong>
				</td>
				<td class="nobr">
					{if $event.customername}
						<A href="?m=customerinfo&id={$event.customerid}">{$event.customername}</A>
					{else}
						{trans("— none —")}
					{/if}
				</td>
			</tr>
			<tr>
				<td>
					{icon name="note"}
				</td>
				<td>
					<strong>{trans("Note")}</strong>
				</td>
				<td>
					<textarea name="event[note]" cols="50" rows="5"
						{tip}>{$event.note}</textarea>
				</td>
			</tr>
			<tr>
				<td>
					{icon name="user"}
				</td>
				<td>
					<strong>{trans("Users")}</strong>
				</td>
				<td class="nobr">
					{foreach $event.userlist as $userid => $user}
						<a href="?m=userinfo&id={$userid}">{$user.rname|escape}</a>
						{if !$user@last}
							<br>
						{/if}
					{foreachelse}
						{trans("— none —")}
					{/foreach}
				</td>
			</tr>
			<tr>
				<td class="lms-ui-box-buttons" colspan="3">
					{button onclick="document.event.submit()" accesskey="s" icon="save" label="Submit"}
					{button href=$backurl icon="cancel" label="Cancel"}
				</td>
			</tr>
		{/block}
	</tbody>
</table>
{/block}
