<?page title="${labels.RequirementApproveDialog}" 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="approveWin" border="normal" apply="org.zkoss.bind.BindComposer"
			viewModel="@id('vm') @init('info.bukova.isspst.ui.main.ApproveDialogVM')" width="300px" closable="true">
		<caption
				image="/img/approve-032.png"
				zclass="form-caption"
				label="${labels.RequirementApproveDialog}" />

		<vbox hflex="1">
			<hbox>
				<label value="${labels.RequirementApproveDate}"/>
				<datebox
					value="@bind(vm.approveDate)"
					format="${labels.DateFormat}" disabled="@load(vm.signed and vm.signRequired)"/>
			</hbox>
			<separator bar="true" hflex="1"/>
			<hbox>
				<button label="Podepsat" onClick="@command('signPdf')" sclass="nicebutton" disabled="@load(vm.signed or not vm.signRequired)"/>
				<button image="/img/approve-016.png" label="${labels.Confirm}" onClick="@command('approve', window=approveWin)" sclass="nicebutton" disabled="@load(not vm.signed and vm.signRequired)"/>
				<button image="~./zul/img/misc/drag-disallow.png" label="${labels.ButtonStorno}" onClick="approveWin.detach()" sclass="nicebutton"/>
			</hbox>
		</vbox>

		<timer onTimer="@command('onTimer')" running="@load(vm.timer)" repeats="true" delay="500"/>

		<iframe name="signer" width="5px" height="5px"/>

	</window>

</zk>