Commit c8f22e56 by Antti Tönkyrä

Merge branch 'master' of codecrew.fi:bortal into tournament

2 parents 4218fe4c df8a84c0
Showing with 523 additions and 223 deletions
......@@ -6,3 +6,4 @@
/code/MoyaDatabase/src/fi/codecrew/moya/model/*/*_.java
*~
.metadata
/code/*/target/
......@@ -2,8 +2,12 @@
<classpath>
<classpathentry kind="src" path="src"/>
<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"/>
<classpathentry combineaccessrules="false" kind="src" path="/MoyaAuthModuleClient"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/auth-libs"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
#Fri Jul 16 17:41:25 EEST 2010
eclipse.preferences.version=1
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="GlassFish 3.1.2"/>
<installed facet="java" version="1.6"/>
<installed facet="java" version="1.7"/>
</faceted-project>
......@@ -7,10 +7,6 @@
<attribute name="owner.project.facets" value="jst.utility"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
#Wed Oct 27 01:24:28 EEST 2010
eclipse.preferences.version=1
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -4,5 +4,5 @@
<fixed facet="java"/>
<fixed facet="jst.utility"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.6"/>
<installed facet="java" version="1.7"/>
</faceted-project>
......@@ -7,6 +7,11 @@
<attribute name="owner.project.facets" value="jst.ejb"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/MoyaBeansClient"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
#Sat Dec 17 01:39:19 EET 2011
eclipse.preferences.version=1
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -3,7 +3,7 @@
<runtime name="GlassFish 3.1.2"/>
<fixed facet="java"/>
<fixed facet="jst.ejb"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.ejb" version="3.1"/>
<installed facet="sun.facet" version="9"/>
<installed facet="java" version="1.7"/>
</faceted-project>
default.configuration=
eclipse.preferences.version=1
hibernate3.enabled=false
......@@ -10,10 +10,10 @@ import javax.ejb.Stateless;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sun.xml.bind.v2.model.core.ID;
import fi.codecrew.moya.facade.PrintedCardFacade;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.PrintedCard;
import fi.codecrew.moya.model.User;
import fi.codecrew.moya.utilities.BarcodeUtils;
/**
......@@ -23,11 +23,17 @@ import fi.codecrew.moya.utilities.BarcodeUtils;
@LocalBean
public class BarcodeBean implements BarcodeBeanLocal {
private static final String PRINTED_CARD_PREFIX = "277";
private static final String PRINTED_CARD_PREFIX = "277"; //2M
private static final String EVENTUSER_PREFIX = "279"; //2O
//private static final String NEXT_PREFIX = "289"; //2Y
//private static final String NEXT_PREFIX = "265"; //2A
private static final Logger logger = LoggerFactory.getLogger(BarcodeBean.class);
@EJB
PrintedCardFacade printedCardFacade;
@EJB
UserBeanLocal userBean;
/**
* Default constructor.
......@@ -35,6 +41,21 @@ public class BarcodeBean implements BarcodeBeanLocal {
public BarcodeBean() {
// TODO Auto-generated constructor stub
}
public InputStream getUserBarcode(EventUser user) throws IOException {
StringBuilder sb = new StringBuilder();
sb.append(EVENTUSER_PREFIX);
String idStr = user.getId().toString();
for (int i = 12 - idStr.length() - sb.length(); i > 0; --i) {
sb.append("0");
}
sb.append(idStr);
String barcode = sb.toString();
logger.debug("Geneating barcode for user {} : {}", user, barcode);
return BarcodeUtils.getBarcodeEAN(barcode);
}
public InputStream getCardBarcode(PrintedCard printedCard) throws IOException {
StringBuilder sb = new StringBuilder();
......@@ -69,4 +90,22 @@ public class BarcodeBean implements BarcodeBeanLocal {
return printedCardFacade.findByBarcode(barcode);
}
public EventUser getUser(String barcode) {
if(barcode == null || barcode.isEmpty())
return null;
// it's our special front barcode
try {
if (barcode.startsWith(EVENTUSER_PREFIX)) {
int id = Integer.parseInt(barcode.substring(3));
EventUser user = userBean.findByEventUserId(id);
return user;
}
} catch (NumberFormatException x) {
}
return null;
}
}
package fi.codecrew.moya.beans;
import java.io.IOException;
import java.io.StringReader;
import java.io.InputStream;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -21,11 +20,13 @@ import javax.ejb.EJB;
import javax.ejb.EJBException;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
......@@ -36,11 +37,8 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
import fi.codecrew.moya.checkoutfi.CheckoutFiParam;
import fi.codecrew.moya.clientutils.BortalLocalContextHolder;
import fi.codecrew.moya.enums.apps.BillPermission;
......@@ -94,10 +92,25 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
|| merchantPassword == null || merchantPassword.isEmpty());
}
public static void main(String[] asd)
public static void main(String[] asd) throws ParserConfigurationException, SAXException, IOException
{
System.out.println(Calendar.getInstance().getTimeInMillis());
System.out.println(Calendar.getInstance().getTimeInMillis() / 1000);
// DocumentBuilderFactory dbFactory =
// DocumentBuilderFactory.newInstance();
// DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
// Document doc = dBuilder.parse(xmlstr);
// // DOMParser parser = new DOMParser();
// // Document doc = parser.getDocument();
// // parser.parse(new InputSource(new StringReader(xmlReturn)));
// Element root = doc.getDocumentElement();
// root.normalize();
// // NodeList rootChildren = root.getChildNodes();
// // for (int i = 0; i < rootChildren.getLength(); ++i)
// // {
// // logger.info("Rootchild {}", rootChildren.item(i).getNodeName());
// // }
//
// Node payments = root.getElementsByTagName("banks").item(0);
}
private static final String DATEFORMAT = "yyyyMMdd";
......@@ -168,8 +181,8 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
try {
final String calculatedHash = PasswordFunctions.calculateMd5(mdString.toString());
// logger.info("Calculated checksum {} from {}",
// mdString.toString(), calculatedHash);
logger.info("Calculated checksum {} from {}",
mdString.toString(), calculatedHash);
nameValuePairs.add(new BasicNameValuePair("MAC", calculatedHash));
......@@ -188,12 +201,8 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
return parseTokenXml(xmlReturn);
} catch (UnsupportedEncodingException e) {
logger.warn("Error sending checkout.fi request", e);
} catch (ClientProtocolException e) {
logger.warn("Error sending query to checkout.fi", e);
} catch (IOException e) {
logger.warn("Error sending query to checkout.fi", e);
logger.warn("Error sending checkout.fi request", e);
}
return null;
......@@ -229,9 +238,15 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
private static List<CheckoutBank> parseTokenXml(String xmlReturn) {
try {
DOMParser parser = new DOMParser();
parser.parse(new InputSource(new StringReader(xmlReturn)));
Document doc = parser.getDocument();
// DOMParser parser = new DOMParser();
// parser.parse(new InputSource(new StringReader(xmlReturn)));
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
InputStream xmlstr = IOUtils.toInputStream(xmlReturn);
Document doc = dBuilder.parse(xmlstr);
// Document doc = parser.getDocument();
Element root = doc.getDocumentElement();
root.normalize();
// NodeList rootChildren = root.getChildNodes();
......@@ -258,12 +273,8 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
}
return retbanks;
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException | IOException | ParserConfigurationException e) {
logger.warn("Error parsing response from checkout response:" + xmlReturn, e);
}
return null;
}
......
......@@ -8,12 +8,10 @@ import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import fi.codecrew.moya.enums.apps.ShopPermission;
import fi.codecrew.moya.facade.FoodWaveFacade;
import fi.codecrew.moya.facade.FoodWaveTemplateFacade;
import fi.codecrew.moya.facade.ProductFacade;
import fi.codecrew.moya.beans.FoodWaveBeanLocal;
import fi.codecrew.moya.enums.apps.ShopPermission;
import fi.codecrew.moya.model.FoodWave;
import fi.codecrew.moya.model.FoodWaveTemplate;
import fi.codecrew.moya.model.Product;
......@@ -59,7 +57,7 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
@Override
public List<FoodWave> findShoppableFoodwaves() {
throw new NotImplementedException();
throw new java.lang.UnsupportedOperationException();
}
@Override
......@@ -125,7 +123,7 @@ public class FoodWaveBean implements FoodWaveBeanLocal {
product = productfacade.merge(product);
template.getProducts().remove(product);
product.getFoodWaveTemplates().remove(template);
return template;
}
......
......@@ -175,7 +175,8 @@ public class PermissionBean implements PermissionBeanLocal {
public boolean isLoggedIn() {
Principal principal = context.getCallerPrincipal();
boolean ret = principal != null && !User.ANONYMOUS_LOGINNAME.equalsIgnoreCase(principal.getName());
logger.info("Checking principal {} against anon: {}", principal, ret);
// logger.info("Checking principal {} against anon: {}", principal,
// ret);
return ret;
// return !getAnonEventUser().equals(getCurrentUser()) ||
// getCurrentUser().getUser().isSuperadmin();
......
......@@ -483,7 +483,6 @@ public class PlaceBean implements PlaceBeanLocal {
@RolesAllowed(MapPermission.S_BUY_PLACES)
public Place unbuyPlace(Place place) {
place = placeFacade.reload(place);
if (place.getGroup() != null) {
place.getGroup().getPlaces().remove(place);
}
......
......@@ -21,21 +21,19 @@ import com.pdfjet.PDF;
import com.pdfjet.Page;
import com.pdfjet.TextLine;
import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.facade.EventUserFacade;
import fi.codecrew.moya.facade.GroupMembershipFacade;
import fi.codecrew.moya.facade.PlaceGroupFacade;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.LoggingBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.PlaceGroupBeanLocal;
import fi.codecrew.moya.beans.SecurityLogType;
import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.GroupMembership;
import fi.codecrew.moya.model.LanEventProperty;
import fi.codecrew.moya.model.LanEventPropertyKey;
import fi.codecrew.moya.model.PlaceGroup;
import fi.codecrew.moya.model.User;
import fi.codecrew.moya.utilities.BarcodeUtils;
import fi.codecrew.moya.utilities.I18n;
/**
* Session Bean implementation class PlaceGroupBean
......@@ -48,6 +46,9 @@ public class PlaceGroupBean implements PlaceGroupBeanLocal {
private static final int YSTART = 30;
@EJB
private EventBeanLocal eventbean;
@EJB
private BarcodeBeanLocal barcodeBean;
@EJB
private GroupMembershipFacade gmemfacade;
......@@ -134,6 +135,22 @@ public class PlaceGroupBean implements PlaceGroupBeanLocal {
@RolesAllowed(SpecialPermission.S_USER)
public void getGroupMembershipPdf(EventUser usr, OutputStream ostream) {
List<GroupMembership> memberships = getMembershipsAndCreations(usr);
LanEventProperty tmpProperty = eventbean.getProperty(LanEventPropertyKey.PLACECODE_FROM_USER);
boolean placecodeFromUser = false;
if (tmpProperty != null && tmpProperty.isBooleanValue())
{
placecodeFromUser = true;
}
tmpProperty = eventbean.getProperty(LanEventPropertyKey.PLACECODE_PRINT_ONLY_OWN);
boolean printOnlyOwn = false;
if (tmpProperty != null && tmpProperty.isBooleanValue())
{
printOnlyOwn = true;
}
try {
PDF pdf = new PDF(ostream);
Font font = new Font(pdf, CoreFont.TIMES_ROMAN);
......@@ -148,16 +165,36 @@ public class PlaceGroupBean implements PlaceGroupBeanLocal {
page = new Page(pdf, A4.PORTRAIT);
y = YSTART;
}
if(printOnlyOwn && (membership.getUser() == null || !membership.getUser().equals(usr))) {
continue;
}
//
// PNGImage jpeg = new
// PNGImage(BarcodeBean.getBarcode(membership.getInviteToken()));
// logger.debug("Jpeg: " + jpeg.getWidth() + " h. " +
// jpeg.getHeight());
Image image = new Image(pdf, BarcodeUtils.getBarcode(membership.getInviteToken()), ImageType.PNG);
image.scaleBy(0.8);
image.setPosition(50, y);
image.drawOn(page);
if(placecodeFromUser) {
if(membership.getUser() != null) {
Image image = new Image(pdf, barcodeBean.getUserBarcode(membership.getUser()), ImageType.PNG);
image.scaleBy(0.8);
image.setPosition(50, y);
image.drawOn(page);
} else {
TextLine nouser = new TextLine(bigfont, "EMPTY PLACE" );
nouser.setPosition(85, y+10);
nouser.drawOn(page);
}
} else {
Image image = new Image(pdf, BarcodeUtils.getBarcode(membership.getInviteToken()), ImageType.PNG);
image.scaleBy(0.8);
image.setPosition(50, y);
image.drawOn(page);
}
StringBuilder sb = new StringBuilder();
if (membership.getPlaceReservation().getName() != null)
......
......@@ -14,11 +14,8 @@ import javax.ejb.Stateless;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.facade.SitePageFacade;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.SitePageBeanLocal;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.facade.SitePageFacade;
import fi.codecrew.moya.model.PageContent;
import fi.codecrew.moya.model.Role;
import fi.codecrew.moya.model.SitePage;
......@@ -122,6 +119,7 @@ public class SitePageBean implements SitePageBeanLocal {
{
for (Role r : page.getAllowedRoles()) {
if (roles.contains(r)) {
logger.debug("Has role for page {}, role {}", page, r);
ret = sitepagefacade.findContents(page, new Date());
break;
}
......
......@@ -133,7 +133,7 @@ public class UserBean implements UserBeanLocal {
EventUser ret = eventUserFacade.merge(user);
ctbean.checkPrintedCard(ret);
currentEventuser = null;
// currentEventuser = null;
return ret;
}
......@@ -150,13 +150,15 @@ public class UserBean implements UserBeanLocal {
}
private EventUser currentEventuser;
private ArrayList<Role> currentEventuserRoles;
// private EventUser currentEventuser;
// private ArrayList<Role> currentEventuserRoles;
public ArrayList<Role> localFindUsersRoles(EventUser u) {
if (currentEventuser != null && u.equals(currentEventuser)) {
return currentEventuserRoles;
}
// if (currentEventuser != null && u.equals(currentEventuser)) {
// logger.debug("Returnin cached eventuserroles for user {}: {}",
// currentEventuser, currentEventuserRoles);
// return currentEventuserRoles;
// }
Set<Role> checkedRoles = new HashSet<Role>();
if (u != null)
{
......@@ -183,9 +185,12 @@ public class UserBean implements UserBeanLocal {
}
}
}
currentEventuser = u;
currentEventuserRoles = new ArrayList<Role>(checkedRoles);
return currentEventuserRoles;
// currentEventuser = u;
// currentEventuserRoles = new ArrayList<Role>(checkedRoles);
// logger.debug("Returning parsed eventUser roles for user {}: {} ", u,
// currentEventuserRoles);
// return currentEventuserRoles;
return new ArrayList<Role>(checkedRoles);
}
private static void addRecursive(Set<Role> checkedRoles, Collection<Role> roles) {
......
......@@ -74,7 +74,7 @@ public class VerkkomaksutFiBean implements VerkkomaksutFiBeanLocal {
LanEventPrivateProperty expire = eventbean.getPrivateProperty(LanEventPrivatePropertyKey.VERKKOMAKSU_KEY_EXPIRE);
String merchantid = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.VERKKOMAKSU_MERCHANT_ID);
String merchantPassword = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.VERKKOMAKSU_MERCHANT_PASSWORD);
return !((expire != null && new Date().after(expire.getDateValue()))
return !((expire != null && expire.getDateValue() != null && new Date().after(expire.getDateValue()))
|| merchantid == null || merchantid.isEmpty()
|| merchantPassword == null || merchantPassword.isEmpty());
}
......
......@@ -22,7 +22,6 @@ import fi.codecrew.moya.facade.callbacks.EventUserAccountSaldoPredicate;
import fi.codecrew.moya.facade.callbacks.EventUserPlacegroupPredicate;
import fi.codecrew.moya.facade.callbacks.EventUserRolefilter;
import fi.codecrew.moya.facade.callbacks.EventUserSearchPredicate;
import fi.codecrew.moya.facade.callbacks.FacadeCallback;
import fi.codecrew.moya.facade.callbacks.OrderCallback;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.EventUser_;
......@@ -31,6 +30,7 @@ import fi.codecrew.moya.model.User;
import fi.codecrew.moya.model.User_;
import fi.codecrew.moya.util.UserSearchQuery;
import fi.codecrew.moya.utilities.SearchResult;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
/**
* Session Bean implementation class EventUserFacade
......@@ -71,10 +71,11 @@ public class EventUserFacade extends IntegerPkGenericFacade<EventUser> {
private EventUser checkCache(final String login, final LanEvent event) {
if (!logincache.containsKey(event.getId()))
logincache.put(event.getId(), new HashMap<String, Integer>());
Integer euId = null;
EventUser ret = null;
if ((euId = logincache.get(event.getId()).get(login)) != null) {
ret = find(euId);
ret = this.find(euId);
}
return ret;
......@@ -101,8 +102,7 @@ public class EventUserFacade extends IntegerPkGenericFacade<EventUser> {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<EventUser> cq = cb.createQuery(EventUser.class);
Root<EventUser> root = cq.from(EventUser.class);
cq.where(cb.equal(root.get(EventUser_.event),
eventBean.getCurrentEvent()));
cq.where(cb.equal(root.get(EventUser_.event), eventBean.getCurrentEvent()));
return getEm().createQuery(cq).getResultList();
}
......
package fi.codecrew.moya.facade;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
......@@ -11,11 +10,10 @@ import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import fi.codecrew.moya.model.FoodWaveTemplate_;
import fi.codecrew.moya.model.FoodWave_;
import fi.codecrew.moya.model.OrgRole_;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.model.FoodWave;
import fi.codecrew.moya.model.FoodWaveTemplate_;
import fi.codecrew.moya.model.FoodWave_;
@Stateless
@LocalBean
......@@ -26,13 +24,13 @@ public class FoodWaveFacade extends IntegerPkGenericFacade<FoodWave> {
public FoodWaveFacade() {
super(FoodWave.class);
}
public List<FoodWave> getEventFoodWaves() {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<FoodWave> cq = cb.createQuery(FoodWave.class);
Root<FoodWave> root = cq.from(FoodWave.class);
cq.where( cb.equal(root.get(FoodWave_.template).get(FoodWaveTemplate_.event), eventBean.getCurrentEvent()));
cq.where(cb.equal(root.get(FoodWave_.template).get(FoodWaveTemplate_.event), eventBean.getCurrentEvent()));
return getEm().createQuery(cq).getResultList();
}
......
......@@ -3,6 +3,7 @@ package fi.codecrew.moya.facade;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import fi.codecrew.moya.utilities.jpa.GenericFacade;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
/**
......
......@@ -15,7 +15,6 @@ import javax.persistence.metamodel.SingularAttribute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.facade.callbacks.FacadeCallback;
import fi.codecrew.moya.facade.callbacks.OrderCallback;
import fi.codecrew.moya.facade.callbacks.StringSearchPredicateCreator;
import fi.codecrew.moya.model.User_;
......@@ -23,6 +22,7 @@ import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.model.User;
import fi.codecrew.moya.utilities.SearchQuery;
import fi.codecrew.moya.utilities.SearchResult;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
@Stateless
@LocalBean
......
......@@ -9,6 +9,7 @@ import javax.persistence.criteria.From;
import javax.persistence.criteria.Predicate;
import javax.persistence.metamodel.SingularAttribute;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
public class AndPredicateCreator<A, T extends ModelInterface> implements FacadeCallback<T> {
......
......@@ -10,6 +10,7 @@ import javax.persistence.criteria.Predicate;
import fi.codecrew.moya.model.EventUser_;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
public class EventLimiter implements FacadeCallback<EventUser> {
......
......@@ -14,6 +14,7 @@ import fi.codecrew.moya.model.AccountEvent_;
import fi.codecrew.moya.enums.DatabaseValueCompare;
import fi.codecrew.moya.model.AccountEvent;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
public class EventUserAccountSaldoPredicate implements FacadeCallback<EventUser> {
private final DatabaseValueCompare compare;
......
......@@ -9,6 +9,7 @@ import javax.persistence.criteria.Predicate;
import fi.codecrew.moya.model.EventUser_;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
public class EventUserPlacegroupPredicate implements FacadeCallback<EventUser> {
......
......@@ -25,6 +25,7 @@ import fi.codecrew.moya.model.Product_;
import fi.codecrew.moya.model.Role_;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.Role;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
public class EventUserRolefilter implements FacadeCallback<EventUser> {
......
......@@ -11,6 +11,7 @@ import javax.persistence.metamodel.SingularAttribute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
public class OrPredicateCreator<A, T extends ModelInterface> implements FacadeCallback<T> {
......
......@@ -9,6 +9,7 @@ import javax.persistence.criteria.Path;
import javax.persistence.criteria.Predicate;
import javax.persistence.metamodel.SingularAttribute;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
public class OrderCallback<T extends ModelInterface> implements FacadeCallback<T> {
......
......@@ -10,6 +10,7 @@ import javax.persistence.criteria.Path;
import javax.persistence.criteria.Predicate;
import javax.persistence.metamodel.SingularAttribute;
import fi.codecrew.moya.utilities.jpa.FacadeCallback;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
public abstract class PathStringSearchPredicateCreator<T extends ModelInterface, D extends ModelInterface> implements FacadeCallback<T> {
......
......@@ -7,6 +7,11 @@
<attribute name="owner.project.facets" value="jst.utility"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/MoyaDatabase"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
#Thu Oct 27 18:05:08 EEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -4,5 +4,5 @@
<fixed facet="java"/>
<fixed facet="jst.utility"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.6"/>
<installed facet="java" version="1.7"/>
</faceted-project>
......@@ -5,12 +5,16 @@ import java.io.InputStream;
import javax.ejb.Local;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.PrintedCard;
@Local
public interface BarcodeBeanLocal {
public PrintedCard getPrintedCard(String barcode) ;
public EventUser getUser(String barcode);
public InputStream getUserBarcode(EventUser user) throws IOException;
public InputStream getCardBarcode(PrintedCard printedCard) throws IOException;
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
</classpath>
eclipse.preferences.version=1
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -7,6 +7,10 @@
<attribute name="owner.project.facets" value="jst.utility"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>
eclipse.preferences.version=1
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
......
......@@ -6,5 +6,5 @@
<fixed facet="jpt.jpa"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="jpt.jpa" version="2.0"/>
<installed facet="jst.java" version="1.6"/>
<installed facet="jst.java" version="1.7"/>
</faceted-project>
......@@ -2,7 +2,7 @@
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="BortalDb" transaction-type="JTA">
<persistence-unit name="MoyaDb" transaction-type="JTA">
<jta-data-source>jdbc/moyaDb</jta-data-source>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables" />
......
......@@ -96,6 +96,10 @@ public class Bill extends GenericEntity {
private String deliveryTerms = "";
@Column(name = "delay_intrest", nullable = false)
private Integer delayIntrest = 11;
@Column(name = "expires", nullable = true)
@Temporal(TemporalType.TIMESTAMP)
private Calendar expires = null;
/**
* Notes for the event organisators about the bill.
......@@ -200,11 +204,15 @@ public class Bill extends GenericEntity {
}
public Bill(LanEvent event) {
this();
this.event = event;
}
public Bill() {
super();
this.expires = Calendar.getInstance();
this.expires.setTimeInMillis((System.currentTimeMillis() + 1814400000l)); // 3vk
}
public Calendar getDueDate() {
......@@ -378,6 +386,9 @@ public class Bill extends GenericEntity {
}
public void setPaidDate(Date paidDate) {
if(paidDate != null)
expires = null;
this.paidDate = paidDate;
}
......@@ -425,4 +436,30 @@ public class Bill extends GenericEntity {
}
return ret;
}
public Calendar getExpires() {
return expires;
}
public void setExpires(Calendar expires) {
this.expires = expires;
}
public boolean isExpired() {
if(expires == null)
return false;
return Calendar.getInstance().after(expires);
}
public void markExpired() {
if(isExpired() || isPaid())
return;
expires = Calendar.getInstance();
}
}
......@@ -6,6 +6,7 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import fi.codecrew.moya.utilities.jpa.EntityEquals;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
@MappedSuperclass
......
......@@ -4,10 +4,9 @@
*/
package fi.codecrew.moya.model;
import static javax.persistence.CascadeType.ALL;
import java.util.Calendar;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
......@@ -50,7 +49,7 @@ public class GroupMembership extends GenericEntity {
@Column(name = "invite_name")
private String inviteName;
@ManyToOne(optional = false, cascade = ALL)
@ManyToOne(optional = false, cascade = CascadeType.PERSIST)
@JoinColumn(name = GROUP_ID, referencedColumnName = "id", nullable = false)
private PlaceGroup placeGroup;
......
......@@ -8,7 +8,10 @@ public enum LanEventPropertyKey {
PORTAL_EMAIL_NAME(Type.TEXT, "Streamparty intranet"),
ADMIN_MAIL(Type.TEXT, "intra@streamparty.org"),
EVENT_LAYOUT(Type.TEXT, "template1"),
SHOP_DEFAULT_CASH(Type.BOOL, null), ;
SHOP_DEFAULT_CASH(Type.BOOL, null),
PLACECODE_FROM_USER(Type.BOOL, null),
PLACECODE_PRINT_ONLY_OWN(Type.BOOL, null),
;
private enum Type {
TEXT, DATE, DATA, BOOL
};
......@@ -29,14 +32,14 @@ public enum LanEventPropertyKey {
}
public boolean isBoolean() {
return Type.DATA.equals(type);
return Type.BOOL.equals(type);
}
private LanEventPropertyKey(Type t, String def)
{
this.type = t;
defaultvalue = def;
}
}
public String getDefaultvalue() {
return defaultvalue;
......
......@@ -64,15 +64,14 @@ public class PlaceGroup extends GenericEntity {
@ManyToOne
private EventUser creator;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "placeGroup")
@OneToMany(cascade = { CascadeType.PERSIST }, mappedBy = "placeGroup")
private List<GroupMembership> members = new ArrayList<GroupMembership>();
@OneToMany(mappedBy = "group")
@OrderBy("name")
private List<Place> places;
public PlaceGroup(LanEvent event, Calendar groupCreated, Calendar groupEdited,
boolean groupActive) {
public PlaceGroup(LanEvent event, Calendar groupCreated, Calendar groupEdited, boolean groupActive) {
this.event = event;
this.created = groupCreated;
this.edited = groupEdited;
......
eclipse.preferences.version=1
encoding/<project>=UTF-8
......@@ -8,10 +8,6 @@
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
eclipse.preferences.version=1
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -4,8 +4,8 @@
<fixed facet="wst.jsdt.web"/>
<fixed facet="jst.web"/>
<fixed facet="java"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="sun.facet" version="9"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>
......@@ -7,6 +7,10 @@
<attribute name="owner.project.facets" value="jst.utility"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>
#Sat Jun 12 05:34:28 EEST 2010
eclipse.preferences.version=1
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.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -3,6 +3,6 @@
<runtime name="GlassFish 3.1.2"/>
<fixed facet="jst.java"/>
<fixed facet="jst.utility"/>
<installed facet="jst.java" version="6.0"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="jst.java" version="1.7"/>
</faceted-project>
package fi.codecrew.moya.model;
package fi.codecrew.moya.utilities.jpa;
import java.util.Date;
import java.util.Random;
......
package fi.codecrew.moya.facade.callbacks;
package fi.codecrew.moya.utilities.jpa;
import java.util.List;
......@@ -7,7 +7,6 @@ import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.From;
import javax.persistence.criteria.Predicate;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
public interface FacadeCallback<C extends ModelInterface> {
......
package fi.codecrew.moya.facade;
package fi.codecrew.moya.utilities.jpa;
import java.util.ArrayList;
import java.util.Collections;
......@@ -14,10 +14,8 @@ import javax.persistence.criteria.Path;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import fi.codecrew.moya.facade.callbacks.FacadeCallback;
import fi.codecrew.moya.utilities.SearchQuery;
import fi.codecrew.moya.utilities.SearchResult;
import fi.codecrew.moya.utilities.jpa.ModelInterface;
public abstract class GenericFacade<C extends ModelInterface> {
......
......@@ -8,6 +8,11 @@
</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="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/MoyaBeansClient"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
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.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
......@@ -4,8 +4,8 @@
<fixed facet="jst.web"/>
<fixed facet="java"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.6"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="sun.facet" version="9"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"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" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:users="http://java.sun.com/jsf/composite/tools/user" xmlns:c="http://java.sun.com/jsp/jstl/core">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:users="http://java.sun.com/jsf/composite/tools/user" xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
......@@ -15,7 +14,7 @@
<ui:define name="content">
<h:form id="billform">
<h:panelGrid columns="2">
<p:panelGrid columns="2">
<h:outputLabel for="paidDate" value="#{i18n['bill.paidDate']}:" />
<h:inputText id="paidDate" value="#{billEditView.bill.paidDate}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
......@@ -62,49 +61,53 @@
<h:outputLabel for="notes" value="#{i18n['bill.notes']}:" />
<h:inputTextarea id="notes" cols="50" rows="5" value="#{billEditView.bill.notes}" />
<h:commandButton id="commitbtn" action="#{billEditView.save()}" value="#{i18n['bill.save']}" />
</h:panelGrid>
<p:commandButton id="commitbtn" actionListener="#{billEditView.save()}" ajax="false" value="#{i18n['bill.save']}" />
</p:panelGrid>
<h:dataTable border="1" id="user" value="#{billEditView.bill.billLines}" var="billine">
<h:column>
<p:dataTable border="1" id="user" value="#{billEditView.bill.billLines}" var="billine">
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n[billine.name]}" />
<h:outputText value="#{i18n['billine.name']}" />
</f:facet>
<h:inputText value="#{billine.name}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.unitPrice']}" />
</f:facet>
<h:inputText value="#{billine.unitPrice}" size="6" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.quantity']}" />
</f:facet>
<h:inputText value="#{billine.quantity}" size="6" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.unitName']}" />
</f:facet>
<h:inputText value="#{billine.unitName}" size="5" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.vat']}" />
</f:facet>
<h:inputText value="#{billine.vat}" size="4" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{i18n['billine.referencedProduct']}" />
</f:facet>
<h:outputText value="#{billine.lineProduct.name}" />
</h:column>
</p:column>
</p:dataTable>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
......
......@@ -2,7 +2,7 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"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" xmlns:h="http://java.sun.com/jsf/html" xmlns:tools="http://java.sun.com/jsf/composite/tools"
xmlns:bill="http://java.sun.com/jsf/composite/cditools/bills" xmlns:f="http://java.sun.com/jsf/core">
xmlns:bill="http://java.sun.com/jsf/composite/cditools/bills" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
......@@ -23,10 +23,11 @@
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</ui:fragment>
<bill:showBill bill="#{billEditView.bill}" />
<ui:fragment rendered="#{!billEditView.bill.paid and billEditView.verkkomaksuFiAvailable}">
<ui:fragment rendered="#{!billEditView.bill.paid and !billEditView.bill.expired and billEditView.verkkomaksuFiAvailable}">
<div id="svm-payment">
<a href="#{billEditView.verkkomaksuFiToken.url}"> </a>
</div>
......@@ -38,7 +39,7 @@
});
</script>
</ui:fragment>
<ui:fragment rendered="#{!billEditView.bill.paid and billEditView.checkoutFiAvailable}">
<ui:fragment rendered="#{!billEditView.bill.paid and !billEditView.bill.expired and billEditView.checkoutFiAvailable}">
<table border="0">
<tr>
......@@ -57,6 +58,20 @@
</tr>
</table>
</ui:fragment>
<ui:fragment rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}">
<h:form>
<p:commandButton id="cancelbtn" onclick="confirmation.show()" value="#{i18n['bill.cancel']}" />
<p:confirmDialog id="confirmDialog" message="#{i18n['generic.sure.message']}" header="#{i18n['generic.sure.header']}" severity="alert" widgetVar="confirmation">
<p:commandButton value="#{i18n['generic.sure.yes']}" onclick="confirmation.hide()" actionListener="#{billEditView.expireBill()}" ajax="false" />
<p:commandButton value="#{i18n['generic.sure.no']}" onclick="confirmation.hide()" type="button" />
</p:confirmDialog>
</h:form>
</ui:fragment>
</ui:define>
</ui:composition>
......
......@@ -77,6 +77,8 @@
<h:column>
<f:facet name="header">#{i18n['lanEventProperty.value']}</f:facet>
<h:outputText rendered="#{prop.key.text}" value="#{prop.textvalue}" />
<h:outputText rendered="#{prop.key.boolean and prop.booleanValue}" value="true" />
<h:outputText rendered="#{prop.key.boolean and not prop.booleanValue}" value="false" />
<h:outputText rendered="#{prop.key.date}" value="#{prop.dateValue}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
......@@ -123,6 +125,10 @@
<h:outputLabel rendered="#{eventPropertyView.property.key.date}" for="textval" value="#{i18n['lanEventProperty.textValue']}" />
<p:calendar rendered="#{eventPropertyView.property.key.date}" value="#{eventPropertyView.property.dateValue}" pattern="#{sessionHandler.datetimeFormat}" />
<h:message rendered="#{eventPropertyView.property.key.date}" for="textval" />
<h:outputLabel rendered="#{eventPropertyView.property.key.boolean}" for="booleanval" value="#{i18n['lanEventProperty.booleanValue']}" />
<h:selectBooleanCheckbox rendered="#{eventPropertyView.property.key.boolean}" id="booleanval" value="#{eventPropertyView.property.booleanValue}" />
<h:message rendered="#{eventPropertyView.property.key.boolean}" for="booleanval" />
</h:panelGrid>
<h:commandButton action="#{eventPropertyView.saveProperty}" value="#{i18n['lanEventProperty.save']}" />
......
......@@ -7,8 +7,7 @@
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><h:outputText value="#{layoutView.getHeader()}" /></title>
<meta name="description" content="Insomnia lippukauppa" />
<meta name="author" content="Niko Juusela, csharp" />
<meta name="description" content="#{layoutView.getHeader()}" />
<meta http-equiv="Content-Language" content="fi" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia2/css/tyyli.css" />
......
......@@ -2,7 +2,7 @@
<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>
......@@ -10,71 +10,89 @@
<composite:implementation>
<h:outputText rendered="#{billListView.bills.rowCount le 0}" value="#{i18n['bills.noBills']}" />
<!-- koyhan miehen confirmaationappi: -->
<input type="button" class="ui-button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" style="padding: 3px;" value="#{i18n['bill.markPaid.show']}" onclick="showMarkPaidButtons();" />
<h:form rendered="#{billListView.bills.rowCount gt 0}">
<h:dataTable styleClass="bordertable" id="billList" value="#{billListView.bills}" var="bill">
<h:column rendered="#{billListView.canWriteBill}">
<p:dataTable styleClass="bordertable" id="billList" value="#{billListView.bills}" var="bill"
rowStyleClass="#{bill.expired ? 'expired' : (bill.paidDate != null ? 'paid' : null)}" >
<p:column rendered="#{billListView.canWriteBill}">
<f:facet name="header">
<h:outputText value="${i18n['bill.payer']}" />
<h:outputText value="#{i18n['bill.payer']}" />
</f:facet>
<h:link rendered="#{billListView.canWriteBill}" outcome="/useradmin/edit" value="#{bill.addr1}">
<f:param name="userid" value="#{bill.user.user.id}" />
</h:link>
<h:outputText rendered="#{not billListView.canWriteBill}" value="#{bill.addr1}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.sentDate']}" />
</f:facet>
<h:outputText value="#{bill.sentDateTime}">
<f:convertDateTime pattern="#{sessionHandler.dateFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.billNumber']}" />
</f:facet>
<h:outputText value="#{bill.billNumber}" />
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.referencenumber']}" />
</f:facet>
<h:outputText value="#{bill.referenceNumberBase}">
<f:converter binding="#{referenceNumberConverter}" />
</h:outputText>
</h:column>
<h:column>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['bill.totalPrice']}" />
</f:facet>
<h:outputText value="#{bill.totalPrice()}">
<f:convertNumber currencyCode="EUR" maxFractionDigits="2" minFractionDigits="2" type="currency" />
</h:outputText>
</h:column>
<h:column>
<a href="#{request.contextPath}/PrintBill?billid=#{bill.id}" target="_blank">#{i18n['bill.printBill']}</a>
</h:column>
<h:column>
</p:column>
<p:column>
<ui:fragment rendered="#{!bill.expired}">
<a href="#{request.contextPath}/PrintBill?billid=#{bill.id}" target="_blank">#{i18n['bill.printBill']}</a>
</ui:fragment>
</p:column>
<p:column>
<h:link outcome="/bill/showBill" value="#{i18n['bill.show']}">
<f:param name="billid" value="#{bill.id}" />
</h:link>
</h:column>
<h:column rendered="#{billListView.canWriteBill}">
</p:column>
<p:column rendered="#{billListView.canWriteBill}">
<h:link outcome="/bill/edit" value="#{i18n['bill.edit']}">
<f:param name="billid" value="#{bill.id}" />
</h:link>
</h:column>
<h:column rendered="#{billListView.canWriteBill}">
<h:commandButton rendered="#{bill.paidDate == null}" action="#{billListView.markPaid()}" value="#{i18n['bill.markPaid']}">
</p:column>
<p:column rendered="#{billListView.canWriteBill}">
<h:commandButton rendered="#{bill.paidDate == null}" styleClass="markPaidButton" action="#{billListView.markPaid()}" value="#{i18n['bill.markPaid']}">
<f:ajax render="@form" />
</h:commandButton>
<h:outputText rendered="#{bill.paidDate != null}" value="#{i18n['bill.isPaid']}" />
</h:column>
</p:column>
</h:dataTable>
</p:dataTable>
</h:form>
<script type="text/javascript">
function showMarkPaidButtons() {
$(".markPaidButton").removeAttr('disabled');
}
$(".markPaidButton").attr('disabled', 'disabled');
</script>
</composite:implementation>
......
......@@ -10,13 +10,13 @@
</composite:interface>
<composite:implementation>
<h:panelGrid columns="2" columnClasses="topalign,topalign">
<h:panelGrid columns="2" columnClasses="topalign,topalign" styleClass="#{cc.attrs.bill.expired ? 'expired' : null}">
<h:panelGrid columns="2" columnClasses="topalign,topalign">
<h:outputLabel for="billnr" value="#{i18n['bill.billNumber']}:" />
<h:outputText id="billnr" value="#{cc.attrs.bill.billNumber}" />
<h:outputLabel for="refnr" value="#{i18n['bill.referencenumber']}" />
<h:outputText id="refnr" value="#{cc.attrs.bill.referenceNumber}" />
<h:outputLabel rendered="{!cc.attrs.bill.expired}" for="refnr" value="#{i18n['bill.referencenumber']}" />
<h:outputText rendered="{!cc.attrs.bill.expired}" id="refnr" value="#{cc.attrs.bill.referenceNumber}" />
<h:outputLabel for="billAmount" value="#{i18n['bill.billAmount']}" />
<h:outputText id="billAmount" value="#{cc.attrs.bill.totalPrice()}">
......@@ -31,8 +31,16 @@
<h:outputLabel for="paymenttime" value="#{i18n['bill.paymentTime']}:" />
<h:outputText id="paymenttime" value="#{cc.attrs.bill.paymentTime eq 0 ? i18n['bill.paymentTime.now'] : cc.attrs.bill.paymentTime}" />
<h:outputLabel for="noticetime" value="#{i18n['bill.noticetime']}:" />
<h:outputText id="noticetime" value="#{cc.attrs.bill.noticetime}" />
<h:outputLabel rendered="{!cc.attrs.bill.expired}" for="noticetime" value="#{i18n['bill.noticetime']}:" />
<h:outputText rendered="{!cc.attrs.bill.expired}" id="noticetime" value="#{cc.attrs.bill.noticetime}" />
<h:outputLabel rendered="#{cc.attrs.bill != null}" for="expires" value="#{i18n['bill.expires']}:" />
<h:outputText rendered="#{cc.attrs.bill != null}" id="expires" value="#{cc.attrs.bill.expires.time}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
<h:outputText rendered="#{cc.attrs.bill.expired}" id="expired" value="#{i18n['bill.isExpired']}" />
</h:panelGrid>
<h:panelGrid columns="2" columnClasses="topalign,topalign">
......@@ -58,15 +66,15 @@
<h:outputText rendered="#{!empty cc.attrs.bill.event.organiser.billAddress4}" value="&lt;br />" escape="false" />
<h:outputText id="recAddr4" value="#{cc.attrs.bill.event.organiser.billAddress4}" />
</h:panelGroup>
<h:outputLabel rendered="#{!empty cc.attrs.bill.event.organiser.bankName1}" for="bankname1" value="#{i18n['eventorg.bankName1']}" />
<h:outputText rendered="#{!empty cc.attrs.bill.event.organiser.bankName1}" id="bankname1" value="#{cc.attrs.bill.event.organiser.bankName1}" />
<h:outputLabel rendered="#{!empty cc.attrs.bill.event.organiser.bankNumber1}" for="banknumber1" value="#{i18n['eventorg.bankNumber1']}" />
<h:outputText rendered="#{!empty cc.attrs.bill.event.organiser.bankNumber1}" id="banknumber1" value="#{cc.attrs.bill.event.organiser.bankNumber1}" />
<h:outputLabel rendered="#{!empty cc.attrs.bill.event.organiser.bankName2}" for="bankname2" value="#{i18n['eventorg.bankName2']}" />
<h:outputText rendered="#{!empty cc.attrs.bill.event.organiser.bankName2}" id="bankname2" value="#{cc.attrs.bill.event.organiser.bankName2}" />
<h:outputLabel rendered="#{!empty cc.attrs.bill.event.organiser.bankNumber2}" for="banknumber2" value="#{i18n['eventorg.bankNumber2']}" />
<h:outputText rendered="#{!empty cc.attrs.bill.event.organiser.bankNumber2}" id="banknumber2" value="#{cc.attrs.bill.event.organiser.bankNumber2}" />
<h:outputLabel rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankName1}" for="bankname1" value="#{i18n['eventorg.bankName1']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankName1}" id="bankname1" value="#{cc.attrs.bill.event.organiser.bankName1}" />
<h:outputLabel rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankNumber1}" for="banknumber1" value="#{i18n['eventorg.bankNumber1']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankNumber1}" id="banknumber1" value="#{cc.attrs.bill.event.organiser.bankNumber1}" />
<h:outputLabel rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankName2}" for="bankname2" value="#{i18n['eventorg.bankName2']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankName2}" id="bankname2" value="#{cc.attrs.bill.event.organiser.bankName2}" />
<h:outputLabel rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankNumber2}" for="banknumber2" value="#{i18n['eventorg.bankNumber2']}" />
<h:outputText rendered="#{!cc.attrs.bill.expired and !empty cc.attrs.bill.event.organiser.bankNumber2}" id="banknumber2" value="#{cc.attrs.bill.event.organiser.bankNumber2}" />
</h:panelGrid>
......
......@@ -130,3 +130,7 @@ vertical-align: top;
label {
}
.expired {
color: #c0c0c0;
}
......@@ -221,3 +221,7 @@ h1 {
{
vertical-align:top;
}
.expired {
color: #c0c0c0;
}
......@@ -294,4 +294,13 @@ button.ui-button span
line-height: 1;
padding: .4em .5em;
}
\ No newline at end of file
}
.expired {
color: #c0c0c0;
}
.paid {
color: #006600;
}
......@@ -287,3 +287,7 @@ padding: 5px;
padding-left: 1em;
vertical-align: top;
}
.expired {
color: #c0c0c0;
}
\ No newline at end of file
......@@ -235,4 +235,8 @@ table.bordertable td,table.bordertable th {
table.bordertable {
border-collapse: collapse;
}
.expired {
color: #c0c0c0;
}
\ No newline at end of file
......@@ -140,6 +140,10 @@ label {
}
.expired {
color: #c0c0c0;
}
/* input {
border: 1px solid #ccc;
padding: 3px 6px;
......
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Sat Mar 30 17:56:44 EET 2013
actionlog.create.header = Create new actionmessage
actionlog.create.message = Message
......@@ -14,6 +16,14 @@ actionlog.tasklist.header = Tasklist
actionlog.time = Time
actionlog.user = User
bill.billAmount = Amount
bill.billNumber = Number
bill.cancel = Cancel bill
bill.expires = Expires
bill.isExpired = Bill is expired
bill.markPaid.show = Show Mark paid -buttons
bill.save = Save
bortalApplication.BILL = Creating, and managing bills
bortalApplication.COMPO = Managing compos
bortalApplication.CONTENT = Product & shop management
......@@ -76,6 +86,11 @@ error.error = You have encountered an error.
eventorg.create = Create
generic.sure.header = Confirmation
generic.sure.message = Are you sure?
generic.sure.no = No
generic.sure.yes = Yes
global.cancel = Cancel
global.copyright = Codecrew Ry
global.notAuthorizedExecute = You are not authorized to do that!!
......@@ -95,14 +110,19 @@ loginerror.header = Login failed
loginerror.message = Username of password incorrect.
loginerror.resetpassword = Reset password
#Bill number
# Validationmessages
map.id = #
navi.auth.login = frontpage
navi.auth.loginerror = frontpage
navi.auth.logout = frontpage
page.bill.billSummary.header = Summary of bills
page.bill.edit.header = Edit bill
page.bill.list.header = Bills
page.bill.listAll.header = Bills
page.bill.placemap.header = Place map
page.bill.show.header = Bill info
pagegroup.auth.login = frontpage
passwordChanged.body = You can now login with the new password.
......@@ -136,6 +156,6 @@ resetMail.username = Username
resetmailSent.body = Email has been sent containing a link where you can change the password.
resetmailSent.header = Email sent
subnavi.cards = \t\t
subnavi.cards = \u0009\u0009
user.unauthenticated = Kirjautumaton
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Sat Mar 30 17:56:44 EET 2013
acc_line.eventuser = Customer
acc_line.nick = Nick
......@@ -57,12 +59,16 @@ bill.address = Payers address
bill.billAmount = Bill amount
bill.billIsPaid = Bill is paid
bill.billLines = Products
bill.billNumber = Bill number
bill.billNumber = Number
bill.billPaidDate = Paid date
bill.cancel = Cancel bill
bill.deliveryTerms = Delivery terms
bill.edit = edit
bill.expires = Expires
bill.isExpired = Bill is expired
bill.isPaid = Paid
bill.markPaid = Mark paid
bill.markPaid.show = Show Mark paid -buttons
bill.markedPaid = Bill marked paid
bill.notes = Notes
bill.noticetime = Notice time
......@@ -75,6 +81,7 @@ bill.printBill = Print bill
bill.receiverAddress = Receiver address
bill.referenceNumberBase = Reference number base
bill.referencenumber = Reference nr.
bill.save = Save
bill.sentDate = Sent date
bill.show = Show
bill.theirReference = Clients reference
......@@ -274,6 +281,11 @@ game.gamepoints = Game points
gamepoints = Gamepoints
generic.sure.header = Confirmation
generic.sure.message = Are you sure?
generic.sure.no = No
generic.sure.yes = Yes
global.cancel = Cancel
global.copyright = Codecrew Ry
global.eventname = Event name
......@@ -401,6 +413,7 @@ page.auth.notauthorized.pagegroup = frontpage
page.auth.resetPassword.header = Reset password
page.bill.billSummary.header = Summary of bills
page.bill.edit.header = Edit bill
page.bill.list.header = Bills
page.bill.listAll.header = Bills
page.bill.placemap.header = Place map
page.bill.show.header = Bill info
......
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Bill number
# Validationmessages
#Sat Mar 30 17:56:44 EET 2013
actionlog.create.header = Create new actionmessage
actionlog.create.message = Message
......
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Sat Mar 30 17:56:44 EET 2013
acc_line.eventuser = Asiakas
acc_line.nick = Nimimerkki
......@@ -59,12 +61,16 @@ bill.billIsPaid = Lasku on maksettu
bill.billLines = Tuotteet
bill.billMarkedPaidMail.message = Laskusi numero {0} on merkitty maksetuksi. Voit nyt siirty\u00E4 lippukauppaan varamaan haluamasi paikat. Tervetuloa tapahtumaan!
bill.billMarkedPaidMail.subject = Lasku merkitty maksetuksi
bill.billNumber = Laskun numero
bill.billNumber = Numero
bill.billPaidDate = Maksup\u00E4iv\u00E4
bill.cancel = Peruuta lasku
bill.deliveryTerms = Toimitusehdot
bill.edit = Muokkaa
bill.expires = Vanhentuu
bill.isExpired = Lasku on vanhentunut
bill.isPaid = Maksettu
bill.markPaid = Maksettu
bill.markPaid.show = N\u00E4yt\u00E4 Maksettu -napit
bill.markedPaid = Lasku merkitty maksetuksi.
bill.notes = Huomioita
bill.noticetime = Huomautusaika
......@@ -77,10 +83,11 @@ bill.printBill = Tulosta lasku
bill.receiverAddress = Kauppiaan osoite
bill.referenceNumberBase = Viitenumeropohja
bill.referencenumber = Viitenumero
bill.save = Tallenna
bill.sentDate = P\u00E4iv\u00E4ys
bill.show = N\u00E4yt\u00E4
bill.theirReference = Asiakkaan viite
bill.totalPrice = Laskun summa
bill.totalPrice = Summa
bill.totalprice = Yhteens\u00E4
billLine.eventuser = Asiakas
......@@ -274,6 +281,11 @@ game.gamepoints = Insomnia Game pisteet:
gamepoints = Pelipisteit\u00E4
generic.sure.header = Varmistusikkuna
generic.sure.message = Oletko aivan varma?
generic.sure.no = Ei
generic.sure.yes = Kyll\u00E4
global.cancel = Peruuta
global.copyright = Codecrew Ry
global.eventname = Tapahtumanimi
......@@ -413,7 +425,10 @@ page.auth.logout.header = Uloskirjautuminen
page.auth.logoutsuccess.header = Logout
page.auth.resetPassword.header = Nollaa salasana
page.bill.billSummary.header = Laskujen yhteenveto
page.bill.edit.header = Muokkaa laskua
page.bill.list.header = Laskut
page.bill.listAll.header = Laskut
page.bill.placemap.header = Paikkakartta
page.bill.show.header = Laskun tiedot
page.checkout.cancel.header = Maksu peruutettu.
page.checkout.delayed.header = Viiv\u00E4stetty maksu
......
#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
#Bill number
# Validationmessages
#Sat Mar 30 17:56:44 EET 2013
actionlog.create.header = Luo uusi ActionMessage
actionlog.create.message = Viesti
......
......@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.PlaceGroupBeanLocal;
......
......@@ -116,4 +116,24 @@ public class BillEditView extends GenericCDIView {
public void setVmreturn(VerkkomaksutReturnEntry vmreturn) {
this.vmreturn = vmreturn;
}
public void expireBill() {
System.out.println("EXPIRE BILL; WE ARE THERE");
bill.markExpired();
System.out.println(""+ bill.getExpires().getTime());
this.save();
}
}
......@@ -17,7 +17,7 @@ import fi.codecrew.moya.model.FoodWave;
import fi.codecrew.moya.web.annotations.SelectedUser;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@Named()
@ConversationScoped
public class FoodShopView extends GenericCDIView {
......@@ -26,7 +26,6 @@ public class FoodShopView extends GenericCDIView {
private static final long serialVersionUID = 1288114954999406683L;
@Inject
@SelectedUser
private EventUser user;
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!