{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<h1>{$layout.pagetitle|escape}</h1>

<form method="POST" id="invprojectedit" action="?m=invprojectedit&id={$invprojectedit.id}" name="invprojectedit">
	<input type="submit" class="hiddenbtn">
</form>

<table class="lmsbox">
	<colgroup>
		<col style="width: 1%;">
		<col style="width: 1%;">
		<col style="width: 98%;">
	</colgroup>
	<thead>
		<tr>
			<td>
				{icon name="money" class="fa-fw"}
			</td>
			<td>
				<strong>{trans("Name")}</strong>
			</td>
			<td>
				<input type="text" size="40" name="invprojectedit[name]" form="invprojectedit"
					value="{$invprojectedit.name|escape}"
					{tip text="Enter investment project name" trigger="name" bold=1}>
			</td>
		</tr>
	</thead>
	<tbody>
		{if $divisions}
			<tr>
				<td>
					{icon name="division" class="fa-fw"}
				</td>
				<td>
					{trans("Division")}
				</td>
				<td>
					<select size="1" name="invprojectedit[divisionid]" form="invprojectedit"
						{tip text="Select division" trigger="divisionid"}>
						{foreach $divisions as $item}
							<option value="{$item.id}"{if $invprojectedit.divisionid == $item.id} selected{/if}>{$item.label|escape}</option>
						{/foreach}
					</select>
				</td>
			</tr>
		{/if}
		<tr>
			<td>
				{icon name="calendar" class="fa-fw"}
			</td>
			<td class="nobr">
				{trans("Estimated completion date")}
			</td>
			<td>
				<input type="text" size="10" name="invprojectedit[cdate]" form="invprojectedit" id="cdate"
					{tip class="lms-ui-date lms-ui-date-unix" text="Enter date in YYYY/MM/DD format or click to choose it from calendar" trigger="cdate"}
					value="{if $invprojectedit.cdate}{$invprojectedit.cdate}{/if}"
			</td>
		</tr>
		<tr>
			<td class="lms-ui-box-buttons" colspan="3">
				{button type="submit" accesskey="s" form="invprojectedit" label="Submit" icon="save"}
				{button label="Cancel" icon="cancel" href="?m=invprojectlist"}
				<br>
				<label>
					<input type="checkbox" name="invprojectedit[reuse]" form="invprojectedit"
						value="ON"{if $invprojectedit.reuse} checked{/if}>
					{trans("Display this form again, when this invproject is saved")}
				</label>
			</td>
		</tr>
	</tbody>
</table>

<script>

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

</script>
{/block}
