Commit 6ef8b6d5 by Antti Tonkyra

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

Conflicts:
	code/MoyaWeb/WebContent/tournaments/admin/createwizard.xhtml
2 parents 69904e1f cb5356de
......@@ -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 {}",
......
......@@ -75,7 +75,7 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation usermenu = new MenuNavigation(ev, "topnavi.usernavi", menusort = +10);
usermenu.addPage(menuitemfacade.findOrCreate("/index"), UserPermission.ANYUSER);
usermenu.addPage(menuitemfacade.findOrCreate("/frontpage"), UserPermission.ANYUSER);
usermenu.addPage(menuitemfacade.findOrCreate("/permissionDenied"), null).setVisible(false);
usermenu.addPage(menuitemfacade.findOrCreate("/auth/login"), null).setVisible(false);
usermenu.addPage(menuitemfacade.findOrCreate("/auth/loginError"), null).setVisible(false);
......@@ -89,8 +89,8 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation userEvent = usermenu.addPage(null, null);
userEvent.setKey("topnavi.userevent");
userEvent.addPage(menuitemfacade.findOrCreate("/poll/index"), PollPermission.ANSWER);
userEvent.addPage(menuitemfacade.findOrCreate("/feedback/index"), UserPermission.ANYUSER);
userEvent.addPage(menuitemfacade.findOrCreate("/user/invite"), UserPermission.ANYUSER);
userEvent.addPage(menuitemfacade.findOrCreate("/user/invite"), UserPermission.INVITE_USERS);
userEvent.addPage(menuitemfacade.findOrCreate("/feedback/index"), UserPermission.VITUTTAAKO);
MenuNavigation userkauppa = usermenu.addPage(null, null);
userkauppa.setKey("topnavi.usershop");
......@@ -221,6 +221,7 @@ public class MenuBean implements MenuBeanLocal {
lognavi.addPage(menuitemfacade.findOrCreate("/actionlog/taskview"), UserPermission.VIEW_ALL).setVisible(false);
MenuNavigation compoMenu = adminevent.addPage(null, null);
compoMenu.setKey("topnavi.compos");
compoMenu.addPage(menuitemfacade.findOrCreate("/voting/admincompolist"), CompoPermission.VIEW_COMPOS);
compoMenu.addPage(menuitemfacade.findOrCreate("/voting/create"), CompoPermission.MANAGE);
......@@ -229,8 +230,12 @@ public class MenuBean implements MenuBeanLocal {
gamenavi.setKey("topnavi.license");
gamenavi.addPage(menuitemfacade.findOrCreate("/license/manageCodes"), LicensePermission.MANAGE);
adminevent.addPage(menuitemfacade.findOrCreate("/eventorg/list"), EventPermission.MANAGE_PROPERTIES);
navifacade.create(adminmenu);
MenuNavigation shopmenu = new MenuNavigation(ev, "topnavi.shopnavi", menusort = +10);
......@@ -309,7 +314,7 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation frontTopnavi = usernavi.addPage(null, null);
frontTopnavi.setKey("topnavi.frontpage");
frontTopnavi.addPage(menuitemfacade.findOrCreate("/index"), UserPermission.ANYUSER);
frontTopnavi.addPage(menuitemfacade.findOrCreate("/frontpage"), UserPermission.ANYUSER);
frontTopnavi.addPage(menuitemfacade.findOrCreate("/user/create"), UserPermission.CREATE_NEW);
frontTopnavi.addPage(menuitemfacade.findOrCreate("/auth/sendResetMail"), UserPermission.LOGIN);
frontTopnavi.addPage(menuitemfacade.findOrCreate("/user/invite"), UserPermission.INVITE_USERS);
......@@ -343,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);
......
......@@ -3,4 +3,16 @@ package fi.codecrew.moya.enums;
public enum TournamentType {
SINGLE_ELIMINATION,
DOUBLE_ELIMINATION
;
private final String key;
private static final String I18N_HEADER = "bortalApplication.tournament.";
private TournamentType() {
key = I18N_HEADER + name();
}
public String getI18nKey() {
return key;
}
}
<!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>
......
......@@ -77,20 +77,19 @@
<br />
<h:selectOneMenu value="#{tournamentCreateView.tournament.tournamentType}">
<f:selectItems value="#{tournamentCreateView.tournamentTypes}" var="val" itemLabel="#{val}" />
<f:selectItems value="#{tournamentCreateView.tournamentTypes}" var="val" itemLabel="#{i18n[val.i18nKey]}" />
</h:selectOneMenu>
<br />
<h:outputText value="#{i18n['tournaments.max_participants']}" />
<h:outputText value="#{i18n['tournaments.players_per_match']}" />
<h:panelGrid columns="1" style="margin-bottom:10px">
<p:inputText id="maxParticipantsSlider" value="#{tournamentCreateView.tournament.maxParticipants}" />
<p:slider for="maxParticipantsSlider" />
<p:inputText id="maxPartSlider" value="#{tournamentCreateView.tournament.maxParticipants}" />
<p:slider for="maxPartSlider" />
</h:panelGrid>
<h:outputText value="#{i18n['tournaments.players_per_match']}" />
<h:panelGrid columns="1" style="margin-bottom:10px">
<p:inputText id="playerSlider" value="#{tournamentCreateView.tournament.playersPerMatch}" />
<p:inputText id="playerSlider" value="#{tournamentCreateView.tournament.playersPerMatch}" />
<p:slider for="playerSlider" />
</h:panelGrid>
......
......@@ -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">
......
......@@ -76,8 +76,6 @@
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
......
......@@ -81,6 +81,8 @@ 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.DOUBLE_ELIMINATION = Double elimination
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
......@@ -226,8 +228,8 @@ subnavi.cards = \u0009\u0009
topnavi.license = Lisenssikoodit
user.cropImage = Crop
user.unauthenticated = Kirjautumaton
user.cropImage = Crop
user.unauthenticated = Kirjautumaton
usercart.downloadCsv = CSV
usercart.showoverview = Vie tarkastusn\u00E4kym\u00E4\u00E4n
usercart.downloadCsv = CSV
usercart.showoverview = Vie tarkastusn\u00E4kym\u00E4\u00E4n
......@@ -540,9 +540,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
......@@ -875,7 +876,7 @@ submenu.bill.billSummary = Bill summary
submenu.bill.list = My bills
submenu.bill.listAll = All bills
submenu.eventorg.list = Manage Event
submenu.feedback.index = Feedback
submenu.feedback.index = U Mad?!
submenu.foodadmin.createTemplate = Create foodwave template
submenu.foodadmin.listTemplates = List foodwave templates
submenu.foodmanager.listFoodwaves = List active foodwaves
......@@ -927,6 +928,7 @@ submenu.useradmin.listCardTemplates = Card templates
submenu.useradmin.sendPicture = Send a picture
submenu.useradmin.showTakePicture = Show webcam
submenu.useradmin.validateUser = Validate user
submenu.voting.admincompolist = Compos
submenu.voting.compolist = Compos
submenu.voting.create = Create new compo
submenu.voting.myEntries = My entries
......@@ -982,6 +984,7 @@ topnavi.usermgmt = Users
topnavi.userplaces = Computer Places
topnavi.usershop = Shop
tournament.admin.create = Create new tournament
tournament.create = Create tournament
tournament.edit = Edit tournament
tournament.game = Game
......@@ -993,10 +996,12 @@ tournament.type = Type
tournaments.active_tournaments = Active tournaments
tournaments.admin.begin_time_constraints = Tournament begin time
tournaments.admin.create = Create tournament
tournaments.admin.create_a_game = Create a game
tournaments.admin.create_new_ruleset = Create a new ruleset
tournaments.admin.create_tournament = Create a tournament
tournaments.admin.description = Manage tournaments
tournaments.admin.edit = Edit tournament
tournaments.admin.game_description = Game description
tournaments.admin.game_name = Game name
tournaments.admin.registration_time_constraints = Registration time constraints
......@@ -1005,10 +1010,16 @@ tournaments.admin.select_a_game = Select a game
tournaments.admin.select_a_ruleset = Select a ruleset
tournaments.admin.set_time_constraints = Set time constraints
tournaments.admin.title = Tournaments management
tournaments.backup_players = Max backup players
tournaments.players_per_match = Max players per match
tournaments.registration_closes = Set registration closing time
tournaments.registration_opens = Set registration opening time
tournaments.ruleset_description = Ruleset description
tournaments.ruleset_name = Ruleset name
tournaments.ruleset_rules = Tournament ruleset
tournaments.tournament_details = Tournament details
tournaments.tournament_name = Tournament name
tournaments.tournament_type = Tournament type
user.accountBalance = Account balance
user.accountEventHeader = Account events
......
......@@ -549,9 +549,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
......@@ -856,7 +857,7 @@ submenu.bill.billSummary = Laskujen yhteenveto
submenu.bill.list = N\u00E4yt\u00E4 omat laskut
submenu.bill.listAll = Kaikki laskut
submenu.eventorg.list = Organisaation hallinta
submenu.feedback.index = Palaute
submenu.feedback.index = Vituttaako?
submenu.foodadmin.createTemplate = Luo tilauspohja
submenu.foodadmin.listTemplates = Muokkaa tilauspohjia
submenu.foodmanager.listFoodwaves = Aktiiviset ruokatilaukset
......@@ -910,6 +911,7 @@ submenu.useradmin.listCardTemplates = Listaa korttipohjat
submenu.useradmin.sendPicture = L\u00E4het\u00E4 kuva
submenu.useradmin.showTakePicture = N\u00E4yt\u00E4 webcam
submenu.useradmin.validateUser = Validoi k\u00E4ytt\u00E4j\u00E4
submenu.voting.admincompolist = Kilpailut
submenu.voting.compolist = Kilpailut
submenu.voting.create = Uusi kilpailu
submenu.voting.myEntries = Omat entryt
......@@ -965,6 +967,7 @@ topnavi.usermgmt = K\u00E4ytt\u00E4j\u00E4t
topnavi.userplaces = Konepaikat
topnavi.usershop = Kauppa
tournament.admin.create = Luo uusi turnaus
tournament.create = Luo turnaus
tournament.edit = Muokkaa turnausta
tournament.game = Peli
......@@ -976,10 +979,12 @@ tournament.type = Tyyppi
tournaments.active_tournaments = Aktiiviset turnaukset
tournaments.admin.begin_time_constraints = Turnauksen aloitusaika
tournaments.admin.create = Luo turnaus
tournaments.admin.create_a_game = Luo peli
tournaments.admin.create_new_ruleset = Luo uusi s\u00E4\u00E4nn\u00F6st\u00F6
tournaments.admin.create_tournament = Luo turnaus
tournaments.admin.description = Hallinnoi turnauksia
tournaments.admin.edit = Muokkaa turnausta
tournaments.admin.game_description = Pelin kuvaus
tournaments.admin.game_name = Pelin nimi
tournaments.admin.registration_time_constraints = Rekister\u00F6itymisaika
......@@ -988,10 +993,16 @@ tournaments.admin.select_a_game = Valitse peli
tournaments.admin.select_a_ruleset = Valitse s\u00E4\u00E4nn\u00F6st\u00F6
tournaments.admin.set_time_constraints = Aseta aikarajat
tournaments.admin.title = Turnauksien hallinnointi
tournaments.backup_players = Maksimim\u00E4\u00E4r\u00E4 varapelaajia
tournaments.players_per_match = Maksimim\u00E4\u00E4r\u00E4 pelaajia matchissa
tournaments.registration_closes = Rekister\u00F6itymisen sulkeutumisaika
tournaments.registration_opens = Rekister\u00F6itymisen aukeamisaika
tournaments.ruleset_description = S\u00E4\u00E4nn\u00F6st\u00F6n kuvaus
tournaments.ruleset_name = S\u00E4\u00E4nn\u00F6st\u00F6n nimi
tournaments.ruleset_rules = Turnauksen s\u00E4\u00E4nn\u00F6t
tournaments.tournament_details = Turnauksen yksityiskohdat
tournaments.tournament_name = Turnauksen nimi
tournaments.tournament_type = Turnauksen tyyppi
user.accountBalance = Tilin saldo
user.accountEventHeader = Tilitapahtumat
......@@ -1120,7 +1131,7 @@ voting.allcompos.submitEntry = L\u00E4het\u00E4 entry
voting.allcompos.submitStart = Lis\u00E4ys auki
voting.allcompos.voteEnd = \u00C4\u00E4nestys kiinni
voting.allcompos.voteStart = \u00C4\u00E4nestys auki
voting.compo.submit = L\u00E4het\u00E4 kappale
voting.compo.submit = L\u00E4het\u00E4 teos
voting.compo.vote = \u00C4\u00E4nest\u00E4
voting.compoentryadd.button = L\u00E4het\u00E4
voting.compoentryadd.description = Ilmoittaudu kilpailuun:
......
......@@ -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());
}
......
......@@ -53,8 +53,10 @@ public class AuthView extends GenericCDIView {
logger.warn("Error executing logout", e);
}
}
req.getSession().invalidate();
req.getSession().invalidate();
navihandler.forward("/index");
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!