Commit 684279e7 by Tuukka Kivilahti

Merge branch 'master' of codecrew.fi:codecrew/moya into calendarForLectures

2 parents 620e1532 8c4347c3
...@@ -151,8 +151,7 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -151,8 +151,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
"user_notes", "user_notes",
"users")); "users"));
dbUpdates.add(new String[] { "CREATE TABLE network_associations (id SERIAL NOT NULL, create_time TIMESTAMPTZ NOT NULL, ip TEXT, mac TEXT, meta TEXT, modify_time TIMESTAMPTZ NOT NULL, status TEXT NOT NULL, event INTEGER, event_user INTEGER, place INTEGER, PRIMARY KEY (id))" });
dbUpdates.add(new String[]{"CREATE TABLE network_associations (id SERIAL NOT NULL, create_time TIMESTAMPTZ NOT NULL, ip TEXT, mac TEXT, meta TEXT, modify_time TIMESTAMPTZ NOT NULL, status TEXT NOT NULL, event INTEGER, event_user INTEGER, place INTEGER, PRIMARY KEY (id))"});
dbUpdates.add(new String[] { dbUpdates.add(new String[] {
"CREATE TABLE card_text_data (id SERIAL NOT NULL, font_name TEXT NOT NULL, font_style INTEGER NOT NULL, size INTEGER NOT NULL, text TEXT, text_alignment TEXT NOT NULL, card_text_data_type TEXT NOT NULL, x INTEGER NOT NULL, y INTEGER NOT NULL, z_index INTEGER NOT NULL, PRIMARY KEY (id));" "CREATE TABLE card_text_data (id SERIAL NOT NULL, font_name TEXT NOT NULL, font_style INTEGER NOT NULL, size INTEGER NOT NULL, text TEXT, text_alignment TEXT NOT NULL, card_text_data_type TEXT NOT NULL, x INTEGER NOT NULL, y INTEGER NOT NULL, z_index INTEGER NOT NULL, PRIMARY KEY (id));"
...@@ -192,8 +191,7 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -192,8 +191,7 @@ public class BootstrapBean implements BootstrapBeanLocal {
"ALTER TABLE network_associations ALTER COLUMN meta TYPE json USING (meta::json);" "ALTER TABLE network_associations ALTER COLUMN meta TYPE json USING (meta::json);"
}); });
dbUpdates.add(new String[] { "CREATE TABLE lecture_groups (id SERIAL NOT NULL, event_id integer NOT NULL, description TEXT, name TEXT, select_count INTEGER, meta json, PRIMARY KEY (id))",
dbUpdates.add(new String[] {"CREATE TABLE lecture_groups (id SERIAL NOT NULL, event_id integer NOT NULL, description TEXT, name TEXT, select_count INTEGER, meta json, PRIMARY KEY (id))",
"CREATE TABLE lectures (id SERIAL NOT NULL, description TEXT, hours numeric(10,2), max_participants_count INTEGER, name TEXT, start_time TIMESTAMPTZ, lecture_group_id INTEGER, meta json, PRIMARY KEY (id))", "CREATE TABLE lectures (id SERIAL NOT NULL, description TEXT, hours numeric(10,2), max_participants_count INTEGER, name TEXT, start_time TIMESTAMPTZ, lecture_group_id INTEGER, meta json, PRIMARY KEY (id))",
"CREATE TABLE lecture_roles (role_id INTEGER NOT NULL, lecture_id INTEGER NOT NULL, PRIMARY KEY (role_id, lecture_id))", "CREATE TABLE lecture_roles (role_id INTEGER NOT NULL, lecture_id INTEGER NOT NULL, PRIMARY KEY (role_id, lecture_id))",
"CREATE TABLE lecture_participants (eventuser_id INTEGER NOT NULL, lecture_id INTEGER NOT NULL, PRIMARY KEY (eventuser_id, lecture_id))", "CREATE TABLE lecture_participants (eventuser_id INTEGER NOT NULL, lecture_id INTEGER NOT NULL, PRIMARY KEY (eventuser_id, lecture_id))",
...@@ -201,9 +199,14 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -201,9 +199,14 @@ public class BootstrapBean implements BootstrapBeanLocal {
"ALTER TABLE lecture_roles ADD CONSTRAINT FK_lecture_roles_lecture_id FOREIGN KEY (lecture_id) REFERENCES lectures (id)", "ALTER TABLE lecture_roles ADD CONSTRAINT FK_lecture_roles_lecture_id FOREIGN KEY (lecture_id) REFERENCES lectures (id)",
"ALTER TABLE lecture_roles ADD CONSTRAINT FK_lecture_roles_role_id FOREIGN KEY (role_id) REFERENCES roles (id)", "ALTER TABLE lecture_roles ADD CONSTRAINT FK_lecture_roles_role_id FOREIGN KEY (role_id) REFERENCES roles (id)",
"ALTER TABLE lecture_participants ADD CONSTRAINT FK_lecture_participants_eventuser_id FOREIGN KEY (eventuser_id) REFERENCES event_users (id)", "ALTER TABLE lecture_participants ADD CONSTRAINT FK_lecture_participants_eventuser_id FOREIGN KEY (eventuser_id) REFERENCES event_users (id)",
"ALTER TABLE lecture_participants ADD CONSTRAINT FK_lecture_participants_lecture_id FOREIGN KEY (lecture_id) REFERENCES lectures (id)"}); "ALTER TABLE lecture_participants ADD CONSTRAINT FK_lecture_participants_lecture_id FOREIGN KEY (lecture_id) REFERENCES lectures (id)" });
dbUpdates.add(new String[] { "ALTER TABLE roles ADD COLUMN user_selectable_role boolean DEFAULT false;" }); dbUpdates.add(new String[] { "ALTER TABLE roles ADD COLUMN user_selectable_role boolean DEFAULT false;" });
dbUpdates.add(new String[] {
"ALTER TABLE group_memberships ADD COLUMN place_product INTEGER",
"ALTER TABLE group_memberships ADD CONSTRAINT FK_group_memberships_place_product FOREIGN KEY (place_product) REFERENCES products (id)"
});
} }
@EJB @EJB
......
...@@ -10,7 +10,6 @@ import java.util.ArrayList; ...@@ -10,7 +10,6 @@ import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
...@@ -42,6 +41,7 @@ import com.pdfjet.TextLine; ...@@ -42,6 +41,7 @@ import com.pdfjet.TextLine;
import fi.codecrew.moya.enums.apps.MapPermission; import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.SpecialPermission; import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.exceptions.BortalCatchableException; import fi.codecrew.moya.exceptions.BortalCatchableException;
import fi.codecrew.moya.facade.EventMapFacade;
import fi.codecrew.moya.facade.EventUserFacade; import fi.codecrew.moya.facade.EventUserFacade;
import fi.codecrew.moya.facade.GroupMembershipFacade; import fi.codecrew.moya.facade.GroupMembershipFacade;
import fi.codecrew.moya.facade.PlaceFacade; import fi.codecrew.moya.facade.PlaceFacade;
...@@ -107,6 +107,8 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -107,6 +107,8 @@ public class PlaceBean implements PlaceBeanLocal {
@EJB @EJB
private BarcodeBeanLocal barcodeBean; private BarcodeBeanLocal barcodeBean;
@EJB
private EventMapFacade eventMapFacade;
@Override @Override
@RolesAllowed(MapPermission.S_MANAGE_MAPS) @RolesAllowed(MapPermission.S_MANAGE_MAPS)
...@@ -637,4 +639,33 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -637,4 +639,33 @@ public class PlaceBean implements PlaceBeanLocal {
} }
} }
@Override
public Long selectablePlaceCount(EventMap map) {
return placeFacade.countSelectable(map);
}
@Override
public EventMap findMap(Integer mapId) {
return eventMapFacade.find(mapId);
}
@Override
public Long availablePlaceCount(EventMap map) {
return placeFacade.countAvailable(map);
}
@Override
public EventMap getActiveMap() {
LanEvent event = eventBean.getCurrentEvent();
logger.info("Current event: {}, maps {}", event, event.getEventMaps());
for (EventMap map : event.getEventMaps()) {
logger.info("Checking active map {}, is active {}", map, map.isActive());
if (map.isActive()) {
return map;
}
}
return null;
}
} }
package fi.codecrew.moya.beans;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.imageio.ImageIO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.pdfjet.CoreFont;
import com.pdfjet.Image;
import com.pdfjet.ImageType;
import com.pdfjet.PDF;
import com.pdfjet.Page;
import com.pdfjet.TextLine;
import fi.codecrew.moya.facade.EventMapFacade;
import fi.codecrew.moya.facade.PlaceFacade;
import fi.codecrew.moya.model.CardTemplate;
import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place;
import fi.codecrew.moya.model.PrintedCard;
import fi.codecrew.moya.util.MassPrintResult;
/**
* Session Bean implementation class PlaceMapBean
*/
@Stateless
public class PlaceMapBean implements PlaceMapBeanLocal {
/**
* Default constructor.
*/
public PlaceMapBean() {
// TODO Auto-generated constructor stub
}
@EJB
private PlaceFacade placeFacade;
@EJB
// private EventMapBean eventmapBean;
private EventMapFacade eventMapFacade;
@EJB
private EventBeanLocal eventbean;
private static final Logger logger = LoggerFactory.getLogger(PlaceMapBean.class);
@Override
public Long selectablePlaceCount(EventMap map) {
return eventMapFacade.countSelectable(map);
}
@Override
public EventMap findMap(Integer mapId) {
return eventMapFacade.find(mapId);
}
@Override
public Long availablePlaceCount(EventMap map) {
return eventMapFacade.countAvailable(map);
}
@Override
public EventMap getActiveMap() {
LanEvent event = eventbean.getCurrentEvent();
logger.info("Current event: {}, maps {}", event, event.getEventMaps());
for (EventMap map : event.getEventMaps()) {
logger.info("Checking active map {}, is active {}", map, map.isActive());
if (map.isActive()) {
return map;
}
}
return null;
}
}
...@@ -28,8 +28,11 @@ import fi.codecrew.moya.enums.apps.UserPermission; ...@@ -28,8 +28,11 @@ import fi.codecrew.moya.enums.apps.UserPermission;
import fi.codecrew.moya.facade.AccountEventFacade; import fi.codecrew.moya.facade.AccountEventFacade;
import fi.codecrew.moya.facade.BillLineFacade; import fi.codecrew.moya.facade.BillLineFacade;
import fi.codecrew.moya.facade.DiscountFacade; import fi.codecrew.moya.facade.DiscountFacade;
import fi.codecrew.moya.facade.EventMapFacade;
import fi.codecrew.moya.facade.EventUserFacade; import fi.codecrew.moya.facade.EventUserFacade;
import fi.codecrew.moya.facade.GroupMembershipFacade;
import fi.codecrew.moya.facade.InventoryEventFacade; import fi.codecrew.moya.facade.InventoryEventFacade;
import fi.codecrew.moya.facade.PlaceFacade;
import fi.codecrew.moya.facade.ProductFacade; import fi.codecrew.moya.facade.ProductFacade;
import fi.codecrew.moya.facade.UserFacade; import fi.codecrew.moya.facade.UserFacade;
import fi.codecrew.moya.model.AccountEvent; import fi.codecrew.moya.model.AccountEvent;
...@@ -107,6 +110,14 @@ public class ProductBean implements ProductBeanLocal { ...@@ -107,6 +110,14 @@ public class ProductBean implements ProductBeanLocal {
@EJB @EJB
private CardTemplateBean cardTemplateBean; private CardTemplateBean cardTemplateBean;
@EJB
private PlaceFacade placeFacade;
@EJB
private EventMapFacade mapfacade;
@EJB
private GroupMembershipFacade gmfacade;
private static final Logger logger = LoggerFactory.getLogger(ProductBean.class); private static final Logger logger = LoggerFactory.getLogger(ProductBean.class);
/** /**
...@@ -188,6 +199,15 @@ public class ProductBean implements ProductBeanLocal { ...@@ -188,6 +199,15 @@ public class ProductBean implements ProductBeanLocal {
return getPrivateProductLimit(product, user, prodCounts, userroles); return getPrivateProductLimit(product, user, prodCounts, userroles);
} }
/**
* Returns available products to be bought for the user.
*
* @param product
* @param user
* @param prodCounts
* @param userroles
* @return Number of buyable products
*/
private BigDecimal getPrivateProductLimit(Product product, EventUser user, Map<Integer, BigDecimal> prodCounts, Set<Role> userroles) private BigDecimal getPrivateProductLimit(Product product, EventUser user, Map<Integer, BigDecimal> prodCounts, Set<Role> userroles)
{ {
BigDecimal ret = null; BigDecimal ret = null;
...@@ -222,15 +242,26 @@ public class ProductBean implements ProductBeanLocal { ...@@ -222,15 +242,26 @@ public class ProductBean implements ProductBeanLocal {
switch (limit.getType()) switch (limit.getType())
{ {
case GLOBAL_BILLED: case PLACE: {
Long reserved = 0L;
Long available = 0L;
for (Product p : limit.getProducts()) {
reserved += gmfacade.findPlaceProductCount(p);
available += placeFacade.findCountForProduct(p);
}
ret = BigDecimal.valueOf(available - reserved).subtract(count);
break;
}
case GLOBAL_BILLED: {
BigDecimal globBillTot = BigDecimal.ZERO; BigDecimal globBillTot = BigDecimal.ZERO;
for (Product p : limit.getProducts()) { for (Product p : limit.getProducts()) {
BillSummary globBilledSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent()); BillSummary globBilledSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent());
globBillTot = globBillTot.add(globBilledSummary.getTotal()); globBillTot = globBillTot.add(globBilledSummary.getActive());
} }
count = count.add(globBillTot); count = count.add(globBillTot);
ret = limit.getUpperLimit().subtract(count); ret = limit.getUpperLimit().subtract(count);
break; break;
}
case GLOBAL_BILL_PAID: case GLOBAL_BILL_PAID:
BigDecimal globBillPaid = BigDecimal.ZERO; BigDecimal globBillPaid = BigDecimal.ZERO;
for (Product p : limit.getProducts()) { for (Product p : limit.getProducts()) {
...@@ -258,7 +289,7 @@ public class ProductBean implements ProductBeanLocal { ...@@ -258,7 +289,7 @@ public class ProductBean implements ProductBeanLocal {
BigDecimal userBillTot = BigDecimal.ZERO; BigDecimal userBillTot = BigDecimal.ZERO;
for (Product p : limit.getProducts()) { for (Product p : limit.getProducts()) {
BillSummary userBilledSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent(), user); BillSummary userBilledSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent(), user);
userBillTot = userBillTot.add(userBilledSummary.getTotal()); userBillTot = userBillTot.add(userBilledSummary.getActive());
} }
count = count.add(userBillTot); count = count.add(userBillTot);
ret = limit.getUpperLimit().subtract(count); ret = limit.getUpperLimit().subtract(count);
......
...@@ -2,13 +2,8 @@ package fi.codecrew.moya.facade; ...@@ -2,13 +2,8 @@ package fi.codecrew.moya.facade;
import javax.ejb.LocalBean; import javax.ejb.LocalBean;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import fi.codecrew.moya.model.Place_;
import fi.codecrew.moya.model.EventMap; import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.Place;
@Stateless @Stateless
@LocalBean @LocalBean
...@@ -18,43 +13,4 @@ public class EventMapFacade extends IntegerPkGenericFacade<EventMap> { ...@@ -18,43 +13,4 @@ public class EventMapFacade extends IntegerPkGenericFacade<EventMap> {
super(EventMap.class); super(EventMap.class);
} }
public Long countAvailable(EventMap map) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<Place> root = cq.from(Place.class);
cq.select(cb.count(root));
cq.where(
cb.equal(root.get(Place_.map), map),
cb.isFalse(root.get(Place_.disabled))
);
return getSingleNullableResult(getEm().createQuery(cq));
}
public Long countSelectable(EventMap map) {
if (map == null) {
return null;
}
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<Place> root = cq.from(Place.class);
cq.select(cb.count(root));
cq.where(
cb.equal(root.get(Place_.map), map),
cb.isNull(root.get(Place_.releaseTime)),
cb.isNull(root.get(Place_.group)),
cb.isFalse(root.get(Place_.disabled))
);
return getSingleNullableResult(getEm().createQuery(cq));
}
} }
...@@ -20,6 +20,7 @@ import fi.codecrew.moya.model.GroupMembership_; ...@@ -20,6 +20,7 @@ import fi.codecrew.moya.model.GroupMembership_;
import fi.codecrew.moya.model.PlaceGroup; import fi.codecrew.moya.model.PlaceGroup;
import fi.codecrew.moya.model.PlaceGroup_; import fi.codecrew.moya.model.PlaceGroup_;
import fi.codecrew.moya.model.Place_; import fi.codecrew.moya.model.Place_;
import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.utilities.PasswordFunctions; import fi.codecrew.moya.utilities.PasswordFunctions;
@Stateless @Stateless
...@@ -71,7 +72,7 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi ...@@ -71,7 +72,7 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi
CriteriaQuery<GroupMembership> cq = cb.createQuery(GroupMembership.class); CriteriaQuery<GroupMembership> cq = cb.createQuery(GroupMembership.class);
Root<GroupMembership> root = cq.from(GroupMembership.class); Root<GroupMembership> root = cq.from(GroupMembership.class);
cq.where(cb.like(root.get(GroupMembership_.inviteToken), "%"+token+"%"), cq.where(cb.like(root.get(GroupMembership_.inviteToken), "%" + token + "%"),
cb.equal(root.get(GroupMembership_.placeGroup).get(PlaceGroup_.event), eventbean.getCurrentEvent()) cb.equal(root.get(GroupMembership_.placeGroup).get(PlaceGroup_.event), eventbean.getCurrentEvent())
); );
...@@ -137,4 +138,16 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi ...@@ -137,4 +138,16 @@ public class GroupMembershipFacade extends IntegerPkGenericFacade<GroupMembershi
return getEm().createQuery(cq).getResultList(); return getEm().createQuery(cq).getResultList();
} }
public Long findPlaceProductCount(Product product) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<GroupMembership> root = cq.from(GroupMembership.class);
cq.select(cb.count(root));
cq.where(cb.equal(root.get(GroupMembership_.placeProduct), product));
return super.getSingleNullableResult(getEm().createQuery(cq));
}
} }
...@@ -22,6 +22,7 @@ import fi.codecrew.moya.model.EventUser; ...@@ -22,6 +22,7 @@ import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.LanEvent; import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place; import fi.codecrew.moya.model.Place;
import fi.codecrew.moya.model.Place_; import fi.codecrew.moya.model.Place_;
import fi.codecrew.moya.model.Product;
@Stateless @Stateless
@LocalBean @LocalBean
...@@ -128,17 +129,65 @@ public class PlaceFacade extends IntegerPkGenericFacade<Place> { ...@@ -128,17 +129,65 @@ public class PlaceFacade extends IntegerPkGenericFacade<Place> {
return getSingleNullableResult(getEm().createQuery(cq)); return getSingleNullableResult(getEm().createQuery(cq));
} }
public List<Place> findAll() { public List<Place> findAll() {
CriteriaBuilder cb = getEm().getCriteriaBuilder(); CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Place> cq = cb.createQuery(Place.class); CriteriaQuery<Place> cq = cb.createQuery(Place.class);
Root<Place> root = cq.from(Place.class); Root<Place> root = cq.from(Place.class);
cq.where( cb.equal(root.get(Place_.map).get(EventMap_.event), eventBean.getCurrentEvent())); cq.where(cb.equal(root.get(Place_.map).get(EventMap_.event), eventBean.getCurrentEvent()));
cq.orderBy(cb.asc(root.get(Place_.name))); cq.orderBy(cb.asc(root.get(Place_.name)));
return getEm().createQuery(cq).getResultList(); return getEm().createQuery(cq).getResultList();
} }
}
public Long findCountForProduct(Product product) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<Place> root = cq.from(Place.class);
cq.select(cb.count(root));
cq.where(
cb.equal(root.get(Place_.product), product),
cb.isFalse(root.get(Place_.disabled))
);
return super.getSingleNullableResult(getEm().createQuery(cq));
}
public Long countAvailable(EventMap map) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<Place> root = cq.from(Place.class);
cq.select(cb.count(root));
cq.where(
cb.equal(root.get(Place_.map), map),
cb.isFalse(root.get(Place_.disabled))
);
return getSingleNullableResult(getEm().createQuery(cq));
}
public Long countSelectable(EventMap map) {
if (map == null) {
return null;
}
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<Long> cq = cb.createQuery(Long.class);
Root<Place> root = cq.from(Place.class);
cq.select(cb.count(root));
cq.where(
cb.equal(root.get(Place_.map), map),
cb.isNull(root.get(Place_.releaseTime)),
cb.isNull(root.get(Place_.group)),
cb.isFalse(root.get(Place_.disabled))
);
return getSingleNullableResult(getEm().createQuery(cq));
}
}
...@@ -72,4 +72,12 @@ public interface PlaceBeanLocal { ...@@ -72,4 +72,12 @@ public interface PlaceBeanLocal {
PlaceGroup reserveSelectedPlaces(EventUser eventuser) throws BortalCatchableException; PlaceGroup reserveSelectedPlaces(EventUser eventuser) throws BortalCatchableException;
public Long selectablePlaceCount(EventMap activeMap);
public EventMap findMap(Integer mapId);
public Long availablePlaceCount(EventMap activeMap);
public EventMap getActiveMap();
} }
package fi.codecrew.moya.beans;
import java.util.List;
import javax.ejb.Local;
import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.Place;
@Local
public interface PlaceMapBeanLocal {
// public String getSelectPlaceMapUrl(EventMap activeMap, List<Place>
// selectedPlaces, User user);
public Long selectablePlaceCount(EventMap activeMap);
public EventMap findMap(Integer mapId);
public Long availablePlaceCount(EventMap activeMap);
public EventMap getActiveMap();
// wanha poistoon, see placebean
// public byte[] placeCodesPdf(List<Place> places);
// public List<Place> findSelectedPlaces(EventMap map);
// public EventMap findMap(int i);
}
...@@ -11,26 +11,35 @@ public class BillSummary { ...@@ -11,26 +11,35 @@ public class BillSummary {
} }
private String name; private String name;
private BigDecimal total = BigDecimal.ZERO; private BigDecimal active = BigDecimal.ZERO;
private BigDecimal paid = BigDecimal.ZERO; private BigDecimal paid = BigDecimal.ZERO;
private BigDecimal expired = BigDecimal.ZERO;
public String getName() { public String getName() {
return name; return name;
} }
public BigDecimal getTotal() { public BigDecimal getActive() {
return total; return active;
} }
public void addLine(BillLine bl) { public void addLine(BillLine bl) {
total = getTotal().add(bl.getQuantity()); if (bl.getBill().isExpired()) {
expired = getExpired().add(bl.getQuantity());
} else {
active = getActive().add(bl.getQuantity());
if (bl.getBill().getPaidDate() != null) { if (bl.getBill().getPaidDate() != null) {
paid = getPaid().add(bl.getQuantity()); paid = getPaid().add(bl.getQuantity());
} }
} }
}
public BigDecimal getPaid() { public BigDecimal getPaid() {
return paid; return paid;
} }
public BigDecimal getExpired() {
return expired;
}
} }
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
*/ */
package fi.codecrew.moya.model; package fi.codecrew.moya.model;
import java.beans.Transient;
import java.util.Calendar; import java.util.Calendar;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
...@@ -54,8 +53,11 @@ public class GroupMembership extends GenericEntity { ...@@ -54,8 +53,11 @@ public class GroupMembership extends GenericEntity {
@JoinColumn(name = "place_reservation_id", referencedColumnName = "id", nullable = true, unique = true) @JoinColumn(name = "place_reservation_id", referencedColumnName = "id", nullable = true, unique = true)
private Place placeReservation; private Place placeReservation;
@JoinColumn(name = EVENTUSER_ID, referencedColumnName = EventUser.ID_COLUMN) @ManyToOne
@JoinColumn(name = "place_product")
private Product placeProduct;
@JoinColumn(name = EVENTUSER_ID, referencedColumnName = EventUser.ID_COLUMN)
@ManyToOne @ManyToOne
private EventUser user; private EventUser user;
...@@ -143,4 +145,12 @@ public class GroupMembership extends GenericEntity { ...@@ -143,4 +145,12 @@ public class GroupMembership extends GenericEntity {
public String getInviteToken() { public String getInviteToken() {
return inviteToken; return inviteToken;
} }
public Product getPlaceProduct() {
return placeProduct;
}
public void setPlaceProduct(Product placeProduct) {
this.placeProduct = placeProduct;
}
} }
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
package fi.codecrew.moya.model; package fi.codecrew.moya.model;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -134,9 +132,9 @@ public class Product extends GenericEntity { ...@@ -134,9 +132,9 @@ public class Product extends GenericEntity {
} }
private Product(String string) { private Product(String name) {
super(); super();
name = "----"; this.name = name;
} }
public BigDecimal getSoldCash() { public BigDecimal getSoldCash() {
......
...@@ -2,5 +2,5 @@ package fi.codecrew.moya.model; ...@@ -2,5 +2,5 @@ package fi.codecrew.moya.model;
public enum ProductLimitationType { public enum ProductLimitationType {
GLOBAL_BILLED, GLOBAL_BILL_PAID, GLOBAL_ACCOUNTEVENTS, USER_BILLED, USER_BILL_PAID, USER_ACCOUNTEVENTS, GLOBAL_BILLED, GLOBAL_BILL_PAID, GLOBAL_ACCOUNTEVENTS, USER_BILLED, USER_BILL_PAID, USER_ACCOUNTEVENTS, PLACE
} }
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['product.boughtTotal']}" /> <h:outputText value="${i18n['product.boughtTotal']}" />
</f:facet> </f:facet>
<h:outputText value="#{sumline.total}"> <h:outputText value="#{sumline.active}">
<f:convertNumber /> <f:convertNumber />
</h:outputText> </h:outputText>
</h:column> </h:column>
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
<f:convertNumber /> <f:convertNumber />
</h:outputText> </h:outputText>
</h:column> </h:column>
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['product.expired']}" />
</f:facet>
<h:outputText value="#{sumline.expired}">
<f:convertNumber />
</h:outputText>
</h:column>
</h:dataTable> </h:dataTable>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
...@@ -9,6 +9,7 @@ acc_line.time = Transaction Date ...@@ -9,6 +9,7 @@ acc_line.time = Transaction Date
accountEvent.commit = Save accountEvent.commit = Save
accountEvent.delete = Delete accountEvent.delete = Delete
accountEvent.deliver = Deliver
accountEvent.delivered = Delivered accountEvent.delivered = Delivered
accountEvent.edit = Edit accountEvent.edit = Edit
accountEvent.eventTime = Time accountEvent.eventTime = Time
...@@ -124,12 +125,15 @@ bortalApplication.COMPO = Managing compos ...@@ -124,12 +125,15 @@ bortalApplication.COMPO = Managing compos
bortalApplication.CONTENT = Product & shop management bortalApplication.CONTENT = Product & shop management
bortalApplication.EVENT = Event permissions bortalApplication.EVENT = Event permissions
bortalApplication.LAYOUT = Laout management bortalApplication.LAYOUT = Laout management
bortalApplication.LECTURE = Lecture permissions
bortalApplication.LICENSE = License stuff bortalApplication.LICENSE = License stuff
bortalApplication.MAP = Map management bortalApplication.MAP = Map management
bortalApplication.NETWORKASSOCIATION = Network association related permissions
bortalApplication.POLL = Polling stuff bortalApplication.POLL = Polling stuff
bortalApplication.SALESPOINT = Managing salespoint bortalApplication.SALESPOINT = Managing salespoint
bortalApplication.SHOP = Product and shop management bortalApplication.SHOP = Product and shop management
bortalApplication.TERMINAL = Sales and self help terminal roles bortalApplication.TERMINAL = Sales and self help terminal roles
bortalApplication.TOURNAMENT = Tournament permissions
bortalApplication.USER = User management related bortalApplication.USER = User management related
bortalApplication.bill.CREATE_BILL = Create bills for self bortalApplication.bill.CREATE_BILL = Create bills for self
bortalApplication.bill.CREATE_VERKKOMAKSU = Can create web payment to self bortalApplication.bill.CREATE_VERKKOMAKSU = Can create web payment to self
...@@ -144,8 +148,12 @@ bortalApplication.content.MANAGE_ACTIONLOG = Manage actionlog ...@@ -144,8 +148,12 @@ bortalApplication.content.MANAGE_ACTIONLOG = Manage actionlog
bortalApplication.content.MANAGE_MENU = Manage menus bortalApplication.content.MANAGE_MENU = Manage menus
bortalApplication.content.MANAGE_NEWS = Manage newsgroups bortalApplication.content.MANAGE_NEWS = Manage newsgroups
bortalApplication.content.MANAGE_PAGES = Manage pages bortalApplication.content.MANAGE_PAGES = Manage pages
bortalApplication.event.MANAGE_EVENT = Can manage event
bortalApplication.event.MANAGE_PRIVATE_PROPERTIES = Can manage event private properties bortalApplication.event.MANAGE_PRIVATE_PROPERTIES = Can manage event private properties
bortalApplication.event.MANAGE_PROPERTIES = Can manage event properties bortalApplication.event.MANAGE_PROPERTIES = Can manage event properties
bortalApplication.lecture.MANAGE = Can manage lectures and courses
bortalApplication.lecture.PARTICIPATE = Can participate to lectures and courses
bortalApplication.lecture.VIEW = Can view lectures and courses
bortalApplication.license.MANAGE = Can manage licenses bortalApplication.license.MANAGE = Can manage licenses
bortalApplication.license.VIEW_OWN_CODES = Can view own licenses bortalApplication.license.VIEW_OWN_CODES = Can view own licenses
bortalApplication.map.BUY_PLACES = Reserve and buy places from map bortalApplication.map.BUY_PLACES = Reserve and buy places from map
...@@ -153,6 +161,11 @@ bortalApplication.map.MANAGE_MAPS = Create and modify maps ...@@ -153,6 +161,11 @@ bortalApplication.map.MANAGE_MAPS = Create and modify maps
bortalApplication.map.MANAGE_OTHERS = Manage other users reservations in map bortalApplication.map.MANAGE_OTHERS = Manage other users reservations in map
bortalApplication.map.RELEASE_PLACE = Can release place bortalApplication.map.RELEASE_PLACE = Can release place
bortalApplication.map.VIEW = View maps bortalApplication.map.VIEW = View maps
bortalApplication.networkauthentication.CAN_ADMINISTER_ASSOCIATIONS = Can manage network associations
bortalApplication.networkauthentication.CAN_ASSOCIATE = Can associate to network
bortalApplication.networkauthentication.CAN_ASSOCIATE_MANY_PER_PLACE = Can associate many clients per one place
bortalApplication.networkauthentication.CAN_SHUFFLE_IN_GROUP = Can suffle place in same group
bortalApplication.networkauthentication.OVERRIDE_PLACE_REQUIREMENT = Can override placecode requirement
bortalApplication.poll.ANSWER = Can answer and view availabe polls bortalApplication.poll.ANSWER = Can answer and view availabe polls
bortalApplication.poll.CREATE = Create and manage polls bortalApplication.poll.CREATE = Create and manage polls
bortalApplication.poll.VIEW_RESULTS = View anonymized poll results bortalApplication.poll.VIEW_RESULTS = View anonymized poll results
...@@ -165,9 +178,16 @@ bortalApplication.shop.MANAGE_PRODUCTS = Create and modify products ...@@ -165,9 +178,16 @@ bortalApplication.shop.MANAGE_PRODUCTS = Create and modify products
bortalApplication.shop.SHOP_FOODWAVE = Can shop on food wave bortalApplication.shop.SHOP_FOODWAVE = Can shop on food wave
bortalApplication.shop.SHOP_PRODUCTS = Shop products to self bortalApplication.shop.SHOP_PRODUCTS = Shop products to self
bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
bortalApplication.terminal.ADMIN = Admin terminal
bortalApplication.terminal.CASHIER = Access cashier terminal functions bortalApplication.terminal.CASHIER = Access cashier terminal functions
bortalApplication.terminal.CUSTOMER = Access client terminal functions bortalApplication.terminal.CUSTOMER = Access client terminal functions
bortalApplication.terminal.INFO = Info terminal
bortalApplication.terminal.SELFHELP = Self help terminal bortalApplication.terminal.SELFHELP = Self help terminal
bortalApplication.terminal.USER = User terminal
bortalApplication.tournament.MANAGE_ALL = Can manage all tournaments
bortalApplication.tournament.PARTICIPATE = Can participate in tournament
bortalApplication.tournament.REMOVE_OWN_PARTICIPATION = Can remove own participation
bortalApplication.tournament.VIEW = Can view tournaments
bortalApplication.tournamentstatus.COMPLETED = Completed bortalApplication.tournamentstatus.COMPLETED = Completed
bortalApplication.tournamentstatus.IN_PROGRESS = In progress bortalApplication.tournamentstatus.IN_PROGRESS = In progress
bortalApplication.tournamentstatus.SETUP = Setup bortalApplication.tournamentstatus.SETUP = Setup
...@@ -181,10 +201,12 @@ bortalApplication.user.LOGOUT = Can logout ...@@ -181,10 +201,12 @@ bortalApplication.user.LOGOUT = Can logout
bortalApplication.user.MANAGE_HTTP_SESSION = Manage http sessions bortalApplication.user.MANAGE_HTTP_SESSION = Manage http sessions
bortalApplication.user.MODIFY = Modify users bortalApplication.user.MODIFY = Modify users
bortalApplication.user.MODIFY_ACCOUNTEVENTS = Modify Account events bortalApplication.user.MODIFY_ACCOUNTEVENTS = Modify Account events
bortalApplication.user.MODIFY_OWN_GAMEIDS = Can modify own game IDs
bortalApplication.user.READ_ORGROLES = View organization roles bortalApplication.user.READ_ORGROLES = View organization roles
bortalApplication.user.READ_ROLES = View all roles. bortalApplication.user.READ_ROLES = View all roles.
bortalApplication.user.VIEW_ACCOUNTEVENTS = Show other users account events bortalApplication.user.VIEW_ACCOUNTEVENTS = Show other users account events
bortalApplication.user.VIEW_ALL = View all users bortalApplication.user.VIEW_ALL = View all users
bortalApplication.user.VIEW_ALL_GAMEIDS = Can view all game IDs
bortalApplication.user.VIEW_OWN_ACCOUNTEVENTS = View own accountevent bortalApplication.user.VIEW_OWN_ACCOUNTEVENTS = View own accountevent
bortalApplication.user.VIEW_SELF = Can view self bortalApplication.user.VIEW_SELF = Can view self
bortalApplication.user.VITUTTAAKO = Can send feedback bortalApplication.user.VITUTTAAKO = Can send feedback
...@@ -540,10 +562,13 @@ lanEventPrivateProperty.value = Private property value ...@@ -540,10 +562,13 @@ lanEventPrivateProperty.value = Private property value
lanEventPrivateProperty.valueIsRawdataWarning = Raw value lanEventPrivateProperty.valueIsRawdataWarning = Raw value
lanEventProperty.booleanValue = Boolean value lanEventProperty.booleanValue = Boolean value
lanEventProperty.confirmDelete = Confirm delete
lanEventProperty.createProperty = Create property lanEventProperty.createProperty = Create property
lanEventProperty.defaultValue = Default value lanEventProperty.defaultValue = Default value
lanEventProperty.deleteProperty = Delete property
lanEventProperty.editProperty = Edit property lanEventProperty.editProperty = Edit property
lanEventProperty.key = Property key lanEventProperty.key = Property key
lanEventProperty.longValue = Long value
lanEventProperty.save = Save lanEventProperty.save = Save
lanEventProperty.textValue = Text value lanEventProperty.textValue = Text value
lanEventProperty.value = Property value lanEventProperty.value = Property value
...@@ -653,8 +678,11 @@ menu.sort = Sort ...@@ -653,8 +678,11 @@ menu.sort = Sort
menu.toAdmin = Adminview menu.toAdmin = Adminview
menu.toUser = Userview menu.toUser = Userview
menuitem.key = Menuitem key
menuitem.navigation.key = Product flag menuitem.navigation.key = Product flag
menulist.header = Menulist
nasty.user = Go away! nasty.user = Go away!
networkassociation.action = Action networkassociation.action = Action
...@@ -700,6 +728,7 @@ org.hibernate.validator.constraints.NotEmpty.message = may not be empty ...@@ -700,6 +728,7 @@ org.hibernate.validator.constraints.NotEmpty.message = may not be empty
org.hibernate.validator.constraints.Range.message = must be between {min} and {max} org.hibernate.validator.constraints.Range.message = must be between {min} and {max}
orgrole.create = Create orgrole.create = Create
orgrole.edit = Edit orgrole
orgrole.list.title = Organization role list orgrole.list.title = Organization role list
orgrole.name = Name orgrole.name = Name
orgrole.parents = Parent orgrole.parents = Parent
...@@ -898,6 +927,7 @@ product.unitName = Unit name ...@@ -898,6 +927,7 @@ product.unitName = Unit name
product.vat = VAT-% (0.0 - 0.99) product.vat = VAT-% (0.0 - 0.99)
productFlag.CREATE_NEW_PLACE_WHEN_BOUGHT = Create new place bought productFlag.CREATE_NEW_PLACE_WHEN_BOUGHT = Create new place bought
productFlag.HIDE_FROM_INFOSHOP = Hide from info shop
productFlag.PREPAID_CREDIT = Prepaid credit productFlag.PREPAID_CREDIT = Prepaid credit
productFlag.PREPAID_INSTANT_CREATE = Prepaid instant create productFlag.PREPAID_INSTANT_CREATE = Prepaid instant create
productFlag.RESERVE_PLACE_WHEN_BOUGHT = Reserve place when bought productFlag.RESERVE_PLACE_WHEN_BOUGHT = Reserve place when bought
...@@ -998,6 +1028,8 @@ salespoint.noSalesPoints = Amount ...@@ -998,6 +1028,8 @@ salespoint.noSalesPoints = Amount
save = Save save = Save
sendImage = Send image
sendPicture.header = S sendPicture.header = S
shop.accountBalance = Credits shop.accountBalance = Credits
...@@ -1227,6 +1259,7 @@ tournament.admin.delete = Delete ...@@ -1227,6 +1259,7 @@ tournament.admin.delete = Delete
tournament.admin.delete_cancel = Cancel Deletion tournament.admin.delete_cancel = Cancel Deletion
tournament.admin.delete_confirm = Confirm Deletion tournament.admin.delete_confirm = Confirm Deletion
tournament.admin.edit = Edit tournament.admin.edit = Edit
tournament.admin.tournament_deleted_successfully = Tournament deleted successfully
tournament.admin.tournament_edited_successfully = Edited successfully tournament.admin.tournament_edited_successfully = Edited successfully
tournament.admin.tournament_rules_edit_failed = Rule Edit Failed tournament.admin.tournament_rules_edit_failed = Rule Edit Failed
tournament.admin.tournament_rules_edited_successfully = Rules successfully edited tournament.admin.tournament_rules_edited_successfully = Rules successfully edited
......
...@@ -9,6 +9,7 @@ acc_line.time = Ostoaika ...@@ -9,6 +9,7 @@ acc_line.time = Ostoaika
accountEvent.commit = Tallenna accountEvent.commit = Tallenna
accountEvent.delete = Poista accountEvent.delete = Poista
accountEvent.deliver = Toimita
accountEvent.delivered = Toimitettu accountEvent.delivered = Toimitettu
accountEvent.edit = Muokkaa accountEvent.edit = Muokkaa
accountEvent.eventTime = Aika accountEvent.eventTime = Aika
...@@ -125,12 +126,15 @@ bortalApplication.COMPO = Compojen oikeudet ...@@ -125,12 +126,15 @@ bortalApplication.COMPO = Compojen oikeudet
bortalApplication.CONTENT = Sis\u00E4lt\u00F6jen hallitaoikeudet bortalApplication.CONTENT = Sis\u00E4lt\u00F6jen hallitaoikeudet
bortalApplication.EVENT = Tapahtuman oikeudet bortalApplication.EVENT = Tapahtuman oikeudet
bortalApplication.LAYOUT = N\u00E4kymien hallinta bortalApplication.LAYOUT = N\u00E4kymien hallinta
bortalApplication.LECTURE = Kurssien ja luentojen oikeudet
bortalApplication.LICENSE = Lisenssioikeudet bortalApplication.LICENSE = Lisenssioikeudet
bortalApplication.MAP = Karttojen oikeudet bortalApplication.MAP = Karttojen oikeudet
bortalApplication.NETWORKASSOCIATION = Verkkoon liittymisen oikeudet
bortalApplication.POLL = Kyselyiden oikeudet bortalApplication.POLL = Kyselyiden oikeudet
bortalApplication.SALESPOINT = Myyntipisteiden oikeudet bortalApplication.SALESPOINT = Myyntipisteiden oikeudet
bortalApplication.SHOP = Kaupan oikeudet bortalApplication.SHOP = Kaupan oikeudet
bortalApplication.TERMINAL = K\u00E4ytt\u00F6p\u00E4\u00E4tteiden roolit bortalApplication.TERMINAL = K\u00E4ytt\u00F6p\u00E4\u00E4tteiden roolit
bortalApplication.TOURNAMENT = Turnauksien oikeudet
bortalApplication.USER = K\u00E4ytt\u00E4j\u00E4oikeudet bortalApplication.USER = K\u00E4ytt\u00E4j\u00E4oikeudet
bortalApplication.bill.CREATE_BILL = Voi luoda laskuja itselle bortalApplication.bill.CREATE_BILL = Voi luoda laskuja itselle
bortalApplication.bill.CREATE_VERKKOMAKSU = Voi luoda verkkomaksun itselleen bortalApplication.bill.CREATE_VERKKOMAKSU = Voi luoda verkkomaksun itselleen
...@@ -145,8 +149,12 @@ bortalApplication.content.MANAGE_ACTIONLOG = Saa hallita tapahtumalogia ...@@ -145,8 +149,12 @@ bortalApplication.content.MANAGE_ACTIONLOG = Saa hallita tapahtumalogia
bortalApplication.content.MANAGE_MENU = Saa hallinnoida valikoita bortalApplication.content.MANAGE_MENU = Saa hallinnoida valikoita
bortalApplication.content.MANAGE_NEWS = Saa hallinnoida uutisia bortalApplication.content.MANAGE_NEWS = Saa hallinnoida uutisia
bortalApplication.content.MANAGE_PAGES = Saa hallinnoida sivuja bortalApplication.content.MANAGE_PAGES = Saa hallinnoida sivuja
bortalApplication.event.MANAGE_EVENT = Saa hallinnoida tapahtumaa
bortalApplication.event.MANAGE_PRIVATE_PROPERTIES = Saa hallita tapahtuman yksityisi\u00E4 asetuksia bortalApplication.event.MANAGE_PRIVATE_PROPERTIES = Saa hallita tapahtuman yksityisi\u00E4 asetuksia
bortalApplication.event.MANAGE_PROPERTIES = Saa hallita tapahtuman asetuksia bortalApplication.event.MANAGE_PROPERTIES = Saa hallita tapahtuman asetuksia
bortalApplication.lecture.MANAGE = Saa hallinnoida kursseja ja luentoja
bortalApplication.lecture.PARTICIPATE = Saa osallistua kursseille ja luennoille
bortalApplication.lecture.VIEW = Saa n\u00E4hd\u00E4 kurssit ja luennot
bortalApplication.license.MANAGE = Saa hallinnoida lisenssej\u00E4 bortalApplication.license.MANAGE = Saa hallinnoida lisenssej\u00E4
bortalApplication.license.VIEW_OWN_CODES = Voi katsella omia lisenssej\u00E4 bortalApplication.license.VIEW_OWN_CODES = Voi katsella omia lisenssej\u00E4
bortalApplication.map.BUY_PLACES = Voi varata ja ostaa konepaikkoja kartalta bortalApplication.map.BUY_PLACES = Voi varata ja ostaa konepaikkoja kartalta
...@@ -154,6 +162,11 @@ bortalApplication.map.MANAGE_MAPS = Saa luoda ja muokata karttoj ...@@ -154,6 +162,11 @@ bortalApplication.map.MANAGE_MAPS = Saa luoda ja muokata karttoj
bortalApplication.map.MANAGE_OTHERS = Saa hallita muiden k\u00E4ytt\u00E4jien varauksia kartalla bortalApplication.map.MANAGE_OTHERS = Saa hallita muiden k\u00E4ytt\u00E4jien varauksia kartalla
bortalApplication.map.RELEASE_PLACE = Voi vapauttaa paikan bortalApplication.map.RELEASE_PLACE = Voi vapauttaa paikan
bortalApplication.map.VIEW = Saa n\u00E4hd\u00E4 kartat bortalApplication.map.VIEW = Saa n\u00E4hd\u00E4 kartat
bortalApplication.networkauthentication.CAN_ADMINISTER_ASSOCIATIONS = Saa hallinnoida verkkoon liittymisi\u00E4
bortalApplication.networkauthentication.CAN_ASSOCIATE = Saa liitty\u00E4 verkkoon
bortalApplication.networkauthentication.CAN_ASSOCIATE_MANY_PER_PLACE = Saa liitt\u00E4\u00E4 useamman laitteen samaan paikkaan
bortalApplication.networkauthentication.CAN_SHUFFLE_IN_GROUP = Saa olla eri paikalla samassa ryhm\u00E4ss\u00E4
bortalApplication.networkauthentication.OVERRIDE_PLACE_REQUIREMENT = Ei tarvitse paikkakoodia
bortalApplication.poll.ANSWER = Voi vastata avoimiin kyselyihin bortalApplication.poll.ANSWER = Voi vastata avoimiin kyselyihin
bortalApplication.poll.CREATE = Saa luoda ja hallita kyselyit\u00E4 bortalApplication.poll.CREATE = Saa luoda ja hallita kyselyit\u00E4
bortalApplication.poll.VIEW_RESULTS = Saa n\u00E4hd\u00E4 nimett\u00F6mien kyselyiden vastaukset bortalApplication.poll.VIEW_RESULTS = Saa n\u00E4hd\u00E4 nimett\u00F6mien kyselyiden vastaukset
...@@ -166,9 +179,16 @@ bortalApplication.shop.MANAGE_PRODUCTS = Saa luoda ja muokata tuottei ...@@ -166,9 +179,16 @@ bortalApplication.shop.MANAGE_PRODUCTS = Saa luoda ja muokata tuottei
bortalApplication.shop.SHOP_FOODWAVE = Voi ostaa ruokatilauksessa bortalApplication.shop.SHOP_FOODWAVE = Voi ostaa ruokatilauksessa
bortalApplication.shop.SHOP_PRODUCTS = Voi ostaa tuotteita itselle bortalApplication.shop.SHOP_PRODUCTS = Voi ostaa tuotteita itselle
bortalApplication.shop.SHOP_TO_OTHERS = Saa ostaa tuotteita muille bortalApplication.shop.SHOP_TO_OTHERS = Saa ostaa tuotteita muille
bortalApplication.terminal.ADMIN = Yll\u00E4pitop\u00E4\u00E4te
bortalApplication.terminal.CASHIER = Muokata rahastusp\u00E4\u00E4tteiden toimintoja bortalApplication.terminal.CASHIER = Muokata rahastusp\u00E4\u00E4tteiden toimintoja
bortalApplication.terminal.CUSTOMER = Muokata k\u00E4vij\u00E4p\u00E4\u00E4tteiden toimintoja bortalApplication.terminal.CUSTOMER = Muokata k\u00E4vij\u00E4p\u00E4\u00E4tteiden toimintoja
bortalApplication.terminal.INFO = Infop\u00E4\u00E4te
bortalApplication.terminal.SELFHELP = Itsepalvelup\u00E4\u00E4te bortalApplication.terminal.SELFHELP = Itsepalvelup\u00E4\u00E4te
bortalApplication.terminal.USER = K\u00E4ytt\u00E4j\u00E4p\u00E4\u00E4te
bortalApplication.tournament.MANAGE_ALL = Saa hallita kaikkia turnauksia
bortalApplication.tournament.PARTICIPATE = Saa osallistua turnaukseen
bortalApplication.tournament.REMOVE_OWN_PARTICIPATION = Saa perua oman osallistumisen turnaukseen
bortalApplication.tournament.VIEW = Saa katsoa turnauksia
bortalApplication.tournamentstatus.COMPLETED = P\u00E4\u00E4ttynyt bortalApplication.tournamentstatus.COMPLETED = P\u00E4\u00E4ttynyt
bortalApplication.tournamentstatus.IN_PROGRESS = K\u00E4ynniss\u00E4 bortalApplication.tournamentstatus.IN_PROGRESS = K\u00E4ynniss\u00E4
bortalApplication.tournamentstatus.SETUP = Valmistelussa bortalApplication.tournamentstatus.SETUP = Valmistelussa
...@@ -182,10 +202,12 @@ bortalApplication.user.LOGOUT = Voi uloskirjautua ...@@ -182,10 +202,12 @@ bortalApplication.user.LOGOUT = Voi uloskirjautua
bortalApplication.user.MANAGE_HTTP_SESSION = Saa hallita http istuntoja bortalApplication.user.MANAGE_HTTP_SESSION = Saa hallita http istuntoja
bortalApplication.user.MODIFY = Saa muokata k\u00E4ytt\u00E4ji\u00E4 bortalApplication.user.MODIFY = Saa muokata k\u00E4ytt\u00E4ji\u00E4
bortalApplication.user.MODIFY_ACCOUNTEVENTS = Saa muokata k\u00E4ytt\u00E4j\u00E4tapahtumia bortalApplication.user.MODIFY_ACCOUNTEVENTS = Saa muokata k\u00E4ytt\u00E4j\u00E4tapahtumia
bortalApplication.user.MODIFY_OWN_GAMEIDS = Saa muokata omia peli-ID:it\u00E4
bortalApplication.user.READ_ORGROLES = Saa n\u00E4hd\u00E4 j\u00E4rjest\u00E4j\u00E4roolit bortalApplication.user.READ_ORGROLES = Saa n\u00E4hd\u00E4 j\u00E4rjest\u00E4j\u00E4roolit
bortalApplication.user.READ_ROLES = Saa n\u00E4hd\u00E4 kaikki roolit bortalApplication.user.READ_ROLES = Saa n\u00E4hd\u00E4 kaikki roolit
bortalApplication.user.VIEW_ACCOUNTEVENTS = Saa n\u00E4hd\u00E4 muiden k\u00E4ytt\u00E4jien tapahtumat bortalApplication.user.VIEW_ACCOUNTEVENTS = Saa n\u00E4hd\u00E4 muiden k\u00E4ytt\u00E4jien tapahtumat
bortalApplication.user.VIEW_ALL = Saa n\u00E4hd\u00E4 kaikki k\u00E4ytt\u00E4j\u00E4t bortalApplication.user.VIEW_ALL = Saa n\u00E4hd\u00E4 kaikki k\u00E4ytt\u00E4j\u00E4t
bortalApplication.user.VIEW_ALL_GAMEIDS = Saa n\u00E4hd\u00E4 kaikki peli-ID:t
bortalApplication.user.VIEW_OWN_ACCOUNTEVENTS = Tarkastele omia tilitapahtumia bortalApplication.user.VIEW_OWN_ACCOUNTEVENTS = Tarkastele omia tilitapahtumia
bortalApplication.user.VIEW_SELF = Voi katsella omaa tunnusta bortalApplication.user.VIEW_SELF = Voi katsella omaa tunnusta
bortalApplication.user.VITUTTAAKO = Saa avautua bortalApplication.user.VITUTTAAKO = Saa avautua
...@@ -550,10 +572,13 @@ lanEventPrivateProperty.value = Ominaisuuden arvo ...@@ -550,10 +572,13 @@ lanEventPrivateProperty.value = Ominaisuuden arvo
lanEventPrivateProperty.valueIsRawdataWarning = Raaka arvo lanEventPrivateProperty.valueIsRawdataWarning = Raaka arvo
lanEventProperty.booleanValue = Totuusarvo lanEventProperty.booleanValue = Totuusarvo
lanEventProperty.confirmDelete = Vahvista poisto
lanEventProperty.createProperty = Luo ominaisuus lanEventProperty.createProperty = Luo ominaisuus
lanEventProperty.defaultValue = Oletusarvo lanEventProperty.defaultValue = Oletusarvo
lanEventProperty.deleteProperty = Poista ominaisuus
lanEventProperty.editProperty = Muokkaa arvoa lanEventProperty.editProperty = Muokkaa arvoa
lanEventProperty.key = Ominaisuuden avain lanEventProperty.key = Ominaisuuden avain
lanEventProperty.longValue = Koko arvo
lanEventProperty.save = Tallenna lanEventProperty.save = Tallenna
lanEventProperty.textValue = Tekstiarvo lanEventProperty.textValue = Tekstiarvo
lanEventProperty.value = Ominaisuuden arvo lanEventProperty.value = Ominaisuuden arvo
...@@ -664,6 +689,10 @@ menu.toAdmin = Yll\u00E4piton\u00E4kym\u00E4 ...@@ -664,6 +689,10 @@ menu.toAdmin = Yll\u00E4piton\u00E4kym\u00E4
menu.toUser = K\u00E4ytt\u00E4j\u00E4n\u00E4kym\u00E4 menu.toUser = K\u00E4ytt\u00E4j\u00E4n\u00E4kym\u00E4
menu.user.edit = Omat tiedot menu.user.edit = Omat tiedot
menuitem.key = Valikkolinkin avain
menulist.header = Valikkolista
nasty.user = Mene pois! nasty.user = Mene pois!
networkassociation.action = Toiminto networkassociation.action = Toiminto
...@@ -709,6 +738,7 @@ org.hibernate.validator.constraints.NotEmpty.message = may not be empty ...@@ -709,6 +738,7 @@ org.hibernate.validator.constraints.NotEmpty.message = may not be empty
org.hibernate.validator.constraints.Range.message = must be between {min} and {max} org.hibernate.validator.constraints.Range.message = must be between {min} and {max}
orgrole.create = Luo orgrole.create = Luo
orgrole.edit = Muokkaa j\u00E4rjest\u00E4j\u00E4roolia
orgrole.list.title = Lista organisaation rooleista orgrole.list.title = Lista organisaation rooleista
orgrole.name = Nimi orgrole.name = Nimi
orgrole.parents = Periytyy orgrole.parents = Periytyy
...@@ -881,6 +911,7 @@ product.unitName = Tuoteyksikk\u00F6 ...@@ -881,6 +911,7 @@ product.unitName = Tuoteyksikk\u00F6
product.vat = ALV-% (0.0 - 0.99) product.vat = ALV-% (0.0 - 0.99)
productFlag.CREATE_NEW_PLACE_WHEN_BOUGHT = Luo uusi paikka ostettaessa productFlag.CREATE_NEW_PLACE_WHEN_BOUGHT = Luo uusi paikka ostettaessa
productFlag.HIDE_FROM_INFOSHOP = Piilota infon kaupasta
productFlag.PREPAID_CREDIT = Prepaid credit productFlag.PREPAID_CREDIT = Prepaid credit
productFlag.PREPAID_INSTANT_CREATE = Ostettaessa luotava tuote productFlag.PREPAID_INSTANT_CREATE = Ostettaessa luotava tuote
productFlag.RESERVE_PLACE_WHEN_BOUGHT = Varaa paikka ostettaessa productFlag.RESERVE_PLACE_WHEN_BOUGHT = Varaa paikka ostettaessa
...@@ -980,6 +1011,8 @@ salespoint.noSalesPoints = M\u00E4\u00E4r\u00E4 ...@@ -980,6 +1011,8 @@ salespoint.noSalesPoints = M\u00E4\u00E4r\u00E4
save = Tallenna save = Tallenna
sendImage = L\u00E4het\u00E4 kuva
sendPicture.header = L\u00E4het\u00E4 kuva sendPicture.header = L\u00E4het\u00E4 kuva
shop.accountBalance = Credits shop.accountBalance = Credits
...@@ -1210,6 +1243,7 @@ tournament.admin.delete = Poista ...@@ -1210,6 +1243,7 @@ tournament.admin.delete = Poista
tournament.admin.delete_cancel = Peruuta tournament.admin.delete_cancel = Peruuta
tournament.admin.delete_confirm = Vahvista Poisto tournament.admin.delete_confirm = Vahvista Poisto
tournament.admin.edit = Muokkaa tournament.admin.edit = Muokkaa
tournament.admin.tournament_deleted_successfully = Turnaus onnistuneesti poistettu
tournament.admin.tournament_edited_successfully = Turnauksen asetuksia muutettu tournament.admin.tournament_edited_successfully = Turnauksen asetuksia muutettu
tournament.admin.tournament_rules_edit_failed = S\u00E4\u00E4nt\u00F6jen muutos ep\u00E4onnistui tournament.admin.tournament_rules_edit_failed = S\u00E4\u00E4nt\u00F6jen muutos ep\u00E4onnistui
tournament.admin.tournament_rules_edited_successfully = S\u00E4\u00E4nt\u00F6jen muutos tehty tournament.admin.tournament_rules_edited_successfully = S\u00E4\u00E4nt\u00F6jen muutos tehty
......
...@@ -15,7 +15,6 @@ import javax.ws.rs.Produces; ...@@ -15,7 +15,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import fi.codecrew.moya.beans.PlaceGroupBeanLocal; import fi.codecrew.moya.beans.PlaceGroupBeanLocal;
import fi.codecrew.moya.beans.PlaceMapBeanLocal;
import fi.codecrew.moya.beans.ProductBeanLocal; import fi.codecrew.moya.beans.ProductBeanLocal;
import fi.codecrew.moya.model.AccountEvent; import fi.codecrew.moya.model.AccountEvent;
import fi.codecrew.moya.model.Product; import fi.codecrew.moya.model.Product;
...@@ -29,8 +28,6 @@ import fi.codecrew.moya.rest.highcharts.HcSeriesRoot; ...@@ -29,8 +28,6 @@ import fi.codecrew.moya.rest.highcharts.HcSeriesRoot;
public class AccountEventRestView { public class AccountEventRestView {
@EJB @EJB
private PlaceMapBeanLocal placemapbean;
@EJB
private PlaceGroupBeanLocal pgbean; private PlaceGroupBeanLocal pgbean;
@EJB @EJB
private ProductBeanLocal productBean; private ProductBeanLocal productBean;
......
...@@ -24,7 +24,6 @@ import fi.codecrew.moya.beans.EventBeanLocal; ...@@ -24,7 +24,6 @@ import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.EventMapBeanLocal; import fi.codecrew.moya.beans.EventMapBeanLocal;
import fi.codecrew.moya.beans.PlaceBeanLocal; import fi.codecrew.moya.beans.PlaceBeanLocal;
import fi.codecrew.moya.beans.PlaceGroupBeanLocal; import fi.codecrew.moya.beans.PlaceGroupBeanLocal;
import fi.codecrew.moya.beans.PlaceMapBeanLocal;
import fi.codecrew.moya.beans.ProductBeanLocal; import fi.codecrew.moya.beans.ProductBeanLocal;
import fi.codecrew.moya.beans.UserBeanLocal; import fi.codecrew.moya.beans.UserBeanLocal;
import fi.codecrew.moya.exceptions.BortalCatchableException; import fi.codecrew.moya.exceptions.BortalCatchableException;
...@@ -46,8 +45,6 @@ public class MapAdminView { ...@@ -46,8 +45,6 @@ public class MapAdminView {
@EJB @EJB
private EventMapBeanLocal eventmapbean; private EventMapBeanLocal eventmapbean;
@EJB @EJB
private PlaceMapBeanLocal placemapbean;
@EJB
private PlaceGroupBeanLocal pgbean; private PlaceGroupBeanLocal pgbean;
@EJB @EJB
private EventBeanLocal eventbean; private EventBeanLocal eventbean;
...@@ -64,7 +61,7 @@ public class MapAdminView { ...@@ -64,7 +61,7 @@ public class MapAdminView {
@Path("/background/{mapId}") @Path("/background/{mapId}")
public Response getMapBg(@PathParam("mapId") Integer mapid) public Response getMapBg(@PathParam("mapId") Integer mapid)
{ {
EventMap map = placemapbean.findMap(mapid); EventMap map = placebean.findMap(mapid);
ByteArrayInputStream istream = new ByteArrayInputStream(map.getMapData()); ByteArrayInputStream istream = new ByteArrayInputStream(map.getMapData());
return Response.ok().entity(istream).type("image/jpeg").build(); return Response.ok().entity(istream).type("image/jpeg").build();
} }
...@@ -80,7 +77,7 @@ public class MapAdminView { ...@@ -80,7 +77,7 @@ public class MapAdminView {
@GET @GET
@Path("/places/{mapId}") @Path("/places/{mapId}")
public PlaceRoot getPlaces(@PathParam("mapId") Integer mapid) { public PlaceRoot getPlaces(@PathParam("mapId") Integer mapid) {
EventMap map = placemapbean.findMap(mapid); EventMap map = placebean.findMap(mapid);
PlaceRoot ret = new PlaceRoot(map); PlaceRoot ret = new PlaceRoot(map);
logger.info("returning map {} entity {}", mapid, ret); logger.info("returning map {} entity {}", mapid, ret);
return ret; return ret;
......
...@@ -13,8 +13,8 @@ import javax.ws.rs.Path; ...@@ -13,8 +13,8 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import fi.codecrew.moya.beans.PlaceBeanLocal;
import fi.codecrew.moya.beans.PlaceGroupBeanLocal; import fi.codecrew.moya.beans.PlaceGroupBeanLocal;
import fi.codecrew.moya.beans.PlaceMapBeanLocal;
import fi.codecrew.moya.model.EventMap; import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.Place; import fi.codecrew.moya.model.Place;
import fi.codecrew.moya.model.PlaceGroup; import fi.codecrew.moya.model.PlaceGroup;
...@@ -26,14 +26,14 @@ import fi.codecrew.moya.model.PlaceGroup; ...@@ -26,14 +26,14 @@ import fi.codecrew.moya.model.PlaceGroup;
public class MapRestView { public class MapRestView {
@EJB @EJB
private PlaceMapBeanLocal placemapbean; private PlaceBeanLocal placebean;
@EJB @EJB
private PlaceGroupBeanLocal pgbean; private PlaceGroupBeanLocal pgbean;
@GET @GET
@Path("/dateJson") @Path("/dateJson")
public String getAllCards() { public String getAllCards() {
EventMap map = placemapbean.getActiveMap(); EventMap map = placebean.getActiveMap();
Map<Integer, Map<Integer, Map<Integer, Integer>>> counts = new HashMap<>(); Map<Integer, Map<Integer, Map<Integer, Integer>>> counts = new HashMap<>();
......
...@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory; ...@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.LoggingBeanLocal; import fi.codecrew.moya.beans.LoggingBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal; import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.PlaceMapBeanLocal; import fi.codecrew.moya.beans.PlaceBeanLocal;
import fi.codecrew.moya.beans.SecurityLogType; import fi.codecrew.moya.beans.SecurityLogType;
import fi.codecrew.moya.enums.apps.MapPermission; import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.model.EventMap; import fi.codecrew.moya.model.EventMap;
...@@ -49,7 +49,7 @@ public class PlaceMap extends HttpServlet { ...@@ -49,7 +49,7 @@ public class PlaceMap extends HttpServlet {
private static final long serialVersionUID = 8769688627918936258L; private static final long serialVersionUID = 8769688627918936258L;
@EJB @EJB
private transient PlaceMapBeanLocal placemapBean; private transient PlaceBeanLocal placeBean;
@EJB @EJB
private transient PermissionBeanLocal permbean; private transient PermissionBeanLocal permbean;
...@@ -87,7 +87,7 @@ public class PlaceMap extends HttpServlet { ...@@ -87,7 +87,7 @@ public class PlaceMap extends HttpServlet {
// Integer userId = getIntegerParameter(request, // Integer userId = getIntegerParameter(request,
// PARAMETER_CURRENT_USER_ID); Tämä saadaan beaneilta. // PARAMETER_CURRENT_USER_ID); Tämä saadaan beaneilta.
EventMap map = placemapBean.findMap(mapId); EventMap map = placeBean.findMap(mapId);
logger.debug("Mapid: {}", mapId); logger.debug("Mapid: {}", mapId);
ostream = response.getOutputStream(); ostream = response.getOutputStream();
......
...@@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory; ...@@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.EventBeanLocal; import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.PlaceBeanLocal; import fi.codecrew.moya.beans.PlaceBeanLocal;
import fi.codecrew.moya.beans.PlaceMapBeanLocal;
import fi.codecrew.moya.enums.apps.MapPermission; import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.model.EventMap; import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.EventUser; import fi.codecrew.moya.model.EventUser;
...@@ -25,8 +24,6 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView; ...@@ -25,8 +24,6 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
public class MapView extends GenericCDIView { public class MapView extends GenericCDIView {
private static final long serialVersionUID = 2374905512998240551L; private static final long serialVersionUID = 2374905512998240551L;
@EJB
private transient PlaceMapBeanLocal placeMapBean;
@Inject @Inject
@SelectedUser @SelectedUser
...@@ -79,7 +76,7 @@ public class MapView extends GenericCDIView { ...@@ -79,7 +76,7 @@ public class MapView extends GenericCDIView {
} }
public Long getPlacesLeftToSelect() { public Long getPlacesLeftToSelect() {
Long ret = placeMapBean.selectablePlaceCount(getActiveMap()); Long ret = placeBean.selectablePlaceCount(getActiveMap());
logger.debug("Got {} places left for map {}", ret, getActiveMap()); logger.debug("Got {} places left for map {}", ret, getActiveMap());
return ret; return ret;
...@@ -88,7 +85,7 @@ public class MapView extends GenericCDIView { ...@@ -88,7 +85,7 @@ public class MapView extends GenericCDIView {
public Long getAvailablePlaces() public Long getAvailablePlaces()
{ {
Long ret = placeMapBean.availablePlaceCount(getActiveMap()); Long ret = placeBean.availablePlaceCount(getActiveMap());
logger.debug("Got {} availbale places for map {}", ret, getActiveMap()); logger.debug("Got {} availbale places for map {}", ret, getActiveMap());
return ret; return ret;
...@@ -98,7 +95,7 @@ public class MapView extends GenericCDIView { ...@@ -98,7 +95,7 @@ public class MapView extends GenericCDIView {
@Produces @Produces
public EventMap getActiveMap() { public EventMap getActiveMap() {
if (activeMap == null) { if (activeMap == null) {
activeMap = placeMapBean.getActiveMap(); activeMap = placeBean.getActiveMap();
} }
return activeMap; return activeMap;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!