Commit da9d3e91 by Tuomas Riihimäki

Moar map

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