<!-- $Id$ -->
<TABLE class="lmsbox lms-ui-tab-container lms-ui-sortable" id="rtticketeventlist">
	<COLGROUP>
		<COL style="width: 99%;">
		<COL style="width: 1%;">
	</COLGROUP>
	<THEAD>
	<TR class="hand lmsbox-titlebar" data-lmsbox-content="eventpanel-{$layout.module}">
		<TD class="bold">
			{icon name="timetable" label="Timetable assigned events" class="lms-ui-sortable-handle"}
		</TD>
		<TD class="text-right nobr">
			{if $ticket.state != $smarty.const.RT_RESOLVED}
				{button icon="add" label="Add"
					onclick="location.href='?m=eventadd&ticketid={$ticket.ticketid}{if $ticket.customerid}&customerid={$ticket.customerid}{/if}';"}
				{if $ticket.openeventcount}
					{button icon="close" label="Close all"
						onclick="location.href='?m=eventedit&action=close&ticketid={$ticket.ticketid}';"}
				{/if}
			{/if}
		</TD>
	</TR>
	</THEAD>
	<TBODY>
	<TR id="eventpanel-{$layout.module}" style="display: none;">
		<TD colspan="2">
			<table class="lmsbox{if !$assignedevents}-inner{/if} lms-ui-background-cycle">
				<COLGROUP>
					<COL style="width: 1%;">
					<COL style="width: 1%; min-width:90px;">
					<COL style="width: 95%;">
					<COL style="width: 1%;">
					<COL style="width: 1%;">
					<COL style="width: 1%;" class="no-print">
				</COLGROUP>
				{if $assignedevents}
				<THEAD class="">
					{include file="event/eventlistheader.html"}
				</THEAD>
				{/if}
				<TBODY>
				{foreach $assignedevents as $event}
					{$day=$event.date}
					{include file="event/eventlistboxrow.html" overdue=1 backid=null}
				{foreachelse}
					<tr>
						<td class="empty-table" colspan="6">
							{trans("There are no events in timetable.")}
						</td>
					</tr>
				{/foreach}
				</TBODY>
			</table>
		</TD>
	</TR>
</TABLE>

<script>

	if (getCookie('eventpanel-{$layout.module}') == '1') {
		$('#eventpanel-{$layout.module}').show();
	}

</script>
<script src="js/templates/event/eventlist.js"></script>
