Commit abb72c29 by Tuomas Riihimäki

Palautetta

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