placeReservation.xhtml
4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" xmlns:reader="http://java.sun.com/jsf/composite/cditools/reader"
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:user="http://java.sun.com/jsf/composite/cditools/user"
xmlns:infoview="http://java.sun.com/jsf/composite/cditools/infoview"
xmlns:shop="http://java.sun.com/jsf/composite/cditools/shop"
>
<h:body>
<ui:composition template="/resources/templates/#{sessionHandler.infoscreen}/template.xhtml">
<ui:param name="ignorenavigationleft" value="true" />
<f:metadata>
<f:viewParam name="userid" value="#{incomingPlaceshopView.userId}" />
<f:event type="preRenderView" listener="#{incomingPlaceshopView.initView}" />
</f:metadata>
<ui:define name="content">
<reader:backendReader selectvalue="#{i18n['barcodeReader.readBarcode']}" selectaction="#{flowShopView.polledRead}" />
<infoview:usermultisearch />
<br />
<br />
<h:form rendered="#{!userView.selectedUser.anonymous}">
<h1>Reserve to user: #{userView.selectedUser.user.nick}</h1>
</h:form>
<h:form rendered="#{userView.selectedUser.anonymous}">
<h1>Infon paikanvaraus</h1>
</h:form>
<br />
<br />
<!--
<p:dialog rendered="#{ajaxMapView.isMgmtPermission()}" visible="#{!empty ajaxMapView.place}" id="fbdiag">
Clicked place name : #{ajaxMapView.place.name};
<h:link rendered="#{!empty ajaxMapView.place}" outcome="/place/edit">
<f:param name="placeid" value="#{ajaxMapView.place.id}"/>
Muokkaa
</h:link>
</p:dialog> -->
<h:outputScript target="head" library="seatjs" name="d3.min.js"/>
<h:outputScript target="head" library="seatjs" name="d3-tip.js"/>
<h:outputScript target="head" library="seatjs" name="seatmap.js"/>
<h:outputStylesheet library="seatjs" name="placemap.css"/>
<p>#{i18n['placeReservation.mapMultiuserNote']}</p>
<svg id="seatmap" style="margin: auto; border: 1px solid black;" width="#{ajaxMapView.map.width}px" height="#{ajaxMapView.map.height}px"/>
<h:form id="placeselectform">
<p:commandButton update="successText" onclick="$(window).unbind('beforeunload');" oncomplete="updateLastPlace();" value="#{i18n['shop.buyForUser']}" actionListener="#{incomingPlaceshopView.reserveSelectedPlaces}" >
<p:confirm header="#{i18n['placeReservation.buyConfirm.title']}" message="#{i18n['placeReservation.buyConfirm.content']}" icon="ui-icon-alert" />
</p:commandButton>
<p:outputPanel id="successText">
<h:outputText styleClass="success" value="#{i18n['shop.buyForUser.success']}" rendered="#{incomingPlaceshopView.userMustGoAway}"/>
</p:outputPanel>
</h:form>
<br /><br />
<h:form id="selectedPlaces">
<h2>#{i18n['placeReservation.selectedPlaces']}</h2>
<p:dataTable id="selectedPlacesTable" tableStyle="width: auto;" var="place" value="#{incomingPlaceshopView.selectedPlaces}">
<p:column headerText=" ">
<h:outputText value="#{place.product.name}"/>
</p:column>
<p:column headerText=" ">
<h:outputText value="#{place.name}"/>
</p:column>
</p:dataTable>
</h:form>
<script type="text/javascript">
function updateMap() {
px.update();
}
function updateQueue(data) {
if (data === undefined) {
alert('not in queue');
return;
}
if (data.value == 0) {
updateWholePage();
} else {
$("#queuepos").text(data.value);
var d = new Date();
$("#queueupdated").text(d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds())
}
}
setInterval(function () {
updateMap()
}, 5000);
</script>
<script type="text/javascript">
var lastplace = false;
px = placemap({
element: document.getElementById("seatmap"),
moyaurl: "#{request.contextPath}",
map_id: #{ajaxMapView.map.id},
toggleaction: function (d) {
selectPlace([{name: "placeid", value: d.id}]);
lastplace = d;
return false;
}
});
// document.getElementById("editbutton").addEventListener("click",
// function() {
// px.enable_edit();
// });
// px.enable_edit();
function updateLastPlace() {
px.update();
}
</script>
<h:form>
<p:remoteCommand oncomplete="updateLastPlace();" update="selectedPlaces" name="selectPlace" actionListener="#{incomingPlaceshopView.reserveRemoteCommand}" />
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>