Commit abb72c29 by Tuomas Riihimäki

Palautetta

1 parent 2d17d211
...@@ -9,6 +9,7 @@ import java.util.Map.Entry; ...@@ -9,6 +9,7 @@ import java.util.Map.Entry;
import javax.annotation.security.DeclareRoles; import javax.annotation.security.DeclareRoles;
import javax.annotation.security.RolesAllowed; import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.ejb.EJBException;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -128,4 +129,15 @@ public class AccountEventBean implements AccountEventBeanLocal { ...@@ -128,4 +129,15 @@ public class AccountEventBean implements AccountEventBeanLocal {
} }
@Override
public AccountEvent markDelivered(AccountEvent e, Calendar c) {
accountfacade.reload(e);
if (e.getDelivered() != null)
{
throw new EJBException("AccountEvent " + e + " already marked paid!");
}
e.setDelivered(c);
return e;
}
} }
...@@ -46,6 +46,7 @@ import fi.insomnia.bortal.model.User; ...@@ -46,6 +46,7 @@ import fi.insomnia.bortal.model.User;
UserPermission.S_INVITE_USERS, UserPermission.S_INVITE_USERS,
UserPermission.S_READ_ORGROLES, UserPermission.S_READ_ORGROLES,
UserPermission.S_WRITE_ORGROLES, UserPermission.S_WRITE_ORGROLES,
UserPermission.S_VITUTTAAKO,
MapPermission.S_VIEW, MapPermission.S_VIEW,
MapPermission.S_MANAGE_MAPS, MapPermission.S_MANAGE_MAPS,
......
...@@ -520,4 +520,10 @@ public class UserBean implements UserBeanLocal { ...@@ -520,4 +520,10 @@ public class UserBean implements UserBeanLocal {
return eventUserFacade.searchEventUsers(searchQuery); return eventUserFacade.searchEventUsers(searchQuery);
} }
@Override
public void submitFeedback(String feedback) {
logger.warn("Received feedback {}", feedback);
// TODO
}
} }
\ No newline at end of file
package fi.insomnia.bortal.beans; package fi.insomnia.bortal.beans;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -25,4 +26,6 @@ public interface AccountEventBeanLocal { ...@@ -25,4 +26,6 @@ public interface AccountEventBeanLocal {
List<Role> getRolesFromAccountEvents(EventUser u); List<Role> getRolesFromAccountEvents(EventUser u);
AccountEvent markDelivered(AccountEvent e, Calendar c);
} }
...@@ -81,4 +81,6 @@ public interface UserBeanLocal { ...@@ -81,4 +81,6 @@ public interface UserBeanLocal {
SearchResult<EventUser> getThisEventsUsers(UserSearchQuery searchQuery); SearchResult<EventUser> getThisEventsUsers(UserSearchQuery searchQuery);
void submitFeedback(String feedback);
} }
...@@ -17,7 +17,7 @@ public enum UserPermission implements IAppPermission { ...@@ -17,7 +17,7 @@ public enum UserPermission implements IAppPermission {
MANAGE_HTTP_SESSION, // ("Manage http sessions"), MANAGE_HTTP_SESSION, // ("Manage http sessions"),
INVITE_USERS, // ("Invite users"), INVITE_USERS, // ("Invite users"),
READ_ORGROLES, // ("View organization roles"), READ_ORGROLES, // ("View organization roles"),
WRITE_ORGROLES, // ("Modify organization roles"), WRITE_ORGROLES, VITUTTAAKO, // ("Modify organization roles"),
; ;
public static final String S_VIEW_ALL = "USER/VIEW_ALL"; public static final String S_VIEW_ALL = "USER/VIEW_ALL";
...@@ -35,6 +35,7 @@ public enum UserPermission implements IAppPermission { ...@@ -35,6 +35,7 @@ public enum UserPermission implements IAppPermission {
public static final String S_INVITE_USERS = "USER/INVITE_USERS"; public static final String S_INVITE_USERS = "USER/INVITE_USERS";
public static final String S_READ_ORGROLES = "USER/READ_ORGROLES"; public static final String S_READ_ORGROLES = "USER/READ_ORGROLES";
public static final String S_WRITE_ORGROLES = "USER/WRITE_ORGROLES"; public static final String S_WRITE_ORGROLES = "USER/WRITE_ORGROLES";
public static final String S_VITUTTAAKO = "USER/VITUTTAAKO";
private final String fullName; private final String fullName;
private final String key; private final String key;
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
</session-config> </session-config>
<context-param> <context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name> <param-name>javax.faces.PROJECT_STAGE</param-name>
<!-- <param-value>Production</param-value> --> <param-value>Production</param-value>
<param-value>Development</param-value> <!-- <param-value>Development</param-value>-->
</context-param> </context-param>
<context-param> <context-param>
......
...@@ -45,12 +45,17 @@ ...@@ -45,12 +45,17 @@
<h:outputText rendered="#{sessionHandler.loggedIn}" value="#{i18n['template.loggedInAs']} #{sessionHandler.currentUser.nick}" /> <h:outputText rendered="#{sessionHandler.loggedIn}" value="#{i18n['template.loggedInAs']} #{sessionHandler.currentUser.nick}" />
<div> <div>
<tools:loginLogout /> <tools:loginLogout />
</div> </div>
</div> </div>
<ui:fragment rendered="#{menuView.getMenu(0).size() > 1}"> <ui:fragment rendered="#{menuView.getMenu(0).size() > 1}">
<ul id="topmenu"> <ul id="topmenu">
<li jsfc="ui:repeat" var="menuitem" value="#{menuView.getMenu(0)}"><h:link outcome="#{menuitem.outcome}" value="#{i18n[menuitem.navigation.key]}" <li jsfc="ui:repeat" var="menuitem" value="#{menuView.getMenu(0)}"><h:link outcome="#{menuitem.outcome}" value="#{i18n[menuitem.navigation.key]}"
styleClass="#{menuitem.selected?'active':''}" /></li> styleClass="#{menuitem.selected?'active':''}" /></li>
<ui:fragment rendered="#{feedbackView.canFeedback}" >
<li><h:link outcome="/feedback/index" value="#{i18n['feedback.canFeedback']}" /></li>
</ui:fragment>
<li></li>
</ul> </ul>
</ui:fragment> </ui:fragment>
</div> </div>
......
...@@ -38,7 +38,7 @@ td span span div.rating-cancel { ...@@ -38,7 +38,7 @@ td span span div.rating-cancel {
} }
#login { #login {
width: 400px; width: 385px;
height: 23px; height: 23px;
float: right; float: right;
margin-top: 10px; margin-top: 10px;
......
...@@ -194,6 +194,10 @@ eventorgView.eventname = Name of event ...@@ -194,6 +194,10 @@ eventorgView.eventname = Name of event
eventorganiser.name = Eventorganiser eventorganiser.name = Eventorganiser
feedback.canFeedback = Feedback
feedback.submit = Submit
feedback.thanks = Thanks
food = Food food = Food
foodWave.accountevents = Accountevents foodWave.accountevents = Accountevents
......
...@@ -192,6 +192,10 @@ eventorgView.eventname = Tapahtuman nimi ...@@ -192,6 +192,10 @@ eventorgView.eventname = Tapahtuman nimi
eventorganiser.name = Tapahtumaj\u00E4rjest\u00E4j\u00E4 eventorganiser.name = Tapahtumaj\u00E4rjest\u00E4j\u00E4
feedback.canFeedback = Vituttaako?
feedback.submit = L\u00E4het\u00E4
feedback.thanks = Kiiiiitooooos! :)
food = Ruoka food = Ruoka
foodWave.accountevents = Maksetut tilaukset foodWave.accountevents = Maksetut tilaukset
......
...@@ -67,7 +67,7 @@ public class FoodWaveView extends GenericCDIView { ...@@ -67,7 +67,7 @@ public class FoodWaveView extends GenericCDIView {
private Integer foodWaveId; private Integer foodWaveId;
private ListDataModel<AccountEvent> accountEventLines; private ListDataModel<AccountEvent> accountEventLines;
private ListDataModel<FoodWave> foodWaves; private List<FoodWave> foodWaves;
private static final Logger logger = LoggerFactory.getLogger(FoodWaveView.class); private static final Logger logger = LoggerFactory.getLogger(FoodWaveView.class);
public List<Product> getProducts() { public List<Product> getProducts() {
...@@ -80,11 +80,6 @@ public class FoodWaveView extends GenericCDIView { ...@@ -80,11 +80,6 @@ public class FoodWaveView extends GenericCDIView {
this.foodWaveBean.saveTemplate(template); this.foodWaveBean.saveTemplate(template);
} }
public void onEditFoodWave() {
FoodWave fw = foodWaves.getRowData();
this.foodWaveBean.merge(fw);
}
public void initTemplateList() { public void initTemplateList() {
super.requirePermissions(ShopPermission.SHOP_FOODWAVE); super.requirePermissions(ShopPermission.SHOP_FOODWAVE);
} }
...@@ -92,11 +87,7 @@ public class FoodWaveView extends GenericCDIView { ...@@ -92,11 +87,7 @@ public class FoodWaveView extends GenericCDIView {
public void initFoodwaveManagerList() { public void initFoodwaveManagerList() {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES)) if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES))
{ {
if(foodWaves == null) { foodWaves = foodWaveBean.getEventFoodWaves();
super.beginConversation();
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
}
} }
} }
...@@ -119,9 +110,9 @@ public class FoodWaveView extends GenericCDIView { ...@@ -119,9 +110,9 @@ public class FoodWaveView extends GenericCDIView {
if (templateId != null) if (templateId != null)
{ {
template = foodWaveBean.findTemplate(templateId); template = foodWaveBean.findTemplate(templateId);
foodWaves = new ListDataModel<FoodWave>(template.getFoodwaves()); foodWaves = template.getFoodwaves();
} else { } else {
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves()); foodWaves = foodWaveBean.getOpenFoodWaves();
} }
super.beginConversation(); super.beginConversation();
} }
...@@ -244,8 +235,7 @@ public class FoodWaveView extends GenericCDIView { ...@@ -244,8 +235,7 @@ public class FoodWaveView extends GenericCDIView {
public String deliverAccountEvent() { public String deliverAccountEvent() {
if (getAccountEventLines().isRowAvailable()) { if (getAccountEventLines().isRowAvailable()) {
AccountEvent e = getAccountEventLines().getRowData(); AccountEvent e = getAccountEventLines().getRowData();
e.setDelivered(Calendar.getInstance()); e = accountEventBean.markDelivered(e, Calendar.getInstance());
e = accountEventBean.merge(e);
foodWaveId = selectedFoodWave.getId(); foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null; selectedFoodWave = null;
...@@ -344,11 +334,11 @@ public class FoodWaveView extends GenericCDIView { ...@@ -344,11 +334,11 @@ public class FoodWaveView extends GenericCDIView {
this.billLines = billLines; this.billLines = billLines;
} }
public void setFoodWaves(ListDataModel<FoodWave> foodWaves) { public void setFoodWaves(List<FoodWave> foodWaves) {
this.foodWaves = foodWaves; this.foodWaves = foodWaves;
} }
public ListDataModel<FoodWave> getFoodWaves() { public List<FoodWave> getFoodWaves() {
return foodWaves; return foodWaves;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!