reserve.xhtml 4.41 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:tools="http://java.sun.com/jsf/composite/tools"
>
<h:head>
	<title></title>

</h:head>
<h:body>
	<ui:composition template="/layout/template.xhtml">
		<f:metadata>
			<f:viewParam name="locid" value="#{requestCalendarView.locid}" />
			<f:viewParam name="slotid" value="#{requestCalendarView.slotid}" />
			<f:event type="preRenderView" listener="#{requestCalendarView.reserveCell()}" />
		</f:metadata>
		<ui:define name="content">
			<h:form id="reserveField">

				<h:panelGrid columns="3">
					<h:outputLabel for="name" value="#{i18n['reservation.location']}" />
					<h:outputText id="name" value="#{calendarView.reservation.location.name}" />
					<h:message for="name" />


					<h:outputLabel for="resdate" value="#{i18n['reservation.date']}:" />
					<h:outputText id="resdate" value="#{calendarView.reservation.reservationDate.time}">
						<f:convertDateTime timeZone="#{userprefs.timezone}" pattern="#{sessionHandler.datePattern}" />
					</h:outputText>
					<h:message for="resdate" />


					<h:outputLabel for="starttime" value="#{i18n['reservation.start']}:" />
					<h:outputText id="starttime" value="#{calendarView.reservation.slot.startTime.time}">
						<f:convertDateTime timeZone="#{userprefs.timezone}" pattern="#{sessionHandler.timePattern}" />
					</h:outputText>
					<h:message for="starttime" />

					<h:outputLabel for="selectone" value="#{i18n['reservation.end']}:" />
					<h:selectOneMenu id="selectone" converter="#{reservationSlotConverter}" value="#{calendarView.reservationEndtime}">
						<f:selectItems var="time" itemLabel="#{timeConverter.getEndTime(time)}" value="#{calendarView.availableTimes}" />
					</h:selectOneMenu>
					<h:message for="selectone" />

					<h:outputLabel for="reserver" value="#{i18n['reservation.reserver']}:" />
					<h:inputText id="reserver" value="#{calendarView.reservation.reserverName}"
						required="#{!sessionHandler.hasPermission('CALENDAR_MANAGE')}"
					/>
					<h:message for="reserver" />
					<h:outputLabel for="reserverlastname" value="#{i18n['reservation.reserverLastname']}:" />
					<h:inputText id="reserverlastname" value="#{calendarView.reservation.reserverLastname}"
						required="#{!sessionHandler.hasPermission('CALENDAR_MANAGE')}"
					/>
					<h:message for="reserverlastname" />

					<h:outputLabel for="email" value="#{i18n['reservation.email']}:" />
					<h:inputText id="email" value="#{calendarView.reservation.email}"
						required="#{!sessionHandler.hasPermission('CALENDAR_MANAGE')}"
					/>
					<h:message for="email" />

					<h:outputLabel for="phone" value="#{i18n['reservation.phone']}:" />
					<h:inputText id="phone" value="#{calendarView.reservation.phone}"
						required="#{!sessionHandler.hasPermission('CALENDAR_MANAGE')}"
					/>
					<h:message for="phone" />

					<h:commandButton action="#{calendarView.reservePlace()}" value="#{i18n['reservation.reserve']}" />
					<h:outputText />

					<h:outputText />



					<h:commandButton rendered="#{sessionHandler.hasPermission('CALENDAR_MANAGE')}"
						action="#{calendarView.checkRepeat()}" value="Toisto"
					/>

					<h:outputLabel rendered="#{sessionHandler.hasPermission('CALENDAR_MANAGE')}" for="repeatStart"
						value="#{i18n['repeat.end']}:"
					/>
					<h:inputText rendered="#{sessionHandler.hasPermission('CALENDAR_MANAGE')}" id="repeatStart"
						value="#{calendarView.repeatEnd.time}"
					>
						<f:convertDateTime timeZone="#{userprefs.timezone}" pattern="#{sessionHandler.datePattern}" />
					</h:inputText>

					<h:message for="repeatStart" rendered="#{sessionHandler.hasPermission('CALENDAR_MANAGE')}" />

					<h:selectManyCheckbox rendered="#{sessionHandler.hasPermission('CALENDAR_MANAGE')}"
						converter="#{reservationLocationConverter}" layout="pageDirection" id="locations"
						value="#{calendarView.selectedLocations}"
					>
						<f:selectItems var="location" itemLabel="#{location.name}" value="#{calendarView.availableLocations}" />
					</h:selectManyCheckbox>
				</h:panelGrid>



				<h:commandButton rendered="#{sessionHandler.hasPermission('CALENDAR_MANAGE')}"
					action="#{calendarView.checkRepeat()}" value="Toisto"
				/>
			</h:form>


		</ui:define>
	</ui:composition>
</h:body>
</html>