{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
<FORM method="POST" action="?m=eventsearch" name="event" id="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 colspan="3" class="bold">
			{icon name="search" label="Find events matching the following search criteria:"}
		</TD>
	</TR>
    </THEAD>
    <TBODY>
	<TR>
		<TD>
			{icon name="subject"}
		</TD>
		<TD class="bold">
			{trans("Title:")}
		</TD>
		<TD>
			<INPUT type="text" name="event[title]" value="{$event.title}" size="50" {tip text="Enter event title" trigger="title"}>
		</TD>
	</TR>
	<tr>
		<td>
			{icon name="timetable"}
		</td>
		<td>
			<strong>{trans("Period")}</strong>
		</td>
		<td>
			<span class="lms-ui-date-period-container">
				{date_period_preset from="[name=\"event[datefrom]\"]" to="[name=\"event[dateto]\"]"}
				<label>
					{trans("From")}
					<input type="text" placeholder="{trans("yyyy/mm/dd")}" name="event[datefrom]" size="12" {tip class="lms-ui-date" text="Enter date in YYYY/MM/DD format or click to choose it from calendar"}>
				</label>
				<label>
					{trans("To")}
					<input type="text" placeholder="{trans("yyyy/mm/dd")}" name="event[dateto]" size="12" {tip class="lms-ui-date" text="Enter date in YYYY/MM/DD format or click to choose it from calendar"}>
				</label>
			</span>
		</td>
	</tr>
	<TR>
		<TD>
			{icon name="description"}
		</TD>
		<TD class="bold">
			{trans("Description:")}
		</TD>
		<TD>
			<INPUT type="text" name="event[description]" size="50" {tip text="Enter additional information"}>
		</TD>
	</TR>
	<TR>
		<TD>
			{icon name="note"}
		</TD>
		<TD class="bold">
			{trans("Note:")}
		</TD>
		<TD>
			<INPUT type="text" name="event[note]" size="50" {tip text="Enter note"}>
		</TD>
	</TR>
	<TR>
		<TD>
			{icon name="type"}
		</TD>
		<TD class="bold">
			{trans("Type")}
		</TD>
		<td>
			<select name="event[type][]" size="1" class="lms-ui-multiselect" multiple
				data-default-value="{trans("— all —")}">
				{foreach Localisation::arraySort($_EVENTTYPES, 'label') as $idx => $eventtype}
					<option value="{$idx}">{$eventtype.label}</option>
				{/foreach}
			</select>
		</td>
	</TR>
	<TR>
		<TD>
			{icon name="status"}
		</TD>
		<TD class="bold">
			{trans("Status:")}
		</TD>
		<TD>
			<SELECT name="event[closed]" size="1">
				<OPTION value="" SELECTED>{trans("— all —")}</OPTION>
				<OPTION value="0">{trans("opened<!plural:event>")}</OPTION>
				<OPTION value="1">{trans("closed<!plural:event>")}</OPTION>
			</SELECT>
		</TD>
	</TR>
{*
	<TR>
		<TD>
			<IMG src="img/access.gif" alt="">
		</TD>
		<TD class="bold">
			{trans("Status:")}
		</TD>
		<TD nowrap>
			<INPUT type="checkbox" name="event[private]" value="1" {tip text="Select event's status"}{if $event.private}CHECKED{/if}> {trans("private")}
		</TD>
	</TR>
*}
	<TR>
		<TD>
			{icon name="customer"}
		</TD>
		<TD class="bold">
			{trans("Customer:")}
		</TD>
		<TD class="nobr">
			{customerlist form="event" customers=$customerlist selected=$event.customerid version=2
				selectname="event[customerid]" inputname="event[custid]" customOnChange="change_customer(this);"}
		</TD>
	</TR>
	<TR>
		<TD valign="top" class="bold">
			{icon name="user"}
		</TD>
		<TD valign="top" class="bold">
			{trans("User:")}
		</TD>
		<TD class="multiselect nobr">
			<SELECT name="event[userid][]" class="lms-ui-multiselect" multiple data-default-value="{trans("— select user —")}" data-shorten-to-default-value="false">
				{foreach $userlist as $user}
				<OPTION value="{$user.id}">{$user.name|escape}</OPTION>
				{/foreach}
			</SELECT>
		</TD>
	</TR>
        <TR>
                <TD>
                        {icon name="helpdesk"}
                </TD>
                <TD class="bold nobr">
                        {trans("Ticket ID:")}
                </TD>
                <TD class="nobr">
			<INPUT type="text" name="event[ticketid]" ROWS="1" COLS="10">
                </TD>
        </TR>
	<TR>
		<TD align="right" colspan="3">
			{button onclick="document.event.submit()" accesskey="s" icon="save" label="Search"}
			{button href="?m=eventlist" icon="cancel" label="Cancel"}
		</TD>
	</TR>
    </TBODY>
</TABLE>
</form>
<SCRIPT type="text/javascript">
<!--
	$(function() {
		$('form[name="event"] [name="event[title]"]').focus();
	});
//-->
</SCRIPT>
{/block}
