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 {
return "/PlaceMap" + parameters;
// TODO: do something.
}
public int selectablePlaceCount(User user, Event currentEvent) {
throw new UnsupportedOperationException("Not supported yet.");
}
}
......@@ -17,6 +17,8 @@ public interface PlaceMapBeanLocal {
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 int selectablePlaceCount(User user, Event currentEvent);
// public EventMap findMap(int i);
}
......@@ -53,6 +53,9 @@ public class Product implements EventChildInterface {
@Column(name = "barcode")
private String barcode;
@Column(name = "prepaid")
private boolean prepaid = false;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "product")
private List<Place> places;
......@@ -211,5 +214,19 @@ public class Product implements EventChildInterface {
public List<FoodWaveTemplate> getFoodWaveTemplates() {
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 @@
<h:form>
<h:commandButton image="#{mapView.selectPlaceMapUrl}" actionListener="#{mapView.placeSelectActionListener}" />
<h:outputText value="#{i18n['placeSelect.left']}: #{mapView.placeLeftToSelect}" />
</h:form>
......
......@@ -122,4 +122,10 @@ public class MapView {
public void setSessionHandler(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!