Commit f9733a22 by Tuomas Riihimäki

Some minor fixes and localisations

1 parent 7602d5ca
......@@ -96,7 +96,6 @@ public class MenuBean implements MenuBeanLocal {
userEvent.setKey("topnavi.userevent");
userEvent.addPage(menuitemfacade.findOrCreate("/poll/index"), PollPermission.ANSWER);
userEvent.addPage(menuitemfacade.findOrCreate("/poll/answerToPoll"), PollPermission.ANSWER).setVisible(false);
;
userEvent.addPage(menuitemfacade.findOrCreate("/user/invite"), UserPermission.INVITE_USERS);
userEvent.addPage(menuitemfacade.findOrCreate("/feedback/index"), UserPermission.VITUTTAAKO);
......
......@@ -206,8 +206,7 @@ public class ProductBean implements ProductBeanLocal {
{
case GLOBAL_BILLED:
BigDecimal globBillTot = BigDecimal.ZERO;
for (Product p : limit.getProducts())
{
for (Product p : limit.getProducts()) {
BillSummary globBilledSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent());
globBillTot = globBillTot.add(globBilledSummary.getTotal());
}
......@@ -216,8 +215,7 @@ public class ProductBean implements ProductBeanLocal {
break;
case GLOBAL_BILL_PAID:
BigDecimal globBillPaid = BigDecimal.ZERO;
for (Product p : limit.getProducts())
{
for (Product p : limit.getProducts()) {
BillSummary billPaidSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent());
globBillPaid = globBillPaid.add(billPaidSummary.getPaid());
}
......@@ -233,16 +231,14 @@ public class ProductBean implements ProductBeanLocal {
break;
case USER_ACCOUNTEVENTS:
BigDecimal userProductCount = accounteventfacade.getProductCount(limit.getProducts(), user);
if (userProductCount != null)
{
if (userProductCount != null) {
count = count.add(userProductCount);
}
ret = limit.getUpperLimit().subtract(count);
break;
case USER_BILLED:
BigDecimal userBillTot = BigDecimal.ZERO;
for (Product p : limit.getProducts())
{
for (Product p : limit.getProducts()) {
BillSummary userBilledSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent(), user);
userBillTot = userBillTot.add(userBilledSummary.getTotal());
}
......@@ -251,8 +247,7 @@ public class ProductBean implements ProductBeanLocal {
break;
case USER_BILL_PAID:
BigDecimal userBillPaid = BigDecimal.ZERO;
for (Product p : limit.getProducts())
{
for (Product p : limit.getProducts()) {
BillSummary userPaidSummary = billLineFacade.getLineSummary(p, eventbean.getCurrentEvent(), user);
userBillPaid = userBillPaid.add(userPaidSummary.getPaid());
}
......@@ -364,15 +359,15 @@ public class ProductBean implements ProductBeanLocal {
@Override
public List<Product> findPlaceProducts() {
ArrayList<Product> returnProducts = new ArrayList<Product>();
for(Product product : findProductsForEvent()) {
if(product.getPlaces() != null && product.getPlaces().size() > 0) {
for (Product product : findProductsForEvent()) {
if (product.getPlaces() != null && product.getPlaces().size() > 0) {
returnProducts.add(product);
}
}
return returnProducts;
}
}
......@@ -223,8 +223,8 @@ resetMail.username = Username
resetmailSent.body = Email has been sent containing a link where you can change the password.
resetmailSent.header = Email sent
submenu.NotImplementedYet = Not implemented
submenu.frontpage = Frontpage
submenu.NotImplementedYet = Not implemented
submenu.frontpage = Frontpage
subnavi.cards = \u0009\u0009
......
......@@ -910,6 +910,7 @@ submenu.auth.sendResetMail = Password reset
submenu.bill.billSummary = Bill summary
submenu.bill.list = My bills
submenu.bill.listAll = All bills
submenu.eventorg.editEvent = Edit event
submenu.eventorg.list = Manage Event
submenu.feedback.index = U Mad?!
submenu.foodadmin.createTemplate = Create foodwave template
......
......@@ -892,6 +892,7 @@ submenu.auth.sendResetMail = Salasanan palautus
submenu.bill.billSummary = Laskujen yhteenveto
submenu.bill.list = N\u00E4yt\u00E4 omat laskut
submenu.bill.listAll = Kaikki laskut
submenu.eventorg.editEvent = Tapahtuman tiedot
submenu.eventorg.list = Organisaation hallinta
submenu.feedback.index = Vituttaako?
submenu.foodadmin.createTemplate = Luo tilauspohja
......
......@@ -246,6 +246,7 @@ public class PlaceMap extends HttpServlet {
}
Color color = null;
if (!p.isBuyable()) {
logger.info("Locking place.");
color = LOCKED_COLOR;
}
......@@ -253,8 +254,7 @@ public class PlaceMap extends HttpServlet {
logger.debug("Setting place selected {}", p);
color = SELECTED_COLOR;
} else if (user.equals(p.getCurrentUser())
|| (p.getGroup() != null && user.equals(p.getGroup()
.getCreator()))
|| (p.getGroup() != null && user.equals(p.getGroup().getCreator()))
|| (p.getPlaceReserver() != null && user.equals(p
.getPlaceReserver().getUser()))) {
color = OWNED_COLOR;
......@@ -271,6 +271,9 @@ public class PlaceMap extends HttpServlet {
} catch (NumberFormatException x) {
logger.error("Cannot convert string {} to color.", p.getProduct().getColor());
}
} else {
logger.info("Nothing special for this place. Color should be default.");
}
g.setColor(BORDER_COLOR);
......
......@@ -94,9 +94,7 @@ public class ProductShopView extends GenericCDIView {
public void initBillView() {
if (requirePermissions(ShopPermission.LIST_USERPRODUCTS)
&& shoppingcart == null) {
shoppingcart = new ListDataModel<ProductShopItem>(
ProductShopItem.productList(productBean
.listUserShoppableProducts()));
shoppingcart = new ListDataModel<ProductShopItem>(ProductShopItem.productList(productBean.listUserShoppableProducts()));
updateCartLimits(null);
logger.debug("Initialized billing shoppingcart to {}", shoppingcart);
this.beginConversation();
......@@ -193,8 +191,7 @@ public class ProductShopView extends GenericCDIView {
prodCounts.put(sc.getProduct().getId(), sc.getCount());
}
HashMap<Integer, BigDecimal> limits = productBean.getProductLimit(
prodCounts, user);
HashMap<Integer, BigDecimal> limits = productBean.getProductLimit(prodCounts, user);
// Update the updated cart first
if (item != null) {
......
......@@ -128,6 +128,7 @@ public class UserView extends GenericCDIView {
}
public void handleImageUpload(FileUploadEvent event) {
logger.info("Handling fileupload with event {} and file", event, event.getFile());
FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, msg);
UploadedFile f = event.getFile();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!