Commit 1e3b77f3 by Tuukka Kivilahti

Merge branch 'rnd' into 'master'

Random minor fixes and improvements

See merge request !321
2 parents 0b8e3237 d2f887ff
...@@ -51,7 +51,7 @@ public class PlaceSlot extends GenericEntity { ...@@ -51,7 +51,7 @@ public class PlaceSlot extends GenericEntity {
this.created = Calendar.getInstance().getTime(); this.created = Calendar.getInstance().getTime();
} }
public boolean isUsed() { public boolean isSlotUsed() {
return used != null || place != null; return used != null || place != null;
} }
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
moyaurl : "#{request.contextPath}", moyaurl : "#{request.contextPath}",
map_id : #{ajaxMapView.map.id}, map_id : #{ajaxMapView.map.id},
}); });
px.toggleaction = #{ajaxMapView.queueEnabled?'undefined':'px.toggle_place'}, px.toggleaction = #{ajaxMapView.queueEnabled?'undefined':'px.toggle_place'};
</script> </script>
......
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "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:c="http://java.sun.com/jsp/jstl/core" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" <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:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<ui:param name="thispage" value="page.place.mygroups" /> <ui:param name="thispage" value="page.place.mygroups" />
...@@ -28,26 +28,31 @@ ...@@ -28,26 +28,31 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['placegroupview.reservationName']}" /> <h:outputText value="#{i18n['placegroupview.reservationName']}" />
</f:facet> </f:facet>
<h:outputText value="#{member.placeReservation.name}" /> <h:link value="#{member.placeReservation.name}" outcome="/place/edit">
<f:param name="placeid" value="#{member.placeReservation.id}" />
</h:link>
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['placegroupview.token']}" /> <h:outputText value="#{i18n['placegroupview.token']}" />
</f:facet> </f:facet>
<h:outputText rendered="#{empty member.user}" value="#{member.inviteToken}" /> <h:outputText rendered="#{empty member.user}" value="#{member.inviteToken}" />
<h:outputText rendered="#{!empty member.user}" value="#{member.user.firstnames} #{member.user.lastname} (#{member.user.nick})" /> <h:link rendered="#{!empty member.user}" value="#{member.user.firstnames} #{member.user.lastname} (#{member.user.nick})" outcome="/place/adminGroups">
<f:param name="userid" value="#{member.user.user.id}" />
</h:link>
</h:column> </h:column>
<h:column> <h:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['placegroupview.groupCreator']}" /> <h:outputText value="#{i18n['placegroupview.groupCreator']}" />
</f:facet> </f:facet>
<h:outputText value="#{member.placeGroup.creator.firstnames} #{member.placeGroup.creator.lastname} (#{member.placeGroup.creator.nick})" /> <h:link value="#{member.placeGroup.creator.firstnames} #{member.placeGroup.creator.lastname} (#{member.placeGroup.creator.nick})" outcome="/place/adminGroups">
<f:param name="userid" value="#{member.placeGroup.creator.user.id}" />
</h:link>
</h:column> </h:column>
<h:column> <h:column>
<h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}" action="#{placeGroupView.releasePlace()}" value="#{i18n['placegroupview.releasePlace']}" /> <h:commandButton rendered="#{placeGroupView.canModifyCurrent and placeGroupView.currentMemberUserNotNull}" action="#{placeGroupView.releasePlace()}"
value="#{i18n['placegroupview.releasePlace']}" />
</h:column> </h:column>
</h:dataTable> </h:dataTable>
...@@ -66,7 +71,7 @@ ...@@ -66,7 +71,7 @@
<h2>Place slots</h2> <h2>Place slots</h2>
<h:form> <h:form>
<p:dataTable var="slot" value="#{placeGroupView.placeslots}" id="placeslots"> <p:dataTable var="slot" value="#{placeGroupView.placeslots}" id="placeslots">
<p:column headerText="#{i18n['placeslot.id']}"> <p:column headerText="#{i18n['placeslot.id']}">
<h:outputText value="#{slot.id}" /> <h:outputText value="#{slot.id}" />
...@@ -78,7 +83,9 @@ ...@@ -78,7 +83,9 @@
<h:outputText value="#{slot.product.name}" /> <h:outputText value="#{slot.product.name}" />
</p:column> </p:column>
<p:column headerText="#{i18n['placeslot.place']}"> <p:column headerText="#{i18n['placeslot.place']}">
<h:outputText rendered="#{!empty slot.place}" value="#{slot.place.name}" /> <h:link value="#{slot.place.name}" rendered="#{!empty slot.place}" outcome="/place/edit">
<f:param name="placeid" value="#{slot.place.id}" />
</h:link>
</p:column> </p:column>
<p:column headerText="#{i18n['placeslot.used']}"> <p:column headerText="#{i18n['placeslot.used']}">
<h:outputText value="#{slot.used}"> <h:outputText value="#{slot.used}">
...@@ -90,7 +97,7 @@ ...@@ -90,7 +97,7 @@
<f:param name="billid" value="#{slot.bill.id}" /> <f:param name="billid" value="#{slot.bill.id}" />
</h:link> </h:link>
</p:column> </p:column>
<p:column > <p:column>
<p:commandButton rendered="#{empty slot.place and empty slot.used}" value="#{i18n['placeslot.lockSlot']}" actionListener="#{placeGroupView.lockSlot}" update="placeslots" /> <p:commandButton rendered="#{empty slot.place and empty slot.used}" value="#{i18n['placeslot.lockSlot']}" actionListener="#{placeGroupView.lockSlot}" update="placeslots" />
<p:commandButton rendered="#{empty slot.place and not empty slot.used}" value="#{i18n['placeslot.releaseSlot']}" actionListener="#{placeGroupView.releaseSlot}" update="placeslots" /> <p:commandButton rendered="#{empty slot.place and not empty slot.used}" value="#{i18n['placeslot.releaseSlot']}" actionListener="#{placeGroupView.releaseSlot}" update="placeslots" />
</p:column> </p:column>
......
...@@ -20,12 +20,14 @@ ...@@ -20,12 +20,14 @@
<h1>#{i18n['userlist.header']}</h1> <h1>#{i18n['userlist.header']}</h1>
<h:form id="pageform" styleClass="useradmin_list"> <h:form id="pageform" styleClass="useradmin_list">
<!-- This is here, so that pressing enter works correctly. -->
<p:commandButton style="display: none;" action="#{userSearchView.newSearch()}" ajax="false" />
<p:panelGrid style="width: 100%;"> <p:panelGrid style="width: 100%;">
<p:row> <p:row>
<p:column> <p:column>
<p:commandButton onclick="$('#advancedSearch').toggle(); return false;" value="#{i18n['userlist.showAdvancedSearch']}" ajax="false" /> <p:commandButton onclick="$('#advancedSearch').toggle(); return false;" value="#{i18n['userlist.showAdvancedSearch']}" ajax="false" />
<div id="advancedSearch" style="display: none;"> <div id="advancedSearch" style="display: none;">
<!-- <!--
...@@ -37,56 +39,54 @@ ...@@ -37,56 +39,54 @@
value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}"> value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}">
</h:inputText> </h:inputText>
--> -->
<p:selectManyCheckbox layout="pageDirection" styleClass="nowrap" id="rolefilter" value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}"> <p:selectManyCheckbox layout="pageDirection" styleClass="nowrap" id="rolefilter" value="#{userSearchView.searchQuery.filterRoles}" converter="#{roleConverter}">
<f:selectItems value="#{roleDataView.roles}" var="r" itemLabel="#{r.name}" /> <f:selectItems value="#{roleDataView.roles}" var="r" itemLabel="#{r.name}" />
</p:selectManyCheckbox> </p:selectManyCheckbox>
<h3> <h3>
<h:outputText value="#{i18n['userlist.cardfilter']}" /> <h:outputText value="#{i18n['userlist.cardfilter']}" />
</h3> </h3>
<p:selectManyCheckbox id="cardstatusfilter" layout="pageDirection" styleClass="nowrap" value="#{userSearchView.searchQuery.hasCardState}" converter="#{cardStateConverter}"> <p:selectManyCheckbox id="cardstatusfilter" layout="pageDirection" styleClass="nowrap" value="#{userSearchView.searchQuery.hasCardState}" converter="#{cardStateConverter}">
<f:selectItems value="#{userSearchView.searchQuery.cardStates}" var="r" itemLabel="#{r}" /> <f:selectItems value="#{userSearchView.searchQuery.cardStates}" var="r" itemLabel="#{r}" />
</p:selectManyCheckbox> </p:selectManyCheckbox>
<h3> <h3>Muut</h3>
Muut
</h3>
<p:selectBooleanCheckbox id="placeassoc" value="#{userSearchView.searchQuery.placeAssoc}" /> <p:selectBooleanCheckbox id="placeassoc" value="#{userSearchView.searchQuery.placeAssoc}" />
<p:outputLabel for="placeassoc" value="#{i18n['userlist.placeassoc']}" /> <p:outputLabel for="placeassoc" value="#{i18n['userlist.placeassoc']}" />
<br /> <br />
<p:outputLabel for="saldofilter" value="#{i18n['userlist.saldofilter']}" /> <p:outputLabel for="saldofilter" value="#{i18n['userlist.saldofilter']}" />
<h:selectOneMenu id="saldofilter" value="#{userSearchView.searchQuery.accountSaldoCompare}"> <h:selectOneMenu id="saldofilter" value="#{userSearchView.searchQuery.accountSaldoCompare}">
<f:selectItems value="#{userSearchView.searchQuery.accountCompareValues}" /> <f:selectItems value="#{userSearchView.searchQuery.accountCompareValues}" />
</h:selectOneMenu> </h:selectOneMenu>
<p:inputText value="#{userSearchView.searchQuery.accountSaldo}"> <p:inputText value="#{userSearchView.searchQuery.accountSaldo}">
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" /> <f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</p:inputText> </p:inputText>
<br /> <br />
<p:selectBooleanCheckbox id="onlythisevent" value="#{userSearchView.searchQuery.onlyThisEvent}" /> <p:selectBooleanCheckbox id="onlythisevent" value="#{userSearchView.searchQuery.onlyThisEvent}" />
<p:outputLabel for="onlythisevent" value="#{i18n['userlist.onlythisevent']}" /> <p:outputLabel for="onlythisevent" value="#{i18n['userlist.onlythisevent']}" />
<br /> <br />
<p:selectBooleanCheckbox id="userswithunusedcodes" value="#{userSearchView.searchQuery.usersWithUnusedCodes}" /> <p:selectBooleanCheckbox id="userswithunusedcodes" value="#{userSearchView.searchQuery.usersWithUnusedCodes}" />
<p:outputLabel for="userswithunusedcodes" value="#{i18n['userlist.usersWithUnusedCodes']}" /> <p:outputLabel for="userswithunusedcodes" value="#{i18n['userlist.usersWithUnusedCodes']}" />
</div> </div>
<br /> <br />
</p:column> </p:column>
<p:column> <p:column>
<!-- <a id="show_user_cart" style="display: #{((userCartView.isEmpty())?'block':'none')};" onclick="$('#pageform\\:usercart').slideToggle(300);"><h:outputText value="#{i18n['usercart.showCart']}" /></a> --> <!-- <a id="show_user_cart" style="display: #{((userCartView.isEmpty())?'block':'none')};" onclick="$('#pageform\\:usercart').slideToggle(300);"><h:outputText value="#{i18n['usercart.showCart']}" /></a> -->
<p:commandButton onclick="$('#pageform\\:usercart').toggle(); return false;" value="#{i18n['usercart.showCart']}" ajax="false" /> <p:commandButton onclick="$('#pageform\\:usercart').toggle(); return false;" value="#{i18n['usercart.showCart']}" ajax="false" />
<p:panelGrid columns="1" id="usercart" styleClass="noborderTable" style="display: #{((userCartView.isEmpty())?'none':'block')};"> <p:panelGrid columns="1" id="usercart" styleClass="noborderTable" style="display: #{((userCartView.isEmpty())?'none':'block')};">
<p:commandButton actionListener="#{userSearchView.addToCart}" value="#{i18n['usercart.addSearchedUsers']}" ajax="false" /> <p:commandButton actionListener="#{userSearchView.addToCart}" value="#{i18n['usercart.addSearchedUsers']}" ajax="false" />
<h:panelGroup> <h:panelGroup>
...@@ -101,9 +101,9 @@ ...@@ -101,9 +101,9 @@
<p:fileDownload value="#{userCartView.userExport}" /> <p:fileDownload value="#{userCartView.userExport}" />
</p:commandButton> </p:commandButton>
<p:commandButton action="#{userCartView.showOverview()}" value="#{i18n['usercart.showoverview']}" ajax="false" /> <p:commandButton action="#{userCartView.showOverview()}" value="#{i18n['usercart.showoverview']}" ajax="false" />
<p:commandButton rendered="#{creditTransferView.transferPermissions}" action="#{userCartView.transferCredits}" value="#{i18n['usercart.transferCredits']}" ajax="false" /> <p:commandButton rendered="#{creditTransferView.transferPermissions}" action="#{userCartView.transferCredits}" value="#{i18n['usercart.transferCredits']}" ajax="false" />
</p:panelGrid> </p:panelGrid>
</p:column> </p:column>
</p:row> </p:row>
......
...@@ -136,7 +136,7 @@ public class AjaxMapView extends GenericCDIView { ...@@ -136,7 +136,7 @@ public class AjaxMapView extends GenericCDIView {
Slotcounter pm = prodmap.get(p.getProduct()); Slotcounter pm = prodmap.get(p.getProduct());
pm.increment(); pm.increment();
logger.info("got used {} for slot {} with place {}", p.getUsed(), p, p.getPlace()); logger.info("got used {} for slot {} with place {}", p.getUsed(), p, p.getPlace());
if (!p.isUsed()) { if (!p.isSlotUsed()) {
pm.incrementUnused(); pm.incrementUnused();
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!