Commit 675f6be5 by Tuomas Riihimäki

foooooood.

1 parent 078d6814
......@@ -207,7 +207,7 @@ public class MenuBean implements MenuBeanLocal {
foodnavi.addPage(menuitemfacade.findOrCreate("/foodadmin/editTemplate"), ShopPermission.MANAGE_FOODWAVES).setVisible(false);
foodnavi.addPage(menuitemfacade.findOrCreate("/foodmanager/listFoodwaves"), ShopPermission.MANAGE_FOODWAVES);
foodnavi.addPage(menuitemfacade.findOrCreate("/foodmanager/listOrders"), ShopPermission.MANAGE_FOODWAVES);
foodnavi.addPage(menuitemfacade.findOrCreate("/foodmanager/listOrders"), ShopPermission.MANAGE_FOODWAVES).setVisible(false);
}
......
......@@ -10,6 +10,7 @@
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<!-- <param-value>Production</param-value> -->
<param-value>Development</param-value>
</context-param>
......
......@@ -12,13 +12,12 @@
template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="foodwaveid" value="#{foodWaveView.foodWaveId}" />
<f:event type="preRenderView"
listener="#{foodWaveView.initFoodWaveOrderList}" />
<f:event type="preRenderView" listener="#{foodWaveView.initFoodWaveOrderList}" />
<!-- <f:event type="preRenderView" listener="#{foodWaveView.initFoodwaveAccountEventList}" /> -->
</f:metadata>
<ui:define name="title">
<h1>#{foodWaveView.foodWave.name}</h1>
<h1>#{foodWaveView.selectedFoodWave.name}</h1>
</ui:define>
<ui:define name="content">
......
......@@ -18,8 +18,6 @@
</composite:interface>
<composite:implementation>
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript library="primefaces" name="jquery/jquery.js" />
......@@ -84,14 +82,14 @@
</p:column>
</p:dataTable>
<h:commandButton action="#{cc.attrs.selectaction}" value="#{i18n[cc.attrs.commitValue]}" >
</h:commandButton>
<h:commandButton action="#{foodWaveFoodView.buyFromInternet}" value="#{i18n['foodshop.buyFromInternet']}" >
</h:commandButton>
<div>
<h:outputLabel for="total" value="#{i18n['foodshop.total']}: "/>
<h:outputText id="total" value="#{foodWaveFoodView.totalPrice}" >
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:outputText>
</div>
<h:commandButton action="#{cc.attrs.selectaction}" value="#{i18n[cc.attrs.commitValue]}" />
<h:commandButton action="#{foodWaveFoodView.buyFromInternet}" value="#{i18n['foodshop.buyFromInternet']}" />
</h:form>
......
......@@ -212,13 +212,17 @@ foodWave.unconfirmedOrders = Unconfirmed
foodadmin.editTemplate = Edit
foodshop.buyAndPay = Buy and Pay
foodshop.buyFromCounter = Pay at info
foodshop.buyFromInternet = Pay at Internet
foodshop.total = Total
foodwave.orders = Foodwave Orders
foodwave.template.basicinfo = Template Information
foodwave.template.description = Description
foodwave.template.edit.title = Foodwave Template Editor
foodwave.template.list.title = Foodwave Templates
foodwave.template.name = Name
foodwave.template.selectproducts = Products
foodwaveTemplate.name = Name
......@@ -227,8 +231,11 @@ foodwavetemplate.actions = Actions
foodwavetemplate.addproduct = Add
foodwavetemplate.basicinfo = Template
foodwavetemplate.createFoodwave = Create Foodwave
foodwavetemplate.createwave = Create foodwave
foodwavetemplate.description = Description
foodwavetemplate.edit = Edit foodwave template
foodwavetemplate.editRow = Edit
foodwavetemplate.maxfoods = Maximum orders
foodwavetemplate.name = Name
foodwavetemplate.price = Price
foodwavetemplate.productdescription = Description
......@@ -237,6 +244,8 @@ foodwavetemplate.removeFromList = Remove
foodwavetemplate.save = Ok
foodwavetemplate.savetemplate = Submit
foodwavetemplate.selectproducts = Products
foodwavetemplate.startTime = Foodwave time
foodwavetemplate.waveName = Wave name
game.gamepoints = Game points
......@@ -625,7 +634,9 @@ submenu.auth.sendResetMail = Password reset
submenu.bill.billSummary = Bill summary
submenu.bill.list = My bills
submenu.bill.listAll = All bills
submenu.foodadmin.createTemplate = Create foodwave template
submenu.foodadmin.listTemplates = List foodwave templates
submenu.foodmanager.listFoodwaves = List active foodwaves
submenu.foodwave.list = Open foodwaves
submenu.foodwave.listTemplates = Food provides
submenu.index = Frontpage
......
......@@ -210,13 +210,17 @@ foodWave.unconfirmedOrders = Vahvistamattomia
foodadmin.editTemplate = Muokkaa
foodshop.buyAndPay = Varaa ja maksa
foodshop.buyFromCounter = Maksa infossa
foodshop.buyFromInternet = Maksa Internetiss\u00E4
foodshop.total = Yhteens\u00E4
foodwave.orders = Maksetut Tilaukset
foodwave.template.basicinfo = Template Infot
foodwave.template.description = Kuvaus
foodwave.template.edit.title = Foodwave Template Editori
foodwave.template.list.title = Ruokatilaus Templatet
foodwave.template.name = Nimi
foodwave.template.selectproducts = Tuotteet
foodwaveTemplate.name = Nimi
......@@ -225,8 +229,11 @@ foodwavetemplate.actions = Toimet
foodwavetemplate.addproduct = Lis\u00E4\u00E4
foodwavetemplate.basicinfo = Templeitti
foodwavetemplate.createFoodwave = Luo ruokatilaus
foodwavetemplate.createwave = Luo tilauspohja
foodwavetemplate.description = Kuvaus
foodwavetemplate.edit = Muokkaa tilauspohjaa
foodwavetemplate.editRow = Muokkaa
foodwavetemplate.maxfoods = Tilausten enimm\u00E4ism\u00E4\u00E4r\u00E4
foodwavetemplate.name = Nimi
foodwavetemplate.price = Hinta
foodwavetemplate.productdescription = Kuvaus
......@@ -235,6 +242,8 @@ foodwavetemplate.removeFromList = Poista
foodwavetemplate.save = Ok
foodwavetemplate.savetemplate = Tallenna
foodwavetemplate.selectproducts = Tuotteet
foodwavetemplate.startTime = Tilausaika
foodwavetemplate.waveName = Tilauksen nimi
game.gamepoints = Insomnia Game pisteet:
......@@ -605,7 +614,9 @@ submenu.auth.sendResetMail = Salasanan palautus
submenu.bill.billSummary = Laskujen yhteenveto
submenu.bill.list = N\u00E4yt\u00E4 omat laskut
submenu.bill.listAll = Kaikki laskut
submenu.foodadmin.createTemplate = Luo tilauspohja
submenu.foodadmin.listTemplates = Muokkaa tilauspohjia
submenu.foodmanager.listFoodwaves = Aktiiviset ruokatilaukset
submenu.foodwave.list = Avoimet tilaukset
submenu.index = Etusivu
submenu.map.create = Uusi kartta
......
......@@ -14,7 +14,8 @@ import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named;
import com.sun.xml.rpc.processor.schema.UnimplementedFeatureException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.beans.AccountEventBeanLocal;
import fi.insomnia.bortal.beans.BillBeanLocal;
......@@ -67,9 +68,12 @@ public class FoodWaveView extends GenericCDIView {
private Integer foodWaveId;
private ListDataModel<AccountEvent> accountEventLines;
private List<FoodWave> foodWaves;
private static final Logger logger = LoggerFactory.getLogger(FoodWaveView.class);
public List<Product> getProducts() {
return productbeanlocal.getProducts();
List<Product> ret = productbeanlocal.getProducts();
ret.removeAll(template.getProducts());
return ret;
}
public void onEdit() {
......@@ -142,22 +146,22 @@ public class FoodWaveView extends GenericCDIView {
super.beginConversation();
}
}
public List<FoodwaveProductSummary> getProductSummaries() {
System.out.println("..asdfasdf");
HashMap<Product, FoodwaveProductSummary> pmap = new HashMap<Product, FoodwaveProductSummary>();
for(AccountEvent ae : getSelectedFoodWave().getAccountEvents()) {
if(!pmap.containsKey(ae.getProduct())) {
for (AccountEvent ae : getSelectedFoodWave().getAccountEvents()) {
if (!pmap.containsKey(ae.getProduct())) {
pmap.put(ae.getProduct(), new FoodwaveProductSummary(ae.getProduct(), new BigDecimal(0), new BigDecimal(0)));
}
System.out.println("..");
pmap.get(ae.getProduct()).add(ae);
}
System.out.println("::"+pmap.values().size());
return new ArrayList<FoodwaveProductSummary>(pmap.values());
System.out.println("::" + pmap.values().size());
return new ArrayList<FoodwaveProductSummary>(pmap.values());
}
private void createNewProductSkeleton() {
......@@ -221,9 +225,9 @@ public class FoodWaveView extends GenericCDIView {
public void initFoodWaveOrderList() {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES) && selectedFoodWave == null) {
System.out.println("Testiä");
selectedFoodWave = foodWaveBean.findFoodwave(foodWaveId);
selectedFoodWave = foodWaveBean.findFoodwave(foodWaveId);
logger.debug("Got foodwave {} with id {}", selectedFoodWave, foodWaveId);
this.setAccountEventLines(new ListDataModel<AccountEvent>(selectedFoodWave.getAccountEvents()));
List<BillLine> tmpLines = new ArrayList<BillLine>();
......@@ -264,7 +268,7 @@ public class FoodWaveView extends GenericCDIView {
}
public FoodWave getSelectedFoodWave() {
//System.out.println("APOFKASFASFASFASFASFASFASFASFASFKJIOJIO");
// System.out.println("APOFKASFASFASFASFASFASFASFASFASFKJIOJIO");
return selectedFoodWave;
}
......
......@@ -72,7 +72,6 @@ public class ProductShopView extends GenericCDIView {
private boolean blip = false;
private ListDataModel<ProductShopItem> boughtItems;
@EJB
public void initBillView() {
if (requirePermissions(ShopPermission.LIST_USERPRODUCTS)
&& shoppingcart == null) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!