Commit da9d3e91 by Tuomas Riihimäki

Moar map

1 parent 4966dc18
......@@ -47,7 +47,7 @@ public class QueueBean implements QueueBeanLocal {
private final Map<Integer, MapQueue> mapqueues;
private int reservingSize = 4;
private int reservingSize = 2;
private class MapQueue {
// private final Set<MapReservationQueueEntry> reserving = new HashSet<>();
......
......@@ -47,11 +47,13 @@
<h:form>
<p:commandButton value="#{i18n['mapView.enterQueue']}"
action="#{ajaxMapView.enterQueue()}" ajax="false" />
<p:commandButton value="#{i18n['mapView.check']}"
action="#{ajaxMapView.checkReserving()}" />
</h:form>
queueEntry #{ajaxMapView.queueEntry} <br />
QueuePosition: #{ajaxMapView.queuePosition} <br />
Available places to select: #{ajaxMapView.placesLeftToSelect} <br />
isReserving #{ajaxMapView.reserving} <br />
<svg id="seatmap" style="margin: auto; border: 1px solid black;"
width="#{ajaxMapView.map.width}px"
......
......@@ -127,6 +127,15 @@ public class AjaxMapView extends GenericCDIView {
}
public void checkReserving() {
}
public boolean isReserving()
{
return quebean.isReserving(initMap(), permbean.getCurrentUser());
}
public boolean canUserBuy() {
return permbean.hasPermission(MapPermission.BUY_PLACES) &&
(permbean.hasPermission(MapPermission.MANAGE_OTHERS) ||
......@@ -138,6 +147,7 @@ public class AjaxMapView extends GenericCDIView {
try {
EventUser user = userview.getSelectedUser();
placebean.buySelectedPlaces(user);
quebean.remove(initMap(), user);
return "/place/myGroups";
} catch (BortalCatchableException e) {
addFaceMessage("mapView.errorWhileBuyingPlaces");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!