Commit 807d5b31 by Antti Tonkyra

Merge branch 'devel' of codecrew.fi:bortal into devel

2 parents 79149978 51984c35
......@@ -14,16 +14,35 @@
<h1>#{i18n['user.edit.title']}</h1>
</ui:define>
<ui:define name="content">
<h:form>
<h:outputText value="#{userCartView.current+1}" /> / <h:outputText value="#{userCartView.userCartSize}" />
<h:commandButton action="#{userCartView.prev()}" value="#{i18n['usercart.prev']}" rendered="#{userCartView.current > 0}" />
<h:commandButton action="#{userCartView.removeCurrent()}" value="#{i18n['usercart.removeCurrent']}" />
<h:commandButton action="#{userCartView.next()}" value="#{i18n['usercart.next']}" rendered="#{userCartView.userCartSize > (userCartView.current+1)}" /></h:form>
<h:commandButton action="#{userCartView.next()}" value="#{i18n['usercart.next']}" rendered="#{userCartView.userCartSize > (userCartView.current+1)}" />
<h:link outcome="/card/massprint" value="Mass Print">
<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
</h:link>
</h:form>
<ui:fragment rendered="#{userView.hasPrintedCard}">
<h2>Card</h2>
<h:form>
<p:panelGrid columns="2">
<h:outputText value="#{i18n[card.name]}" />
<h:outputText value="#{userView.printedCard.template.name}" />
<h:selectOneMenu value="#{userView.printedCard.cardState}">
<f:selectItems value="#{userView.printedCardStates}" />
</h:selectOneMenu>
<h:commandButton action="#{userView.setCardState()}" value="#{i18n['printedCard.setState']}" />
</p:panelGrid>
</h:form>
</ui:fragment>
<h:link outcome="/card/massprint" value="Mass Print">
<f:param name="cid" value="#{javax.enterprise.context.conversation.id}" />
</h:link>
<p>
......@@ -46,11 +65,11 @@
</div>
<h:commandButton action="#{userView.saveRoles}" value="#{i18n['user.saveRoles']}" />
</h:form>
<h:form>
<p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.7317073170731707" image="/dydata/userimage/#{userView.user.currentImage.id}.jpg" />
<h:commandButton action="#{userView.crop}" value="#{i18n['user.cropImage']}" />
</h:form>
<h:form>
<p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.7317073170731707" image="/dydata/userimage/#{userView.user.currentImage.id}.jpg" />
<h:commandButton action="#{userView.crop}" value="#{i18n['user.cropImage']}" />
</h:form>
</ui:define>
</ui:composition>
</h:body>
......
......@@ -2,12 +2,11 @@ package fi.codecrew.moya.rest.pojo;
import java.util.List;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class CardRoot {
@XmlElementWrapper(name = "cards")
//@XmlElementWrapper(name = "cards")
private List<PrintedCardRestPojo> cards;
public List<PrintedCardRestPojo> getCards() {
......
......@@ -2,27 +2,26 @@ package fi.codecrew.moya.rest.pojo;
import java.util.List;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class ReaderEventRestRoot {
@XmlElementWrapper(name = "readerEvents")
private List<ReaderEventRestPojo> readers;
// @XmlElementWrapper(name = "readerEvents")
private List<ReaderEventRestPojo> readerEvents;
public ReaderEventRestRoot() {
}
public ReaderEventRestRoot(List<ReaderEventRestPojo> parsed) {
readers = parsed;
setReaderEvents(parsed);
}
public List<ReaderEventRestPojo> getReaders() {
return readers;
public List<ReaderEventRestPojo> getReaderEvents() {
return readerEvents;
}
public void setReaders(List<ReaderEventRestPojo> readers) {
this.readers = readers;
public void setReaderEvents(List<ReaderEventRestPojo> readerEvents) {
this.readerEvents = readerEvents;
}
}
......@@ -2,12 +2,11 @@ package fi.codecrew.moya.rest.pojo;
import java.util.List;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class ReaderRestRoot {
@XmlElementWrapper(name = "readers")
//@XmlElementWrapper(name = "readers")
private List<ReaderRestPojo> readers;
public ReaderRestRoot() {
......
......@@ -33,7 +33,7 @@ public class UserCartView extends GenericCDIView {
@Inject
private UserView userview;
@Inject
private UserOverviewView userOverviewView;
......@@ -124,7 +124,7 @@ public class UserCartView extends GenericCDIView {
userOverviewView.initView();
return "/useradmin/overview";
}
public String saveUser() {
userview.saveUser();
return null;
......@@ -142,6 +142,7 @@ public class UserCartView extends GenericCDIView {
if (u != null) {
userview.setUserid(u.getUser().getId());
userview.setUser(null);
userview.setPrintedCard(null);
userview.initView();
}
}
......
......@@ -264,7 +264,7 @@ public class UserView extends GenericCDIView {
if (user != null && userid != null && !user.getId().equals(userid)) {
user = null;
}
printedCard = null;
if (super.requirePermissions(UserPermission.VIEW_SELF) && user == null) {
getSelectedUser();
canSave = getCurrentUser().equals(user) || permbean.hasPermission(UserPermission.MODIFY);
......@@ -325,6 +325,11 @@ public class UserView extends GenericCDIView {
return permbean.isCurrentUser(user);
}
public boolean isHasPrintedCard()
{
return getPrintedCard() != null;
}
public String setCardState()
{
printedCard = cardBean.saveCard(printedCard);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!