Commit 71e44b57 by Tuomas Riihimäki

Merge branch 'master' of codecrew.fi:bortal

Conflicts:
	code/LanBortalWeb/WebContent/WEB-INF/web.xml
	code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/FoodShopView.java
2 parents 4e4b9d82 3e3852ef
Showing with 187 additions and 115 deletions
...@@ -7,7 +7,7 @@ import javax.persistence.metamodel.SetAttribute; ...@@ -7,7 +7,7 @@ import javax.persistence.metamodel.SetAttribute;
import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel; import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="Dali", date="2012-09-05T21:51:25.846+0300") @Generated(value="Dali", date="2012-10-06T04:04:21.088+0300")
@StaticMetamodel(Product.class) @StaticMetamodel(Product.class)
public class Product_ extends GenericEntity_ { public class Product_ extends GenericEntity_ {
public static volatile SingularAttribute<Product, LanEvent> event; public static volatile SingularAttribute<Product, LanEvent> event;
...@@ -19,10 +19,10 @@ public class Product_ extends GenericEntity_ { ...@@ -19,10 +19,10 @@ public class Product_ extends GenericEntity_ {
public static volatile SetAttribute<Product, ProductFlag> productFlags; public static volatile SetAttribute<Product, ProductFlag> productFlags;
public static volatile SingularAttribute<Product, Role> provides; public static volatile SingularAttribute<Product, Role> provides;
public static volatile ListAttribute<Product, Place> places; public static volatile ListAttribute<Product, Place> places;
public static volatile ListAttribute<Product, ProductLimitation> productLimits;
public static volatile ListAttribute<Product, AccountEvent> accountEvents; public static volatile ListAttribute<Product, AccountEvent> accountEvents;
public static volatile ListAttribute<Product, Discount> discounts; public static volatile ListAttribute<Product, Discount> discounts;
public static volatile SingularAttribute<Product, BigDecimal> vat; public static volatile SingularAttribute<Product, BigDecimal> vat;
public static volatile SingularAttribute<Product, String> unitName; public static volatile SingularAttribute<Product, String> unitName;
public static volatile ListAttribute<Product, FoodWaveTemplate> foodWaveTemplates; public static volatile ListAttribute<Product, FoodWaveTemplate> foodWaveTemplates;
public static volatile ListAttribute<Product, ProductLimitation> productLimits;
} }
...@@ -6,10 +6,9 @@ import javax.persistence.metamodel.ListAttribute; ...@@ -6,10 +6,9 @@ import javax.persistence.metamodel.ListAttribute;
import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel; import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="Dali", date="2012-09-10T17:55:33.516+0300") @Generated(value="Dali", date="2012-10-06T04:04:21.120+0300")
@StaticMetamodel(Reader.class) @StaticMetamodel(Reader.class)
public class Reader_ extends GenericEntity_ { public class Reader_ extends GenericEntity_ {
public static volatile SingularAttribute<Reader, ReaderType> type;
public static volatile SingularAttribute<Reader, LanEvent> event; public static volatile SingularAttribute<Reader, LanEvent> event;
public static volatile SingularAttribute<Reader, Integer> gamepoints; public static volatile SingularAttribute<Reader, Integer> gamepoints;
public static volatile SingularAttribute<Reader, Integer> maxEvents; public static volatile SingularAttribute<Reader, Integer> maxEvents;
...@@ -21,4 +20,5 @@ public class Reader_ extends GenericEntity_ { ...@@ -21,4 +20,5 @@ public class Reader_ extends GenericEntity_ {
public static volatile SingularAttribute<Reader, Integer> mapX; public static volatile SingularAttribute<Reader, Integer> mapX;
public static volatile SingularAttribute<Reader, Integer> mapY; public static volatile SingularAttribute<Reader, Integer> mapY;
public static volatile ListAttribute<Reader, ReaderEvent> events; public static volatile ListAttribute<Reader, ReaderEvent> events;
public static volatile SingularAttribute<Reader, ReaderType> type;
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.sun.enterprise.jst.server.runtimeTarget/GlassFish 3.1.2">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="jst.web"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.sun.enterprise.jst.server.runtimeTarget/GlassFish 3.1.2"> <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="jst.web"/> <attribute name="owner.project.facets" value="java"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/> <classpathentry kind="output" path="build/classes"/>
</classpath> </classpath>
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.compiler.source=1.6
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
xmlns:c="http://java.sun.com/jsp/jstl/core"> xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body> <h:body>
<ui:composition template="/layout/insomnia1/sidebartemplate.xhtml"> <ui:composition template="/layout/insomnia1/sidebartemplate.xhtml">
<ui:param name="rendered" value="#{!sessionHandler.isLoggedIn()}" /> <ui:param name="rendered" value="#{!sessionHandler.loggedIn}" />
<ui:define name="sidebarcontent"> <ui:define name="sidebarcontent">
<ul> <ul>
<li><h:link outcome="/user/create.xhtml" value="#{i18n['sidebar.createuser']}"/></li> <li><h:link outcome="/user/create.xhtml" value="#{i18n['sidebar.createuser']}"/></li>
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<meta http-equiv="Content-Language" content="fi" /> <meta http-equiv="Content-Language" content="fi" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia2/css/tyyli.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia2/css/tyyli.css" />
<!-- general style for nonlayout elements -->
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia2/css/general.css" />
<ui:insert name="headerdata" /> <ui:insert name="headerdata" />
<h:outputScript name="prime_calendar.js" library="script" /> <h:outputScript name="prime_calendar.js" library="script" />
</h:head> </h:head>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
xmlns:c="http://java.sun.com/jsp/jstl/core"> xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body> <h:body>
<ui:composition template="sidebartemplate.xhtml"> <ui:composition template="sidebartemplate.xhtml">
<ui:param name="rendered" value="#{!sessionHandler.isLoggedIn()}" /> <ui:param name="rendered" value="#{!sessionHandler.loggedIn}" />
<ui:define name="sidebarcontent"> <ui:define name="sidebarcontent">
<ul> <ul>
<li><h:link outcome="/user/create.xhtml" value="#{i18n['sidebar.createuser']}"/></li> <li><h:link outcome="/user/create.xhtml" value="#{i18n['sidebar.createuser']}"/></li>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<meta http-equiv="Content-Language" content="fi" /> <meta http-equiv="Content-Language" content="fi" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/template1/css/style.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/template1/css/style.css" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/template1/css/general.css" />
<ui:insert name="headerdata" /> <ui:insert name="headerdata" />
</h:head> </h:head>
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<ui:define name="content"> <ui:define name="content">
<h1>#{i18n['permissiondenied.header']}</h1> <h1>#{i18n['permissiondenied.header']}</h1>
<p> <p>
<h:outputText rendered="#{!sessionHandler.isLoggedIn()}" value="#{i18n['permissiondenied.notLoggedIn']}" /> <h:outputText rendered="#{not sessionHandler.loggedIn}" value="#{i18n['permissiondenied.notLoggedIn']}" />
<h:outputText rendered="#{sessionHandler.isLoggedIn()}" value="#{i18n['permissiondenied.alreadyLoggedIn']}" /> <h:outputText rendered="#{sessionHandler.loggedIn}" value="#{i18n['permissiondenied.alreadyLoggedIn']}" />
</p> </p>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</h:body> </h:body>
</html> </html>
\ No newline at end of file
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</h:column> </h:column>
<h:column> <h:column>
<h:commandButton rendered="#{placeGroupView.canModify(member) and !empty member.user}" <h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}"
action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}"
/> />
</h:column> </h:column>
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
</h:dataTable> </h:dataTable>
</h:form> </h:form>
<h:form rendered="#{!empty placeView.place.group and placeView.place.group.places.size() gt 0}"> <h:form rendered="#{!empty placeView.place.group and not placeView.place.group.places.empty">
<h:panelGrid columns="2"> <h:panelGrid columns="2">
<h:outputLabel value="#{i18n['placegroup.name']}:" /> <h:outputLabel value="#{i18n['placegroup.name']}:" />
<h:inputText value="#{placeView.place.group.name}" /> <h:inputText value="#{placeView.place.group.name}" />
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</h:column> </h:column>
<h:column> <h:column>
<h:commandButton rendered="#{placeGroupView.canModify(member) and !empty member.user}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" /> <h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" />
</h:column> </h:column>
</h:dataTable> </h:dataTable>
......
...@@ -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.updateAllCartLimits()}"/>
</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>
......
...@@ -21,52 +21,52 @@ ...@@ -21,52 +21,52 @@
<h:panelGrid columns="3"> <h:panelGrid columns="3">
<h:outputLabel rendered="#{!cc.attrs.creating}" value="#{i18n['user.login']}:" for="viewlogin" /> <h:outputLabel rendered="#{!cc.attrs.creating}" value="#{i18n['user.login']}:" for="viewlogin" />
<h:outputText rendered="#{!cc.attrs.creating}" disabled="#{!cc.attrs.creating and !userView.canSave()}" <h:outputText rendered="#{!cc.attrs.creating}" disabled="#{!cc.attrs.creating and !userView.canSave}"
id="viewlogin" value="#{userView.selectedUser.login}" id="viewlogin" value="#{userView.selectedUser.login}"
/> />
<h:message rendered="#{!cc.attrs.creating}" for="viewlogin" /> <h:message rendered="#{!cc.attrs.creating}" for="viewlogin" />
<h:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.login']}:" for="login" /> <h:outputLabel rendered="#{cc.attrs.creating}" value="#{i18n['user.login']}:" for="login" />
<h:inputText size="45" rendered="#{cc.attrs.creating}" validator="#{userValidator.login}" <h:inputText size="45" rendered="#{cc.attrs.creating}" validator="#{userValidator.login}"
disabled="#{!cc.attrs.creating and !userView.canSave()}" id="login" value="#{userView.selectedUser.login}" disabled="#{!cc.attrs.creating and !userView.canSave}" id="login" value="#{userView.selectedUser.login}"
/> />
<h:message rendered="#{cc.attrs.creating}" for="login" /> <h:message rendered="#{cc.attrs.creating}" for="login" />
<h:outputLabel value="#{i18n['user.nick']}:" for="nick" /> <h:outputLabel value="#{i18n['user.nick']}:" for="nick" />
<h:inputText size="45" id="nick" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.selectedUser.nick}" /> <h:inputText size="45" id="nick" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.nick}" />
<h:message for="nick" /> <h:message for="nick" />
<h:outputLabel value="#{i18n['user.email']}:" for="email" /> <h:outputLabel value="#{i18n['user.email']}:" for="email" />
<h:inputText validator="#{userValidator.validateEmail}" size="45" id="email" disabled="#{!cc.attrs.creating and !userView.canSave()}" <h:inputText validator="#{userValidator.validateEmail}" size="45" id="email" disabled="#{!cc.attrs.creating and !userView.canSave}"
value="#{userView.selectedUser.email}" value="#{userView.selectedUser.email}"
/> />
<h:message for="email" /> <h:message for="email" />
<h:outputLabel value="#{i18n['user.firstNames']}:" for="firstnames" /> <h:outputLabel value="#{i18n['user.firstNames']}:" for="firstnames" />
<h:inputText size="45" id="firstnames" disabled="#{!cc.attrs.creating and !userView.canSave()}" <h:inputText size="45" id="firstnames" disabled="#{!cc.attrs.creating and !userView.canSave}"
value="#{userView.selectedUser.firstnames}" value="#{userView.selectedUser.firstnames}"
/> />
<h:message for="firstnames" /> <h:message for="firstnames" />
<h:outputLabel value="#{i18n['user.lastName']}:" for="lastname" /> <h:outputLabel value="#{i18n['user.lastName']}:" for="lastname" />
<h:inputText size="45" id="lastname" disabled="#{!cc.attrs.creating and !userView.canSave()}" <h:inputText size="45" id="lastname" disabled="#{!cc.attrs.creating and !userView.canSave}"
value="#{userView.selectedUser.lastname}" value="#{userView.selectedUser.lastname}"
/> />
<h:message for="lastname" /> <h:message for="lastname" />
<h:outputLabel value="#{i18n['user.address']}:" for="address" /> <h:outputLabel value="#{i18n['user.address']}:" for="address" />
<h:inputText size="45" id="address" disabled="#{!cc.attrs.creating and !userView.canSave()}" <h:inputText size="45" id="address" disabled="#{!cc.attrs.creating and !userView.canSave}"
value="#{userView.selectedUser.address}" value="#{userView.selectedUser.address}"
/> />
<h:message for="address" /> <h:message for="address" />
<h:outputLabel value="#{i18n['user.zipCode']}:" for="zip" /> <h:outputLabel value="#{i18n['user.zipCode']}:" for="zip" />
<h:inputText size="45" id="zip" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.selectedUser.zip}" /> <h:inputText size="45" id="zip" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.zip}" />
<h:message for="zip" /> <h:message for="zip" />
<h:outputLabel value="#{i18n['user.town']}:" for="town" /> <h:outputLabel value="#{i18n['user.town']}:" for="town" />
<h:inputText size="45" id="town" disabled="#{!cc.attrs.creating and !userView.canSave()}" value="#{userView.selectedUser.town}" /> <h:inputText size="45" id="town" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.town}" />
<h:message for="town" /> <h:message for="town" />
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</h:selectOneMenu> </h:selectOneMenu>
--> -->
<h:outputLabel value="#{i18n['user.sex']}:" for="sex" /> <h:outputLabel value="#{i18n['user.sex']}:" for="sex" />
<h:selectOneRadio disabled="#{!cc.attrs.creating and !userView.canSave()}" id="sex" <h:selectOneRadio disabled="#{!cc.attrs.creating and !userView.canSave}" id="sex"
value="#{userView.selectedUser.gender}" value="#{userView.selectedUser.gender}"
> >
<f:selectItem id="undefined" itemLabel="#{i18n['user.sex.UNDEFINED']}" itemValue="UNDEFINED" /> <f:selectItem id="undefined" itemLabel="#{i18n['user.sex.UNDEFINED']}" itemValue="UNDEFINED" />
...@@ -106,14 +106,14 @@ ...@@ -106,14 +106,14 @@
<h:message rendered="#{cc.attrs.creating}" for="passwordcheck" /> <h:message rendered="#{cc.attrs.creating}" for="passwordcheck" />
<h:outputLabel rendered="#{sessionHandler.superadmin}" value="#{i18n['user.superadmin']}:" for="superadmin" /> <h:outputLabel rendered="#{sessionHandler.superadmin}" value="#{i18n['user.superadmin']}:" for="superadmin" />
<h:selectBooleanCheckbox disabled="#{!cc.attrs.creating and !userView.canSave()}" <h:selectBooleanCheckbox disabled="#{!cc.attrs.creating and !userView.canSave}"
rendered="#{sessionHandler.superadmin}" id="superadmin" value="#{userView.selectedUser.superadmin}" rendered="#{sessionHandler.superadmin}" id="superadmin" value="#{userView.selectedUser.superadmin}"
/> />
<h:message rendered="#{sessionHandler.superadmin}" for="superadmin" /> <h:message rendered="#{sessionHandler.superadmin}" for="superadmin" />
<h:commandButton rendered="#{cc.attrs.creating or userView.canSave()}" id="commitbtn" <h:commandButton rendered="#{cc.attrs.creating or userView.canSave}" id="commitbtn"
action="#{cc.attrs.commitaction}" value="#{cc.attrs.commitvalue}" action="#{cc.attrs.commitaction}" value="#{cc.attrs.commitvalue}"
/> />
</h:panelGrid> </h:panelGrid>
......
...@@ -7,35 +7,33 @@ ...@@ -7,35 +7,33 @@
</composite:interface> </composite:interface>
<composite:implementation> <composite:implementation>
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h:dataTable styleClass="bordertable" id="user" value="#{userSearchView.results}" var="user"> <h:dataTable styleClass="bordertable" id="user" value="#{userSearchView.results}" var="user">
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:link value="ID" includeViewParams="true">
<f:param name="sort" value="id" />
<f:param name="page" value="0" />
</h:link>
</f:facet>
<h:outputText value="#{user.id}" />
</h:column>
<h:column>
<f:facet name="header">
<h:link value="#{i18n['user.login']}" includeViewParams="true">
<f:param name="sort" value="login" />
<f:param name="page" value="0" />
</h:link>
</f:facet>
<h:outputText value="#{user.login}" />
</h:column>
<h:column>
<f:facet name="header">
<h:link value="#{i18n['user.nick']}" includeViewParams="true"> <h:link value="#{i18n['user.nick']}" includeViewParams="true">
<f:param name="sort" value="nick" /> <f:param name="sort" value="nick" />
<f:param name="page" value="0" /> <f:param name="page" value="0" />
</h:link> </h:link>
</f:facet> </f:facet>
<h:outputText value="#{user.nick}" /> <h:outputText styleClass="hoverable" value="#{(empty user.nick)?'----':user.nick}" />
<div class="userdata_popup">
<h:panelGrid columns="2">
<img style="width:100px;" src="#{request.contextPath}/dydata/userimage/#{user.currentImage.id}.img" alt="image" />
<h:panelGroup>
<h:outputText value="#{user.nick}"/> <br />
<h:outputText value="#{user.firstnames} #{user.lastname}"/> <br />
<hr />
<h:outputText value="#{user.address}"/> <br />
<h:outputText value="#{user.zip} #{user.postalTown}"/> <br />
<br />
<h:outputText value="#{user.phone}"/> <br />
<h:outputText value="#{user.email}"/> <br />
</h:panelGroup>
</h:panelGrid>
</div>
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
...@@ -56,42 +54,26 @@ ...@@ -56,42 +54,26 @@
</f:facet> </f:facet>
<h:outputText value="#{user.lastname}" /> <h:outputText value="#{user.lastname}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <button onClick="location.replace('#{request.contextPath}/useradmin/edit.jsf?user.id=#{user.id}')">#{i18n['user.edit']}</button>
<h:link value="#{i18n['user.email']}" includeViewParams="true">
<f:param name="sort" value="email" />
<f:param name="page" value="0" />
</h:link>
</f:facet>
<h:outputText value="#{user.email}" />
</h:column>
<!-- <h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.accountBalance']}" />
</f:facet>
<h:outputText value="#{user.accountBalance}">
<f:convertNumber />
</h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.image']}" />
</f:facet>
<h:commandLink action="#{userView.showImage()}"
value="#{(empty user.currentImage)?i18n['user.noImage']:i18n['user.hasImage']}"
/>
</h:column>
-->
<h:column>
<h:link outcome="/useradmin/edit" value="#{i18n['user.edit']}">
<f:param name="userid" value="#{user.id}" />
</h:link>
</h:column> </h:column>
<!-- <h:column> <!-- <h:column>
<h:commandButton action="#{userView.shop()}" value="#{i18n['user.shop']}" /> <h:commandButton action="#{userView.shop()}" value="#{i18n['user.shop']}" />
</h:column> --> </h:column> -->
</h:dataTable> </h:dataTable>
<script>
jQuery(function() {
jQuery(".hoverable").hover(function () {
jQuery(this).next().fadeIn();
},
function () {
jQuery(this).next().fadeOut();
});
});
</script>
</composite:implementation> </composite:implementation>
</html> </html>
/* General css, use for non-layout purposes for general elements */
/* userlistview popup */
.userdata_popup {
position: absolute;
border: 1px solid black;
backgrond: white;
border-radius: 3px;
display: none;
}
/* general class for hoverable usage */
.hoverable {
}
\ No newline at end of file
/* General css, use for non-layout purposes for general elements */
/* userlistview popup */
.userdata_popup {
position: absolute;
border: 1px solid black;
background: white;
border-radius: 3px;
display: none;
width: 300px;
height: 150px;
}
/* general class for hoverable usage */
.hoverable {
}
\ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<h2> <h2>
<h:outputText value="#{i18n['user.roles']}:" /> <h:outputText value="#{i18n['user.roles']}:" />
</h2> </h2>
<h:selectManyCheckbox converter="#{roleConverter}" disabled="#{!roleView.canWriteRoles()}" layout="pageDirection" id="roles" value="#{userView.usersRoles}"> <h:selectManyCheckbox converter="#{roleConverter}" disabled="#{!roleView.canWriteRoles}" layout="pageDirection" id="roles" value="#{userView.usersRoles}">
<f:selectItems var="roleitem" itemLabel="#{roleitem.name}" value="#{roleDataView.roles}" /> <f:selectItems var="roleitem" itemLabel="#{roleitem.name}" value="#{roleDataView.roles}" />
</h:selectManyCheckbox> </h:selectManyCheckbox>
<div> <div>
......
...@@ -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;
} }
......
...@@ -9,6 +9,8 @@ import javax.faces.model.ListDataModel; ...@@ -9,6 +9,8 @@ import javax.faces.model.ListDataModel;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import org.eclipse.persistence.internal.sessions.DirectCollectionChangeRecord.NULL;
import fi.insomnia.bortal.beans.PlaceGroupBeanLocal; import fi.insomnia.bortal.beans.PlaceGroupBeanLocal;
import fi.insomnia.bortal.enums.apps.MapPermission; import fi.insomnia.bortal.enums.apps.MapPermission;
import fi.insomnia.bortal.model.EventUser; import fi.insomnia.bortal.model.EventUser;
...@@ -57,6 +59,17 @@ public class PlacegroupView extends GenericCDIView { ...@@ -57,6 +59,17 @@ public class PlacegroupView extends GenericCDIView {
} }
return ret; return ret;
} }
public boolean isCanModifyCurrent() {
return canModify(memberlist.getRowData());
}
public boolean isCurrentMemberUserNotNull() {
GroupMembership row = memberlist.getRowData();
if (row != null && row.getUser() != null)
return true;
return false;
}
public ListDataModel<GroupMembership> getGroupMemberships() { public ListDataModel<GroupMembership> getGroupMemberships() {
memberlist = new ListDataModel<GroupMembership>(placegroupBean.getMembershipsAndCreations(user)); memberlist = new ListDataModel<GroupMembership>(placegroupBean.getMembershipsAndCreations(user));
......
...@@ -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;
} }
......
...@@ -96,6 +96,26 @@ public class ProductShopView extends GenericCDIView { ...@@ -96,6 +96,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) {
...@@ -125,6 +145,11 @@ public class ProductShopView extends GenericCDIView { ...@@ -125,6 +145,11 @@ public class ProductShopView extends GenericCDIView {
} }
n.updateLimit(l); n.updateLimit(l);
} }
}
public void updateAllCartLimits() {
updateCartLimits(null);
} }
public BigDecimal getAccountBalance() { public BigDecimal getAccountBalance() {
...@@ -268,7 +293,7 @@ public class ProductShopView extends GenericCDIView { ...@@ -268,7 +293,7 @@ public class ProductShopView extends GenericCDIView {
this.barcode = barcode; this.barcode = barcode;
} }
public void readBarcode() { public String readBarcode() {
Product product = productBean.findByBarcode(this.barcode); Product product = productBean.findByBarcode(this.barcode);
this.blip = false; this.blip = false;
for (ProductShopItem a : shoppingcart) { for (ProductShopItem a : shoppingcart) {
...@@ -280,6 +305,7 @@ public class ProductShopView extends GenericCDIView { ...@@ -280,6 +305,7 @@ public class ProductShopView extends GenericCDIView {
} }
this.barcode = null; this.barcode = null;
logger.debug("barcode read"); logger.debug("barcode read");
return null;
} }
public boolean isBlip() { public boolean isBlip() {
......
...@@ -32,7 +32,7 @@ public class AuthView extends GenericCDIView { ...@@ -32,7 +32,7 @@ public class AuthView extends GenericCDIView {
@Inject @Inject
private NavigationHandler navihandler; private NavigationHandler navihandler;
@EJB @EJB
private transient BootstrapBeanLocal bootStrapBean; private transient BootstrapBeanLocal bootStrapBean;
...@@ -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() {
......
...@@ -59,11 +59,11 @@ public class RoleView extends GenericCDIView { ...@@ -59,11 +59,11 @@ public class RoleView extends GenericCDIView {
} }
} }
public boolean canReadRoles() { public boolean isCanReadRoles() {
return permbean.hasPermission(UserPermission.READ_ROLES); return permbean.hasPermission(UserPermission.READ_ROLES);
} }
public boolean canWriteRoles() { public boolean isCanWriteRoles() {
return permbean.hasPermission(UserPermission.WRITE_ROLES); return permbean.hasPermission(UserPermission.WRITE_ROLES);
} }
...@@ -117,7 +117,7 @@ public class RoleView extends GenericCDIView { ...@@ -117,7 +117,7 @@ public class RoleView extends GenericCDIView {
} }
public String savePermissions() { public String savePermissions() {
if (canWriteRoles()) { if (isCanWriteRoles()) {
ArrayList<IAppPermission> newPerms = new ArrayList<IAppPermission>(); ArrayList<IAppPermission> newPerms = new ArrayList<IAppPermission>();
for (BortalApplicationWrapper appWrap : rolePermissions) { for (BortalApplicationWrapper appWrap : rolePermissions) {
for (IAppPermission apWrap : appWrap.getPermissions()) { for (IAppPermission apWrap : appWrap.getPermissions()) {
......
...@@ -101,10 +101,11 @@ public class UserView extends GenericCDIView { ...@@ -101,10 +101,11 @@ public class UserView extends GenericCDIView {
return user; return user;
} }
public void saveRoles() public String saveRoles()
{ {
rolebean.saveRoles(user, usersRoles); rolebean.saveRoles(user, usersRoles);
usersRoles = null; usersRoles = null;
return null;
} }
public List<Role> getUsersRoles() { public List<Role> getUsersRoles() {
...@@ -260,7 +261,7 @@ public class UserView extends GenericCDIView { ...@@ -260,7 +261,7 @@ public class UserView extends GenericCDIView {
return user; return user;
} }
public boolean canSave() { public boolean isCanSave() {
return canSave; return canSave;
} }
......
...@@ -77,7 +77,7 @@ public class VotingCompoAddEntryView { ...@@ -77,7 +77,7 @@ public class VotingCompoAddEntryView {
this.compoName = compoName; this.compoName = compoName;
} }
public void send() { public String send() {
CompoEntry compoEntry = new CompoEntry(); CompoEntry compoEntry = new CompoEntry();
compoEntry.setTitle(name); compoEntry.setTitle(name);
compoEntry.setNotes(notes); compoEntry.setNotes(notes);
...@@ -87,6 +87,7 @@ public class VotingCompoAddEntryView { ...@@ -87,6 +87,7 @@ public class VotingCompoAddEntryView {
cef.setFileData(this.uploadedFile.getContents()); cef.setFileData(this.uploadedFile.getContents());
cef.setFileName(uploadedFile.getFileName()); cef.setFileName(uploadedFile.getFileName());
votingBean.addEntry(compoEntry, cef); votingBean.addEntry(compoEntry, cef);
return null;
} }
public void initView() { public void initView() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!