Commit 558d52a0 by Tuukka Kivilahti, TKffTK

Merge branch 'master' of codecrew.fi:bortal

Conflicts:
	code/LanBortalWeb/WebContent/permissionDenied.xhtml
	code/LanBortalWeb/WebContent/resources/cditools/bills/list.xhtml
2 parents 139d54b3 b8065ab6
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<attribute name="owner.project.facets" value="jst.utility"/> <attribute name="owner.project.facets" value="jst.utility"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_05"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>
</attributes> </attributes>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<attribute name="owner.project.facets" value="jst.web"/> <attribute name="owner.project.facets" value="jst.web"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_05"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>
</attributes> </attributes>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<ui:define name="content"> <ui:define name="content">
<h1>#{i18n['permissiondenied.header']}</h1> <h1>#{i18n['permissiondenied.header']}</h1>
<p> <p>
<h:outputText rendered="#{!sessionHandler.loggedIn}" value="#{i18n['permissiondenied.notLoggedIn']}" /> <h:outputText rendered="#{not sessionHandler.loggedIn}" value="#{i18n['permissiondenied.notLoggedIn']}" />
<h:outputText rendered="#{sessionHandler.loggedIn}" value="#{i18n['permissiondenied.alreadyLoggedIn']}" /> <h:outputText rendered="#{sessionHandler.loggedIn}" value="#{i18n['permissiondenied.alreadyLoggedIn']}" />
</p> </p>
</ui:define> </ui:define>
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
<h:outputText rendered="#{billListView.bills.rowCount le 0}" value="#{i18n['bills.noBills']}" /> <h:outputText rendered="#{billListView.bills.rowCount le 0}" value="#{i18n['bills.noBills']}" />
<h:form rendered="#{billListView.bills.rowCount gt 0}"> <h:form rendered="#{billListView.bills.rowCount gt 0}">
<h:dataTable styleClass="bordertable" id="billList" value="#{billListView.bills}" var="bill"> <h:dataTable styleClass="bordertable" id="billList" value="#{billListView.bills}" var="bill">
<h:column rendered="#{billListView.canWriteBill()}"> <h:column rendered="#{billListView.canWriteBill}">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['bill.payer']}" /> <h:outputText value="${i18n['bill.payer']}" />
</f:facet> </f:facet>
<h:link rendered="#{billListView.canWriteBill()}" outcome="/useradmin/edit" value="#{bill.addr1}"> <h:link rendered="#{billListView.canWriteBill}" outcome="/useradmin/edit" value="#{bill.addr1}">
<f:param name="userid" value="#{bill.user.user.id}" /> <f:param name="userid" value="#{bill.user.user.id}" />
</h:link> </h:link>
<h:outputText rendered="#{!billListView.canWriteBill}" value="#{bill.addr1}" /> <h:outputText rendered="#{not billListView.canWriteBill}" value="#{bill.addr1}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
...@@ -59,12 +59,12 @@ ...@@ -59,12 +59,12 @@
<f:param name="billid" value="#{bill.id}" /> <f:param name="billid" value="#{bill.id}" />
</h:link> </h:link>
</h:column> </h:column>
<h:column rendered="#{billListView.canWriteBill()}"> <h:column rendered="#{billListView.canWriteBill}">
<h:link outcome="/bill/edit" value="#{i18n['bill.edit']}"> <h:link outcome="/bill/edit" value="#{i18n['bill.edit']}">
<f:param name="billid" value="#{bill.id}" /> <f:param name="billid" value="#{bill.id}" />
</h:link> </h:link>
</h:column> </h:column>
<h:column rendered="#{billListView.canWriteBill()}"> <h:column rendered="#{billListView.canWriteBill}">
<h:commandButton rendered="#{bill.paidDate == null}" action="#{billListView.markPaid()}" value="#{i18n['bill.markPaid']}"> <h:commandButton rendered="#{bill.paidDate == null}" action="#{billListView.markPaid()}" value="#{i18n['bill.markPaid']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
......
...@@ -45,19 +45,19 @@ ...@@ -45,19 +45,19 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" /> <h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet> </f:facet>
<h:commandButton action="#{foodShopView.add(-10)}" value="#{i18n['productshop.minusTen']}"> <h:commandButton action="#{foodShopView.addMinusTen}" value="#{i18n['productshop.minusTen']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:commandButton action="#{foodShopView.add(-1)}" value="#{i18n['productshop.minusOne']}"> <h:commandButton action="#{foodShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}"> <h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:ajax render="@form" event="valueChange" /> <f:ajax render="@form" event="valueChange" />
</h:inputText> </h:inputText>
<h:commandButton action="#{foodShopView.add(1)}" value="#{i18n['productshop.plusOne']}"> <h:commandButton action="#{foodShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:commandButton action="#{foodShopView.add(10)}" value="#{i18n['productshop.plusTen']}"> <h:commandButton action="#{foodShopView.addTen}" value="#{i18n['productshop.plusTen']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
</h:column> </h:column>
......
...@@ -45,19 +45,19 @@ ...@@ -45,19 +45,19 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" /> <h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet> </f:facet>
<h:commandButton action="#{foodShopView.add(-10)}" value="#{i18n['productshop.minusTen']}"> <h:commandButton action="#{foodShopView.addMinusTen}" value="#{i18n['productshop.minusTen']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:commandButton action="#{foodShopView.add(-1)}" value="#{i18n['productshop.minusOne']}"> <h:commandButton action="#{foodShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}"> <h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:ajax render="@form" event="valueChange" /> <f:ajax render="@form" event="valueChange" />
</h:inputText> </h:inputText>
<h:commandButton action="#{foodShopView.add(1)}" value="#{i18n['productshop.plusOne']}"> <h:commandButton action="#{foodShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:commandButton action="#{foodShopView.add(10)}" value="#{i18n['productshop.plusTen']}"> <h:commandButton action="#{foodShopView.addTen}" value="#{i18n['productshop.plusTen']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
</h:column> </h:column>
......
...@@ -46,20 +46,20 @@ ...@@ -46,20 +46,20 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" /> <h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet> </f:facet>
<h:commandButton action="#{productShopView.add(-10)}" value="#{i18n['productshop.minusTen']}"> <h:commandButton action="#{productShopView.addMinusTen}" value="#{i18n['productshop.minusTen']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:commandButton action="#{productShopView.add(-1)}" value="#{i18n['productshop.minusOne']}"> <h:commandButton action="#{productShopView.addMinusOne}" value="#{i18n['productshop.minusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:inputText size="4" id="cartcount" value="#{cart.count}"> <h:inputText size="4" id="cartcount" value="#{cart.count}">
<f:convertNumber maxIntegerDigits="2" minFractionDigits="0"/> <f:convertNumber maxIntegerDigits="2" minFractionDigits="0"/>
<f:ajax render="@form" event="valueChange" listener="#{productShopView.updateCartLimits}"/> <f:ajax render="@form" event="valueChange" listener="#{productShopView.updateCartLimits}"/>
</h:inputText> </h:inputText>
<h:commandButton action="#{productShopView.add(1)}" value="#{i18n['productshop.plusOne']}"> <h:commandButton action="#{productShopView.addOne}" value="#{i18n['productshop.plusOne']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
<h:commandButton action="#{productShopView.add(10)}" value="#{i18n['productshop.plusTen']}"> <h:commandButton action="#{productShopView.addTen}" value="#{i18n['productshop.plusTen']}">
<f:ajax render="@form" /> <f:ajax render="@form" />
</h:commandButton> </h:commandButton>
</h:column> </h:column>
......
...@@ -125,7 +125,9 @@ public class MapManageView extends GenericCDIView { ...@@ -125,7 +125,9 @@ public class MapManageView extends GenericCDIView {
} }
public String createMap() { public String createMap() {
map = eventmapBean.create(getMapname()); map = eventmapBean.create(getMapname());
return "edit"; return "edit";
} }
...@@ -183,6 +185,7 @@ public class MapManageView extends GenericCDIView { ...@@ -183,6 +185,7 @@ public class MapManageView extends GenericCDIView {
map = eventmapBean.saveMap(map); map = eventmapBean.saveMap(map);
logger.debug("places in map merge {}", map.getPlaces().size()); logger.debug("places in map merge {}", map.getPlaces().size());
return null; return null;
} }
......
...@@ -84,7 +84,7 @@ public class BillListView extends GenericCDIView { ...@@ -84,7 +84,7 @@ public class BillListView extends GenericCDIView {
return bills; return bills;
} }
public boolean canWriteBill() { public boolean isCanWriteBill() {
return writeBill; return writeBill;
} }
......
...@@ -84,6 +84,26 @@ public class FoodShopView extends GenericCDIView { ...@@ -84,6 +84,26 @@ public class FoodShopView extends GenericCDIView {
return null; return null;
} }
public String addOne()
{
return add(1);
}
public String addMinusOne()
{
return add(-1);
}
public String addTen()
{
return add(10);
}
public String addMinusTen()
{
return add(-10);
}
public BigDecimal getAccountBalance() public BigDecimal getAccountBalance()
{ {
BigDecimal ret = user.getAccountBalance(); BigDecimal ret = user.getAccountBalance();
......
...@@ -97,6 +97,26 @@ public class ProductShopView extends GenericCDIView { ...@@ -97,6 +97,26 @@ public class ProductShopView extends GenericCDIView {
return null; return null;
} }
public String addOne()
{
return add(1);
}
public String addMinusOne()
{
return add(-1);
}
public String addTen()
{
return add(10);
}
public String addMinusTen()
{
return add(-10);
}
public void updateCartLimits(ProductShopItem item) { public void updateCartLimits(ProductShopItem item) {
Map<Integer, BigDecimal> prodCounts = new HashMap<Integer, BigDecimal>(); Map<Integer, BigDecimal> prodCounts = new HashMap<Integer, BigDecimal>();
......
...@@ -59,12 +59,12 @@ public class AuthView extends GenericCDIView { ...@@ -59,12 +59,12 @@ public class AuthView extends GenericCDIView {
} }
public void executeLogin() { public String executeLogin() {
bootStrapBean.saneDefaults(); bootStrapBean.saneDefaults();
if (login == null || password == null || login.isEmpty() || password.isEmpty()) { if (login == null || password == null || login.isEmpty() || password.isEmpty()) {
return; return null;
} }
HttpServletRequest request = getRequest(); HttpServletRequest request = getRequest();
...@@ -99,7 +99,8 @@ public class AuthView extends GenericCDIView { ...@@ -99,7 +99,8 @@ public class AuthView extends GenericCDIView {
} }
} }
return;
return null;
} }
public String getLogin() { public String getLogin() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!