Commit 6987f98b by Tuukka Kivilahti

now placecodes can be found under foodwaves

1 parent 09d7c4c1
......@@ -476,6 +476,37 @@ public class EventUser extends GenericEntity {
}
/**
* Get first place from user registered places
*
* If you want to get where user is possibly sitting,
* use this function.
*
* @return first found place, of null if no places at all
*/
public Place getFirstPlace() {
// first, check if there is some currentUser -mapping in use (vectorama)
if(getCurrentPlaces() != null && getCurrentPlaces().size() >= 1) {
return getCurrentPlaces().get(0);
}
// no, there is not, so get places via old way
if (getGroupMemberships() == null) {
return null;
}
for(GroupMembership ship : getGroupMemberships()) {
if(this.equals(ship.getUser())) {
if(ship.getPlaceReservation() != null) {
return ship.getPlaceReservation();
}
}
}
return null;
}
public String getShortUserDescriptor() {
return user.getShortUserDescriptor();
}
......
......@@ -42,18 +42,21 @@
</p:column>
<p:column sortBy="#{acc_line.user.wholeName}">
<f:facet name="header">
<h:outputLabel value="#{i18n['acc_line.eventuser']}" />
<h:outputLabel value="#{i18n['acc_line.eventuser']} (#{i18n['acc_line.nick']})" />
</f:facet>
<h:outputText outcome="/useradmin/edit" value="#{acc_line.user.wholeName}" />
<h:link outcome="/useradmin/edit" value="#{acc_line.user.wholeName} (#{acc_line.user.nick})">
<f:param name="userid" value="#{acc_line.user.user.id}" />
</h:link>
</p:column>
<p:column sortBy="#{acc_line.user.nick}">
<p:column style="width: 80px;">
<f:facet name="header">
<h:outputLabel value="#{i18n['acc_line.nick']}" />
<h:outputLabel value="#{i18n['acc_line.place']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{acc_line.user.nick}">
<f:param name="userid" value="#{acc_line.user.user.id}" />
</h:link>
<h:outputText value="#{acc_line.user.firstPlace.name}" />
</p:column>
<p:column sortBy="#{acc_line.eventDelivered}">
<f:facet name="header">
<h:outputLabel value="#{i18n['accountEvent.delivered']}" />
......
......@@ -1675,3 +1675,4 @@ voting.create.voteEnd = \u00C4\u00E4nestys kiinni
voting.create.voteStart = \u00C4\u00E4nestys auki
yes = Kyll\u00E4
acc_line.place=Paikka
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!