Commit 4aaf3008 by Tuomas Riihimäki

Merge branch 'master' of codecrew.fi:bortal

2 parents 12f812d8 e82919b4
...@@ -89,6 +89,10 @@ public class FoodWave extends GenericEntity { ...@@ -89,6 +89,10 @@ public class FoodWave extends GenericEntity {
return closed; return closed;
} }
public boolean isClosed() {
return closed;
}
public void setClosed(boolean waveClosed) { public void setClosed(boolean waveClosed) {
this.closed = waveClosed; this.closed = waveClosed;
} }
...@@ -108,5 +112,39 @@ public class FoodWave extends GenericEntity { ...@@ -108,5 +112,39 @@ public class FoodWave extends GenericEntity {
public FoodWaveTemplate getTemplate() { public FoodWaveTemplate getTemplate() {
return template; return template;
} }
public boolean isFull() {
return false;
}
/**
* Check if foodwave is orderable
*
* That means that it's not closed, full and it's in future
* @return
*/
public boolean isOrderable() {
if(isClosed()) {
return false;
}
if(getTime().before(Calendar.getInstance())) {
return false;
}
if(isFull()) {
return false;
}
return true;
}
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
package fi.insomnia.bortal.model; package fi.insomnia.bortal.model;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
...@@ -100,5 +101,26 @@ public class FoodWaveTemplate extends GenericEntity { ...@@ -100,5 +101,26 @@ public class FoodWaveTemplate extends GenericEntity {
public void setEvent(LanEvent event) { public void setEvent(LanEvent event) {
this.event = event; this.event = event;
} }
public List<FoodWave> getOrderableFoodwaves() {
List<FoodWave> returnList = new ArrayList<FoodWave>();
for(FoodWave wave : getFoodwaves()) {
if(wave.isOrderable()) {
returnList.add(wave);
}
}
return returnList;
}
} }
<!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/cditools/user" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:account="http://java.sun.com/jsf/composite/cditools/account"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:event type="preRenderView" listener="#{cardMassPrintView.initView}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['card.massprint.title']}</h1>
</ui:define>
<ui:define name="content">
<h:form>
<p:commandButton rendered="#{cardMassPrintView.file!=null}" id="downloadLink" value="Download" ajax="false" onclick="PrimeFaces.monitorDownload(start, stop)" icon="ui-icon-arrowthichk-s">
<p:fileDownload value="#{cardMassPrintView.file}" />
</p:commandButton>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
...@@ -20,7 +20,9 @@ ...@@ -20,7 +20,9 @@
<h:commandButton action="#{userCartView.removeCurrent()}" value="#{i18n['usercart.removeCurrent']}" /> <h:commandButton action="#{userCartView.removeCurrent()}" value="#{i18n['usercart.removeCurrent']}" />
<h:commandButton action="#{userCartView.next()}" value="#{i18n['usercart.next']}" rendered="#{userCartView.userCartSize > (userCartView.current+1)}" /></h:form> <h:commandButton action="#{userCartView.next()}" value="#{i18n['usercart.next']}" rendered="#{userCartView.userCartSize > (userCartView.current+1)}" /></h:form>
<h:link includeViewParams="true" outcome="/card/massprint" value="#{i18n['usercard.massprint']}" /> <h:link outcome="/card/massprint" value="yarr">
<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
</h:link>
<p> <p>
......
...@@ -21,6 +21,7 @@ bill.billMarkedPaidMail.message = Your deposit number {0} has been marked as pai ...@@ -21,6 +21,7 @@ bill.billMarkedPaidMail.message = Your deposit number {0} has been marked as pai
bill.billMarkedPaidMail.subject = [Streamparty] Your credits have been updated bill.billMarkedPaidMail.subject = [Streamparty] Your credits have been updated
eventorg.create = Create eventorg.create = Create
eventorg.edit = Edit
global.cancel = Cancel global.cancel = Cancel
global.copyright = Codecrew Ry global.copyright = Codecrew Ry
......
...@@ -155,6 +155,7 @@ eventorg.bundleCountry = Kieli-bundle ...@@ -155,6 +155,7 @@ eventorg.bundleCountry = Kieli-bundle
eventorg.create = Luo eventorg.create = Luo
eventorg.createEvent = Luo tapahtuma eventorg.createEvent = Luo tapahtuma
eventorg.createevent = Luo uusi tapahtuma eventorg.createevent = Luo uusi tapahtuma
eventorg.edit = Muokkaa
eventorg.events = Organisaation tapahtumat eventorg.events = Organisaation tapahtumat
eventorg.organisation = Organisaation nimi eventorg.organisation = Organisaation nimi
eventorg.save = Tallenna eventorg.save = Tallenna
......
package fi.insomnia.bortal.web; package fi.insomnia.bortal.web;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import fi.insomnia.bortal.beans.CardPrintBeanLocal; import org.slf4j.Logger;
import fi.insomnia.bortal.model.EventUser; import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.web.cdiview.user.UserCartView;
import sun.misc.Queue;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Serializable; import java.io.Serializable;
import java.io.StringWriter; import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List;
import java.util.Map; import java.util.Map;
@Named @Named
@RequestScoped @SessionScoped
public class ErrorPageView { public class ErrorPageView implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
// private static final long serialVersionUID = -2179309061036632342L;
String trace; String trace;
// maintain a trail of pages visited (10?)
Queue trail = new Queue();
@SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(ErrorPageView.class);
public String getStackTrace() { public String getStackTrace() {
FacesContext context = FacesContext.getCurrentInstance(); FacesContext context = FacesContext.getCurrentInstance();
......
...@@ -113,7 +113,7 @@ public class FoodWaveView extends GenericCDIView { ...@@ -113,7 +113,7 @@ public class FoodWaveView extends GenericCDIView {
public String selectTemplate() { public String selectTemplate() {
if (templates.isRowAvailable()) { if (templates.isRowAvailable()) {
foodWaves = new ListDataModel<FoodWave>(templates.getRowData() foodWaves = new ListDataModel<FoodWave>(templates.getRowData()
.getFoodwaves()); .getOrderableFoodwaves());
} }
return "/foodwave/list"; return "/foodwave/list";
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!