Commit d597477d by Tuukka Kivilahti

jotain pientä, ehkä vaiktutaa johonkin, ehkä ei

1 parent 09d7c4c1
......@@ -116,7 +116,7 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
CriteriaQuery<PrintedCard> cq = cb.createQuery(PrintedCard.class);
Root<PrintedCard> root = cq.from(PrintedCard.class);
List<Predicate> preds = new ArrayList<Predicate>();
List<Predicate> preds = new ArrayList<>();
preds.add(cb.equal(root.get(PrintedCard_.event), eventbean.getCurrentEvent()));
......
......@@ -30,7 +30,6 @@
<h:form id="attachform">
<p:poll update="attachBarcode" interval="2" ignoreAutoUpdate="true" onerror="location.reload();" />
<h:panelGroup id="attachBarcode">
......@@ -41,6 +40,7 @@
</script>
<h1>#{i18n['incomingView.attachDialogTitle']}</h1>
<!-- napin painaminen aiheuttaa aina NullPOinterExceptionin, mutta tekee siitä huolimatta tarvittavat asiat -->
<!-- tarjoan oluen sille ketä ratkasee ton exceptionin -TKjne -->
<p:commandButton styleClass="attachbuttonidclass" value="#{i18n['incomingView.attach']}" actionListener="#{incomingView.attachCodeToCard}" update=":cardcodeform :placelistform :imgCropperForm :cardsetform" onerror="location.reload(true);" />
<p:commandButton value="#{i18n['incomingView.cancel']}" actionListener="#{incomingView.hideAttachDialog}" update=":attachform:attachBarcode" />
</div>
......@@ -167,7 +167,7 @@
<p:graphicImage url="/dydata/usercard/#{userView.selectedUser.user.id}.png" width="300" />
<br />
<h:commandButton action="#{incomingView.printCard}" value="#{i18n['print']}" />
<p:commandButton actionListener="#{incomingView.printCard}" update="cardsetform" value="#{i18n['print']}" />
<b>
(status: <p:outputLabel value="#{incomingView.printedStatus}" />)
<p:outputLabel value="#{i18n['incomingflow.cardfiling.label']}" rendered="#{!empty incomingView.cardFiling}" />
......
......@@ -181,12 +181,12 @@ public class IncomingView extends GenericCDIView {
FacesContext context = FacesContext.getCurrentInstance();
logger.debug(":got.code:");
// logger.debug(":got.code:");
EventUser user = event.getUser();
if (user != null) {
if (!user.equals(userview.getUser())) {
logger.info("found user {}, redirecting", user.getNick());
// logger.info("found user {}, redirecting", user.getNick());
userview.setUser(user);
// userview.prepareCardDownload();
......@@ -273,24 +273,29 @@ public class IncomingView extends GenericCDIView {
*/
public String getCardFiling() {
String ret = "";
try {
// try {
PrintedCard card = cardBean.checkPrintedCard(userview.getSelectedUser());
if (card != null) {
JsonObject cardMeta = card.getMeta();
JsonObject cardFilingObject = cardMeta.getJsonObject("card-filing");
if(cardFilingObject != null) {
ret = cardFilingObject.getString("cardplace");
}
} catch (Exception e) {
logger.warn("Could not get card filing info", e);
}
// Hmm, onkohan tää ihan tarkoituksenmukaista?
// (mergerequestin tekijä vois arvioida)
// } catch (Exception e) {
// logger.warn("Could not get card filing info", e);
// }
return ret;
}
public String printCard() {
public void printCard() {
PrintedCard card = cardBean.checkPrintedCard(userview.getUser());
card.setCardState(CardState.VALIDATED);
cardBean.saveCard(card);
return null;
}
public ListDataModel<GroupMembership> getGroupMemberships() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!