Commit 72b07451 by Tuomas Riihimäki

Merge branch 'master' into restfix

2 parents 21932402 8a2b16a8
...@@ -105,12 +105,15 @@ public class MenuBean implements MenuBeanLocal { ...@@ -105,12 +105,15 @@ public class MenuBean implements MenuBeanLocal {
userkauppa.addPage(menuitemfacade.findOrCreate("/shop/createBill"), BillPermission.CREATE_BILL); userkauppa.addPage(menuitemfacade.findOrCreate("/shop/createBill"), BillPermission.CREATE_BILL);
userkauppa.addPage(menuitemfacade.findOrCreate("/foodwave/list"), ShopPermission.SHOP_FOODWAVE); userkauppa.addPage(menuitemfacade.findOrCreate("/foodwave/list"), ShopPermission.SHOP_FOODWAVE);
userkauppa.addPage(menuitemfacade.findOrCreate("/bill/list"), BillPermission.VIEW_OWN); userkauppa.addPage(menuitemfacade.findOrCreate("/bill/list"), BillPermission.VIEW_OWN);
userkauppa.addPage(menuitemfacade.findOrCreate("/bill/edit"), BillPermission.VIEW_OWN).setVisible(false);
userkauppa.addPage(menuitemfacade.findOrCreate("/bill/showBill"), BillPermission.VIEW_OWN).setVisible(false);
userkauppa.addPage(menuitemfacade.findOrCreate("/user/accountEvents"), UserPermission.VIEW_ACCOUNTEVENTS); userkauppa.addPage(menuitemfacade.findOrCreate("/user/accountEvents"), UserPermission.VIEW_ACCOUNTEVENTS);
MenuNavigation userPlaces = usermenu.addPage(null, null); MenuNavigation userPlaces = usermenu.addPage(null, null);
userPlaces.setKey("topnavi.userplaces"); userPlaces.setKey("topnavi.userplaces");
userPlaces.addPage(menuitemfacade.findOrCreate("/place/placemap"), MapPermission.VIEW); userPlaces.addPage(menuitemfacade.findOrCreate("/place/placemap"), MapPermission.VIEW);
userPlaces.addPage(menuitemfacade.findOrCreate("/place/myGroups"), MapPermission.BUY_PLACES); userPlaces.addPage(menuitemfacade.findOrCreate("/place/myGroups"), MapPermission.BUY_PLACES);
userPlaces.addPage(menuitemfacade.findOrCreate("/place/edit"), MapPermission.MANAGE_OTHERS).setVisible(false);
MenuNavigation usercompetitions = usermenu.addPage(null, null); MenuNavigation usercompetitions = usermenu.addPage(null, null);
usercompetitions.setKey("topnavi.competitions"); usercompetitions.setKey("topnavi.competitions");
......
...@@ -200,7 +200,15 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -200,7 +200,15 @@ public class PlaceBean implements PlaceBeanLocal {
place = placeFacade.find(place.getId()); place = placeFacade.find(place.getId());
user = eventUserFacade.find(user.getId()); user = eventUserFacade.find(user.getId());
boolean ret = false; boolean ret = false;
if (place.isBuyable() && !place.isTaken()) {
// when admin click's place, he reserves it -> just ignore it
if (!place.isTaken() || (permbean.hasPermission(MapPermission.MANAGE_OTHERS) && permbean.getCurrentUser().equals(place.getCurrentUser()) )) {
if (place.isBuyable() || permbean.hasPermission(MapPermission.MANAGE_OTHERS)) {
if(!place.isBuyable()) {
place.setBuyable(true);
}
place.setCurrentUser(user); place.setCurrentUser(user);
place.setReleaseTime(Calendar.getInstance()); place.setReleaseTime(Calendar.getInstance());
place.getReleaseTime().add(Calendar.MINUTE, RESERVE_MINUTES); place.getReleaseTime().add(Calendar.MINUTE, RESERVE_MINUTES);
...@@ -219,6 +227,7 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -219,6 +227,7 @@ public class PlaceBean implements PlaceBeanLocal {
} }
ret = true; ret = true;
} }
}
return ret; return ret;
} }
......
package fi.codecrew.moya.model; package fi.codecrew.moya.model;
import java.math.BigDecimal;
import java.sql.Time;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -25,9 +27,13 @@ import javax.validation.constraints.NotNull; ...@@ -25,9 +27,13 @@ import javax.validation.constraints.NotNull;
import org.eclipse.persistence.annotations.OptimisticLocking; import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType; import org.eclipse.persistence.annotations.OptimisticLockingType;
import org.eclipse.persistence.annotations.PrivateOwned; import org.eclipse.persistence.annotations.PrivateOwned;
import org.eclipse.persistence.annotations.TimeOfDay;
import org.eclipse.persistence.jpa.jpql.parser.DateTime;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.sun.xml.ws.commons.xmlutil.Converter;
import fi.codecrew.moya.enums.Gender; import fi.codecrew.moya.enums.Gender;
import fi.codecrew.moya.utilities.PasswordFunctions; import fi.codecrew.moya.utilities.PasswordFunctions;
...@@ -367,4 +373,40 @@ public class User extends GenericEntity implements IUser { ...@@ -367,4 +373,40 @@ public class User extends GenericEntity implements IUser {
this.licenseCodes = codes; this.licenseCodes = codes;
} }
public BigDecimal getAge() {
BigDecimal age = new BigDecimal(0);
if(birthday != null) {
Calendar calBirthday = Calendar.getInstance();
calBirthday.setTime(birthday);
Calendar calNow = Calendar.getInstance();
int yearB = calBirthday.get(Calendar.YEAR);
int yearNow = calNow.get(Calendar.YEAR);
int years = yearNow - yearB -1;
int dayOfYearBirthDay = calBirthday.get(Calendar.DAY_OF_YEAR);
int dayOfYear = calNow.get(Calendar.DAY_OF_YEAR);
int days = 0;
if(dayOfYearBirthDay > dayOfYear) {
calBirthday.set(Calendar.YEAR, yearNow - 1);
days = 365 - calBirthday.get(Calendar.DAY_OF_YEAR) + dayOfYear;
} else {
days = dayOfYear - dayOfYearBirthDay;
}
BigDecimal decimalYears = new BigDecimal(years);
float fraction = (float)((float)days/(float)365);
BigDecimal decimalDays = new BigDecimal(fraction);
age = age.add(decimalYears);
age = age.add(decimalDays);
System.out.print("Years: " + years + "\n");
System.out.print("Days: " + days + "\n");
System.out.print("Fraction of days: " + fraction + "\n");
}
return age;
}
} }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:map="http://java.sun.com/jsf/composite/cditools/map" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:h="http://java.sun.com/jsf/html"
> xmlns:map="http://java.sun.com/jsf/composite/cditools/map"
xmlns:tools="http://java.sun.com/jsf/composite/cditools"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body> <h:body>
......
...@@ -100,6 +100,12 @@ ...@@ -100,6 +100,12 @@
<h:outputText value="#{user.firstnames}" /> <h:outputText value="#{user.firstnames}" />
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header">
<h:outputText value="#{i18n['user.lastName']}" />
</f:facet>
<h:outputText value="#{user.lastname}"/>
</h:column>
<h:column>
<h:commandButton action="#{placeView.reserveForUser()}" value="#{i18n['place.reserveForUser']}" /> <h:commandButton action="#{placeView.reserveForUser()}" value="#{i18n['place.reserveForUser']}" />
</h:column> </h:column>
</h:dataTable> </h:dataTable>
......
...@@ -112,8 +112,21 @@ ...@@ -112,8 +112,21 @@
<br /> <br />
<p:commandButton ajax="false" rendered="#{cc.attrs.creating or userView.canSave}" id="commitbtn" action="#{cc.attrs.commitaction}" value="#{cc.attrs.commitvalue}" onerror="location.reload(true);"/> <p:commandButton ajax="false" rendered="#{cc.attrs.creating or userView.canSave}" id="commitbtn" action="#{cc.attrs.commitaction}" value="#{cc.attrs.commitvalue}" onerror="location.reload(true);" />
<br />
<br />
<p:lightBox iframe="true">
<h:outputLink value="http://codecrew.fi/rekisteriseloste.html" title="#{i18n['registerleaflet.title']}">
<h:outputText value="Rekisteriseloste" />
</h:outputLink>
</p:lightBox>
<br />
</h:panelGroup> </h:panelGroup>
</h:panelGrid> </h:panelGrid>
......
...@@ -86,59 +86,90 @@ ...@@ -86,59 +86,90 @@
<table> <table>
<ui:fragment rendered="#{!cc.attrs.creating}"> <ui:fragment rendered="#{!cc.attrs.creating}">
<tr> <tr>
<td colspan="2"><h:outputLabel for="login" value="#{i18n['user.login']}" /><br /> <h:outputText value="#{userView.selectedUser.login}" id="login" /></td> <td colspan="2"><b><h:outputLabel for="login" value="#{i18n['user.login']}" /></b><br />
<h:outputText value="#{userView.selectedUser.login}" id="login" />
</td>
</tr> </tr>
</ui:fragment> </ui:fragment>
<tr> <tr>
<td colspan="2"><h:outputLabel value="#{i18n['user.nick']}" for="nick" /> <br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> <td colspan="2"><b><h:outputLabel value="#{i18n['user.nick']}" for="nick" /> </b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText size="45" id="nick" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.nick}" /> <p:inputText size="45" id="nick" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.nick}" />
</p:inplace></td> </p:inplace>
</td>
</tr> </tr>
<tr> <tr>
<td><h:outputLabel value="#{i18n['user.firstNames']}" for="firstnames" /><br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> <td><b><h:outputLabel value="#{i18n['user.firstNames']}" for="firstnames" /></b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText size="22" id="firstnames" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.firstnames}" /> <p:inputText size="22" id="firstnames" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.firstnames}" />
</p:inplace></td> </p:inplace>
<td><h:outputLabel value="#{i18n['user.lastName']}" for="lastname" /><br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> </td>
<td><b><h:outputLabel value="#{i18n['user.lastName']}" for="lastname" /></b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText size="30" id="lastname" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.lastname}" /> <p:inputText size="30" id="lastname" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.lastname}" />
</p:inplace></td> </p:inplace>
</td>
</tr> </tr>
<tr> <tr>
<td><h:outputLabel for="birthday" value="#{i18n['user.birthday']}" /><br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> <td colspan="2"><b><h:outputLabel value="#{i18n['user.sex']}" for="sex" /></b> <br />
<p:calendar id="birthday" navigator="true" yearRange="c-80:c-0" value="#{userView.selectedUser.birthday}"> <p:selectOneMenu disabled="#{!cc.attrs.creating and !userView.canSave}" id="sex" value="#{userView.selectedUser.gender}">
<f:convertDateTime pattern="#{sessionHandler.dateFormat}" timeZone="#{sessionHandler.timezone}" />
</p:calendar>
</p:inplace> <h:message for="birthday" /></td>
<td><h:outputLabel value="#{i18n['user.sex']}" for="sex" /> <br /> <p:selectOneMenu disabled="#{!cc.attrs.creating and !userView.canSave}" id="sex" 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" />
<f:selectItem id="male" itemLabel="#{i18n['user.sex.MALE']}" itemValue="MALE" /> <f:selectItem id="male" itemLabel="#{i18n['user.sex.MALE']}" itemValue="MALE" />
<f:selectItem id="female" itemLabel="#{i18n['user.sex.FEMALE']}" itemValue="FEMALE" /> <f:selectItem id="female" itemLabel="#{i18n['user.sex.FEMALE']}" itemValue="FEMALE" />
</p:selectOneMenu></td> </p:selectOneMenu>
</td>
</tr>
<tr>
<td><b><h:outputLabel for="birthday" value="#{i18n['user.birthday']}" /></b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:calendar id="birthday" navigator="true" yearRange="c-80:c-0" value="#{userView.selectedUser.birthday}">
<f:convertDateTime pattern="#{sessionHandler.dateFormat}" timeZone="#{sessionHandler.timezone}" />
</p:calendar>
</p:inplace> <h:message for="birthday" />
</td>
<td><b><h:outputLabel for="age" value="#{i18n['user.age']}" /></b><br />
<h:outputText value="#{userView.selectedUser.user.age}">
<f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
</h:outputText>
</td>
</tr> </tr>
</table> </table>
<table> <table>
<tr> <tr>
<td colspan="2"><p:outputLabel value="#{i18n['user.address']}" for="address" /><br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> <td colspan="2"><b><p:outputLabel value="#{i18n['user.address']}" for="address" /></b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText size="45" id="address" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.address}" /> <p:inputText size="45" id="address" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.address}" />
</p:inplace></td> </p:inplace>
</td>
</tr> </tr>
<tr> <tr>
<td><p:outputLabel value="#{i18n['user.zipCode']}" for="zip" /><br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> <td><b><p:outputLabel value="#{i18n['user.zipCode']}" for="zip" /></b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText styleClass="ui-input" size="7" id="zip" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.zip}" /> <p:inputText styleClass="ui-input" size="7" id="zip" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.zip}" />
</p:inplace> <p:message for="zip" /></td> </p:inplace> <p:message for="zip" />
<td><p:outputLabel value="#{i18n['user.town']}" for="town" /><br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> </td>
<td><b><p:outputLabel value="#{i18n['user.town']}" for="town" /></b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText styleClass="ui-input" size="25" id="town" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.town}" /> <p:inputText styleClass="ui-input" size="25" id="town" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.town}" />
</p:inplace> <p:message for="town" /></td> </p:inplace> <p:message for="town" />
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2"><h:outputLabel value="#{i18n['user.email']}" for="email" /> <br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> <td colspan="2"><b><h:outputLabel value="#{i18n['user.email']}" for="email" /></b> <br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText validator="#{userValidator.validateEmail}" size="45" id="email" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.email}" /> <p:inputText validator="#{userValidator.validateEmail}" size="45" id="email" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.email}" />
</p:inplace></td> </p:inplace>
</td>
</tr> </tr>
<tr> <tr>
<td><p:outputLabel value="#{i18n['user.phone']}" for="phone" /><br /> <p:inplace emptyLabel="#{i18n['user.insert']}"> <td><b><p:outputLabel value="#{i18n['user.phone']}" for="phone" /></b><br />
<p:inplace emptyLabel="#{i18n['user.insert']}">
<p:inputText styleClass="ui-input" size="7" id="phone" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.phone}" /> <p:inputText styleClass="ui-input" size="7" id="phone" disabled="#{!cc.attrs.creating and !userView.canSave}" value="#{userView.selectedUser.phone}" />
</p:inplace> <p:message for="phone" /></td> </p:inplace> <p:message for="phone" />
</td>
</tr> </tr>
</table> </table>
......
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui">
xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
......
...@@ -156,6 +156,7 @@ global.notauthorized = You don't have enough rights to enter this site. ...@@ -156,6 +156,7 @@ global.notauthorized = You don't have enough rights to enter this site.
global.save = Save global.save = Save
httpsession.creationTime = Created httpsession.creationTime = Created
incomingflow.giveplace = Merkitse annetuksi incomingflow.giveplace = Merkitse annetuksi
lanEventPrivateProperty.defaultValue = Default value lanEventPrivateProperty.defaultValue = Default value
...@@ -220,6 +221,8 @@ productshop.minusTen = -10 ...@@ -220,6 +221,8 @@ productshop.minusTen = -10
productshop.plusOne = +1 productshop.plusOne = +1
productshop.plusTen = +10 productshop.plusTen = +10
registerleaflet.title = Rekisteriseloste
resetMail.header = Reset lost password resetMail.header = Reset lost password
resetMail.username = Username resetMail.username = Username
......
...@@ -799,6 +799,8 @@ readerevent.tagname = Tag ...@@ -799,6 +799,8 @@ readerevent.tagname = Tag
readerview.cards = Card ( printcount ) readerview.cards = Card ( printcount )
registerleaflet.title = Register leaflet
resetMail.body = You can change a forgotten password by inserting your username or email address to the field below. A link where you can change the password will be sent to the email address associated to that. resetMail.body = You can change a forgotten password by inserting your username or email address to the field below. A link where you can change the password will be sent to the email address associated to that.
resetMail.email = Email address resetMail.email = Email address
resetMail.header = Reset lost password resetMail.header = Reset lost password
...@@ -1151,6 +1153,7 @@ user.accountBalance = Account balance ...@@ -1151,6 +1153,7 @@ user.accountBalance = Account balance
user.accountEventHeader = Account events user.accountEventHeader = Account events
user.accountevents = Account events user.accountevents = Account events
user.address = Address user.address = Address
user.age = Age
user.bank = Bank user.bank = Bank
user.bankaccount = Bank number user.bankaccount = Bank number
user.birthday = Birthday user.birthday = Birthday
......
...@@ -785,6 +785,8 @@ readerevent.tagname = Tagi ...@@ -785,6 +785,8 @@ readerevent.tagname = Tagi
readerview.cards = Kortit ( tulostuslkm ) readerview.cards = Kortit ( tulostuslkm )
registerleaflet.title = Rekisteriseloste
resetMail.body = Voit vaihtaa unohtuneen salasanan sy\u00F6tt\u00E4m\u00E4ll\u00E4 k\u00E4ytt\u00E4j\u00E4tunnuksesi tai tunnukseen liitetyn s\u00E4hk\u00F6postiosoitteen allaolevaan kentt\u00E4\u00E4n. Tunnukseen liitettyyn s\u00E4hk\u00F6postiosoitteeseen l\u00E4hetet\u00E4\u00E4n kertak\u00E4ytt\u00F6inen osoite jossa voit vaihtaa sy\u00F6tt\u00E4m\u00E4si k\u00E4ytt\u00E4j\u00E4tunnuksen salasanan. resetMail.body = Voit vaihtaa unohtuneen salasanan sy\u00F6tt\u00E4m\u00E4ll\u00E4 k\u00E4ytt\u00E4j\u00E4tunnuksesi tai tunnukseen liitetyn s\u00E4hk\u00F6postiosoitteen allaolevaan kentt\u00E4\u00E4n. Tunnukseen liitettyyn s\u00E4hk\u00F6postiosoitteeseen l\u00E4hetet\u00E4\u00E4n kertak\u00E4ytt\u00F6inen osoite jossa voit vaihtaa sy\u00F6tt\u00E4m\u00E4si k\u00E4ytt\u00E4j\u00E4tunnuksen salasanan.
resetMail.email = S\u00E4hk\u00F6postiosoite resetMail.email = S\u00E4hk\u00F6postiosoite
resetMail.header = Salasana unohtunut? resetMail.header = Salasana unohtunut?
...@@ -1136,9 +1138,10 @@ user.accountBalance = Tilin saldo ...@@ -1136,9 +1138,10 @@ user.accountBalance = Tilin saldo
user.accountEventHeader = Tilitapahtumat user.accountEventHeader = Tilitapahtumat
user.accountevents = Tilitapahtumat user.accountevents = Tilitapahtumat
user.address = Osoite user.address = Osoite
user.age = Ik
user.bank = Pankki user.bank = Pankki
user.bankaccount = Pankkitili user.bankaccount = Pankkitili
user.birthday = Syntym\u00E4p\u00E4iv\u00E4 user.birthday = Syntym\u00E4aika
user.cardPower = K\u00E4ytt\u00E4j\u00E4tyyppi user.cardPower = K\u00E4ytt\u00E4j\u00E4tyyppi
user.changePassword = Vaihda salasana user.changePassword = Vaihda salasana
user.changepassword.forUser = K\u00E4ytt\u00E4j\u00E4lle user.changepassword.forUser = K\u00E4ytt\u00E4j\u00E4lle
......
...@@ -91,12 +91,18 @@ public class PrimeMenuView extends GenericCDIView { ...@@ -91,12 +91,18 @@ public class PrimeMenuView extends GenericCDIView {
{ {
menuModel = new DefaultMenuModel(); menuModel = new DefaultMenuModel();
MenuNavigation selectedTop = layoutview.getSelectedTopmenu(); MenuNavigation selectedTop = layoutview.getSelectedTopmenu();
if (selectedTop == null)
if (selectedTop == null) {
return null; return null;
}
int testid = 3;
for (MenuNavigation m : selectedTop.getChildren()) { for (MenuNavigation m : selectedTop.getChildren()) {
if (m.getItem() != null && m.getChildren().isEmpty()) { if (m.getItem() != null && m.getChildren().isEmpty()) {
DefaultMenuItem menuitem = mkMenuitem(m); DefaultMenuItem menuitem = mkMenuitem(m);
if (menuitem != null) { if (menuitem != null) {
menuModel.addElement(menuitem); menuModel.addElement(menuitem);
} }
......
...@@ -44,14 +44,19 @@ public class UserCartView extends GenericCDIView { ...@@ -44,14 +44,19 @@ public class UserCartView extends GenericCDIView {
public StreamedContent getDownloadCsv() { public StreamedContent getDownloadCsv() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("firstname").append(CSV_SEPARATOR); sb.append("Firstname").append(CSV_SEPARATOR);
sb.append("lastname").append(CSV_SEPARATOR); sb.append("Lastname").append(CSV_SEPARATOR);
sb.append("nick").append(CSV_SEPARATOR); sb.append("Nick").append(CSV_SEPARATOR);
sb.append("login").append(CSV_SEPARATOR); sb.append("Login").append(CSV_SEPARATOR);
sb.append("birthday").append(CSV_SEPARATOR); sb.append("Birthday").append(CSV_SEPARATOR);
sb.append("phone").append(CSV_SEPARATOR); sb.append("Age").append(CSV_SEPARATOR);
sb.append("email").append(CSV_SEPARATOR); sb.append("Phone").append(CSV_SEPARATOR);
sb.append("places").append(CSV_SEPARATOR); sb.append("Email").append(CSV_SEPARATOR);
sb.append("Street").append(CSV_SEPARATOR);
sb.append("Zip").append(CSV_SEPARATOR);
sb.append("City").append(CSV_SEPARATOR);
sb.append("Places").append(CSV_SEPARATOR);
sb.append("\n"); sb.append("\n");
for (EventUser uc : usercart) for (EventUser uc : usercart)
{ {
...@@ -60,8 +65,12 @@ public class UserCartView extends GenericCDIView { ...@@ -60,8 +65,12 @@ public class UserCartView extends GenericCDIView {
sb.append(uc.getNick()).append(CSV_SEPARATOR); sb.append(uc.getNick()).append(CSV_SEPARATOR);
sb.append(uc.getLogin()).append(CSV_SEPARATOR); sb.append(uc.getLogin()).append(CSV_SEPARATOR);
sb.append(uc.getBirthday() != null ? dateformat.format(uc.getBirthday()) : "").append(CSV_SEPARATOR); sb.append(uc.getBirthday() != null ? dateformat.format(uc.getBirthday()) : "").append(CSV_SEPARATOR);
sb.append(uc.getUser().getAge()).append(CSV_SEPARATOR);
sb.append(uc.getPhone()).append(CSV_SEPARATOR); sb.append(uc.getPhone()).append(CSV_SEPARATOR);
sb.append(uc.getEmail()).append(CSV_SEPARATOR); sb.append(uc.getEmail()).append(CSV_SEPARATOR);
sb.append(uc.getAddress()).append(CSV_SEPARATOR);
sb.append(uc.getZip()).append(CSV_SEPARATOR);
sb.append(uc.getUser().getTown()).append(CSV_SEPARATOR);
for (GroupMembership gm : uc.getGroupMemberships()) for (GroupMembership gm : uc.getGroupMemberships())
{ {
if (gm.getPlaceReservation() != null) if (gm.getPlaceReservation() != null)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!