Commit 7691f07c by Petri Jarvisalo

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

2 parents b53d3472 1248fc3c
......@@ -234,6 +234,9 @@ public class CardPrintBean implements CardPrintBeanLocal {
@Override
public byte[] constructPNG(PrintedCard card) throws Exception {
if (card == null) {
return null;
}
card = printedCardFacade.reload(card);
// logger.info("Printing card tpl {} with template image {}",
......
......@@ -234,7 +234,7 @@ public class MenuBean implements MenuBeanLocal {
adminevent.addPage(menuitemfacade.findOrCreate("/eventorg/list"), EventPermission.MANAGE_PROPERTIES);
adminevent.addPage(menuitemfacade.findOrCreate("/feedback/index"), UserPermission.VITUTTAAKO);
navifacade.create(adminmenu);
......@@ -348,7 +348,7 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation shopTopmenu = usernavi.addPage(null, null);
shopTopmenu.setKey("topnavi.shop");
shopTopmenu.addPage(menuitemfacade.findOrCreate("/shop/createBill"), BillPermission.CREATE_BILL);
shopTopmenu.addPage(menuitemfacade.findOrCreate("/shop/createBill"), ShopPermission.SHOP_PRODUCTS);
shopTopmenu.addPage(menuitemfacade.findOrCreate("/bill/list"), BillPermission.VIEW_OWN);
shopTopmenu.addPage(menuitemfacade.findOrCreate("/bill/edit"), null).setVisible(false);
shopTopmenu.addPage(menuitemfacade.findOrCreate("/bill/showBill"), null).setVisible(false);
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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:f="http://java.sun.com/jsf/core">
<h:head>
<meta http-equiv="refresh" content="1;url=frontpage.jsf" />
<meta http-equiv="refresh" content="1;url=#{request.contextPath}/frontpage.jsf" />
<script type="text/javascript">
window.location.href = "frontpage.jsf"
window.location.href = "#{request.contextPath}/frontpage.jsf"
</script>
<title></title>
</h:head>
<h:body>
Redirecting to <a href="frontpage.jsf">Frontpage</a>
Redirecting to <a href="#{request.contextPath}/frontpage.jsf">Frontpage</a>
</h:body>
</html>
\ No newline at end of file
......@@ -18,7 +18,7 @@
<f:event type="preRenderView" listener="#{orgRoleView.permissionList()}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['foodwave.template.edit.title']}</h1>
<h1>#{i18n['orgrole.list.title']}</h1>
</ui:define>
<ui:define name="content">
<orgrole:list />
......
......@@ -87,7 +87,8 @@
</div>
<ui:insert name="title" />
<p:messages severity="info" />
<h:messages />
<ui:insert name="edittab" />
<!-- <h:messages /> -->
<ui:repeat var="cont1" value="#{menuView.getPagecontent('top')}">
<h:outputText value="#{cont1.content}" escape="false" />
</ui:repeat>
......
......@@ -13,6 +13,9 @@
<ui:define name="title">
<h1>#{i18n['user.edit.title']}</h1>
<!-- <users:usertabs tabId="edit" /> -->
</ui:define>
<ui:define name="edittab">
<users:usertabs tabId="edit" />
</ui:define>
<ui:define name="content">
......
......@@ -81,6 +81,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
bortalApplication.terminal.CASHIER = Access cashier terminal functions
bortalApplication.terminal.CUSTOMER = Access client terminal functions
bortalApplication.terminal.SELFHELP = Self help terminal
bortalApplication.tournament.SINGLE_ELIMINATION = Single Elimination
bortalApplication.user = User permissions
bortalApplication.user.ANYUSER = All users have this anyways
bortalApplication.user.CREATE_NEW = Create new user
......
......@@ -159,6 +159,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
bortalApplication.terminal.CASHIER = Access cashier terminal functions
bortalApplication.terminal.CUSTOMER = Access client terminal functions
bortalApplication.terminal.SELFHELP = Self help terminal
bortalApplication.tournament.SINGLE_ELIMINATION = Single Elimination
bortalApplication.user = User permissions
bortalApplication.user.ANYUSER = All users have this anyways
bortalApplication.user.CREATE_NEW = Create new user
......@@ -540,9 +541,10 @@ org.hibernate.validator.constraints.Length.message = length must be between {m
org.hibernate.validator.constraints.NotEmpty.message = may not be empty
org.hibernate.validator.constraints.Range.message = must be between {min} and {max}
orgrole.create = Create
orgrole.name = Name
orgrole.parents = Parent
orgrole.create = Create
orgrole.list.title = Organization role list
orgrole.name = Name
orgrole.parents = Parent
page.account.edit.header = Edit account events
page.account.list.header = Account events
......
......@@ -160,6 +160,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Saa ostaa tuotteita muille
bortalApplication.terminal.CASHIER = Muokata rahastusp\u00E4\u00E4tteiden toimintoja
bortalApplication.terminal.CUSTOMER = Muokata k\u00E4vij\u00E4p\u00E4\u00E4tteiden toimintoja
bortalApplication.terminal.SELFHELP = Itsepalvelup\u00E4\u00E4te
bortalApplication.tournament.SINGLE_ELIMINATION = Single Elimination
bortalApplication.user = K\u00E4ytt\u00E4j\u00E4oikeudet
bortalApplication.user.ANYUSER = AINA kaikilla k\u00E4ytt\u00E4jill\u00E4
bortalApplication.user.CREATE_NEW = Voi luoda uuden k\u00E4ytt\u00E4j\u00E4n
......@@ -549,9 +550,10 @@ org.hibernate.validator.constraints.Length.message = length must be between {m
org.hibernate.validator.constraints.NotEmpty.message = may not be empty
org.hibernate.validator.constraints.Range.message = must be between {min} and {max}
orgrole.create = Luo
orgrole.name = Nimi
orgrole.parents = Periytyy
orgrole.create = Luo
orgrole.list.title = Lista organisaation rooleista
orgrole.name = Nimi
orgrole.parents = Periytyy
page.account.edit.header = Muokkaa tilitapahtumia
page.account.list.header = Tilitapahtumat
......
......@@ -44,13 +44,12 @@ public class FileDownloadServlet extends GenericImageServlet {
@EJB
private transient UserBeanLocal userbean;
@EJB
private transient CardTemplateBeanLocal cardbean;
@EJB
private transient CardPrintBeanLocal cardprint;
@EJB
private transient PermissionBeanLocal permbean;
......@@ -61,19 +60,13 @@ public class FileDownloadServlet extends GenericImageServlet {
private static final Logger logger = LoggerFactory.getLogger(FileDownloadServlet.class);
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
private static final Pattern URLPATTERN = Pattern.compile("([^./]+)");
/**
* Usage MoyaWeb/dydata/format/
* possible formats
* logo
* userimage/<eventuserid>.jpg
* cardtemplate/<cardtemplateid>.png
* usercard/
* Usage MoyaWeb/dydata/format/ possible formats logo userimage/<eventuserid>.jpg cardtemplate/<cardtemplateid>.png usercard/
*/
@Override
protected ImageMover getImagedata() {
......@@ -135,28 +128,25 @@ public class FileDownloadServlet extends GenericImageServlet {
}
}
}else if (urlparts.get(0).equals("usercard") && urlparts.size() > 2)
} else if (urlparts.get(0).equals("usercard") && urlparts.size() > 2)
{
int userid = Integer.parseInt(urlparts.get(1));
EventUser usr = userbean.findByUserId(userid);
logger.info("Trying to print usercard for user {}", usr);
if (usr != null) {
PrintedCard card = cardbean.checkPrintedCard(usr);
try {
byte[] img = cardprint.constructPNG(card);
if (img.length > 0)
{
if (img != null && img.length > 0) {
ret.setData(img);
ret.setImagetype("image/png");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.warn("Error generating image", e);
}
}
}
if (ret.getImagetype() == null) {
......
package fi.codecrew.moya.web.cdiview.organisation;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -136,6 +137,23 @@ public class EventPropertyView extends GenericCDIView {
if (property.getKey().isData() && file != null)
{
logger.info("saving data values type: {}, length {}", file.getContentType(), file.getSize());
byte[] contents = null;
if (file.getContents() != null) {
contents = file.getContents();
} else {
contents = new byte[(int) file.getSize()];
try {
file.getInputstream().read(contents);
} catch (IOException e) {
logger.warn("Error reading file from stream", e);
contents = null;
}
}
if (contents == null) {
super.addFaceMessage("eventProperty.errorUploadingFile");
return null;
}
property.setByteValue(file.getContents());
property.setByteMime(file.getContentType());
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!