<?page title="${labels.TravelOrdersFormTitle}" contentType="text/html;charset=UTF-8"?>

<zk xmlns="http://www.zkoss.org/2005/zul"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
	<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>

	<window	id="editWin"
			border="normal"
			closable="true"
			apply="org.zkoss.bind.BindComposer"
			viewModel="@id('vm') @init('info.bukova.isspst.ui.settings.SeasonsVM')"
			width="750px"
			height="600px">
		<caption
				src="/img/global-setting-032.png"
				zclass="form-caption"
				label="${labels.SeasonsSeason}" />
		<vbox>
			<button label="${labels.SeasonsNewSeason}" onClick="@command('addSeason')" sclass="nicebutton"/>
			<listbox model="@load(vm.seasons)">
				<listhead>
					<listheader label="${labels.SeasonsDescription}"/>
					<listheader label="${labels.SeasonsValidFrom}"/>
					<listheader label="${labels.SeasonsValidTo}"/>
					<listheader label="${labels.SeasonsActive}"/>
				</listhead>
				<template name="model">
					<listitem>
						<listcell>
							<textbox value="@bind(each.description)" inplace="true"/>
						</listcell>
						<listcell label="@load(each.validFrom)"/>
						<listcell label="@load(each.validTo)"/>
						<listcell>
							<button label="${labels.SeasonsActivate}" onClick="@command('activate', season=each)" disabled="@load(each.active)" sclass="nicebutton"/>
						</listcell>
					</listitem>
				</template>
			</listbox>
			<label value="${labels.SeasonsActiveNumSeries}"/>
			<listbox model="@load(vm.numSeries)">
				<listhead>
					<listheader label="${labels.SeasonsAgenda}"/>
					<listheader label="${labels.SeasonsPrefix}"/>
					<listheader/>
				</listhead>
				<template name="model">
					<listitem>
						<listcell label="@load(vm.moduleMap[each.module].name)"/>
						<listcell>
							<textbox value="@bind(each.prefix)" inplace="true"/>
						</listcell>
						<listcell label="@load(each.number)"/>
					</listitem>
				</template>
			</listbox>
			<include src="/app/formButtons.zul" />
		</vbox>
	</window>

</zk>