Commit 7b45166f by Tuomas Riihimäki

Merge branch 'master' of dev.intra.insomnia.fi:/data/bortal

2 parents e56e038e 0185b6ab
...@@ -125,4 +125,8 @@ public class PlaceMapBean implements PlaceMapBeanLocal { ...@@ -125,4 +125,8 @@ public class PlaceMapBean implements PlaceMapBeanLocal {
return "/PlaceMap" + parameters; return "/PlaceMap" + parameters;
// TODO: do something. // TODO: do something.
} }
public int selectablePlaceCount(User user, Event currentEvent) {
throw new UnsupportedOperationException("Not supported yet.");
}
} }
...@@ -17,6 +17,8 @@ public interface PlaceMapBeanLocal { ...@@ -17,6 +17,8 @@ public interface PlaceMapBeanLocal {
void printPlaceMapToStream(OutputStream outputStream, String filetype, Event event, Integer mapId, Integer userId, List<Integer> placeIds) throws IOException; void printPlaceMapToStream(OutputStream outputStream, String filetype, Event event, Integer mapId, Integer userId, List<Integer> placeIds) throws IOException;
public String getSelectPlaceMapUrl(EventMap activeMap, List<Place> selectedPlaces, User user); public String getSelectPlaceMapUrl(EventMap activeMap, List<Place> selectedPlaces, User user);
public int selectablePlaceCount(User user, Event currentEvent);
// public EventMap findMap(int i); // public EventMap findMap(int i);
} }
...@@ -53,6 +53,9 @@ public class Product implements EventChildInterface { ...@@ -53,6 +53,9 @@ public class Product implements EventChildInterface {
@Column(name = "barcode") @Column(name = "barcode")
private String barcode; private String barcode;
@Column(name = "prepaid")
private boolean prepaid = false;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "product") @OneToMany(cascade = CascadeType.ALL, mappedBy = "product")
private List<Place> places; private List<Place> places;
...@@ -212,4 +215,18 @@ public class Product implements EventChildInterface { ...@@ -212,4 +215,18 @@ public class Product implements EventChildInterface {
return foodWaveTemplates; return foodWaveTemplates;
} }
/**
* @return the prepaid
*/
public boolean isPrepaid() {
return prepaid;
}
/**
* @param prepaid the prepaid to set
*/
public void setPrepaid(boolean prepaid) {
this.prepaid = prepaid;
}
} }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<h:form> <h:form>
<h:commandButton image="#{mapView.selectPlaceMapUrl}" actionListener="#{mapView.placeSelectActionListener}" /> <h:commandButton image="#{mapView.selectPlaceMapUrl}" actionListener="#{mapView.placeSelectActionListener}" />
<h:outputText value="#{i18n['placeSelect.left']}: #{mapView.placeLeftToSelect}" />
</h:form> </h:form>
......
...@@ -122,4 +122,10 @@ public class MapView { ...@@ -122,4 +122,10 @@ public class MapView {
public void setSessionHandler(SessionHandler sessionHandler) { public void setSessionHandler(SessionHandler sessionHandler) {
this.sessionHandler = sessionHandler; this.sessionHandler = sessionHandler;
} }
public String placeLeftToSelect() {
int totalPlaces = placeMapBean.selectablePlaceCount(sessionHandler.getUser(), sessionHandler.getCurrentEvent());
return (totalPlaces - selectedPlaces.size())+"";
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!