Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 107fc909
authored
Jun 04, 2014
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vectoinfoa lissää, hiukan siistimistä ja yks currentuser vs selecteduser -bugi
1 parent
2210a671
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
36 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardTemplateBean.java
code/MoyaWeb/WebContent/info/incoming.xhtml
code/MoyaWeb/WebContent/resources/cditools/reader/backendReader.xhtml
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserView.java
code/MoyaWeb/src/fi/codecrew/moya/web/flow/IncomingView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardTemplateBean.java
View file @
107fc90
...
...
@@ -359,13 +359,16 @@ public class CardTemplateBean implements CardTemplateBeanLocal {
PrintedCard
card
=
checkPrintedCard
(
user
);
if
(
card
.
getCardState
()
!=
CardState
.
DELIVERED
)
{
card
.
setCardState
(
CardState
.
DELIVERED
);
card
=
printedcardfacade
.
merge
(
card
);
}
else
{
logger
.
info
(
"Not marking card to delivered: "
+
card
.
getCardState
()
+
" : "
+
card
.
getId
());
}
if
(
markUserPlacesDelivered
)
{
for
(
GroupMembership
membership
:
gmFacade
.
findMemberships
(
user
))
{
membership
.
setEnteredEvent
(
Calendar
.
getInstance
());
membership
=
gmFacade
.
merge
(
membership
);
...
...
code/MoyaWeb/WebContent/info/incoming.xhtml
View file @
107fc90
...
...
@@ -12,24 +12,7 @@
</f:metadata>
<ui:define
name=
"content"
>
<!--
<h1>#{i18n['incomingflow.search']}</h1>
<h:form>
<h:panelGrid columns="2" >
<h:outputText value="#{i18n['incomingflow.multisearch']}" />
<h:outputText value="#{i18n['incomingflow.barcode']}" />
<p:autoComplete id="acsb" value="#{incomingView.searchMulti}" completeMethod="#{incomingView.matchMulti}" converter="#{eventUserConverter}" var="usrx" itemLabel="#{usrx.shortUserDescriptor}" itemValue="#{usrx}">
<p:ajax event="itemSelect" listener="#{incomingView.changeUser}" />
</p:autoComplete>
<p:autoComplete id="acs" value="#{incomingView.searchBarcode}" completeMethod="#{incomingView.matchBarcode}">
<p:ajax event="itemSelect" listener="#{incomingView.changeUser}" />
</p:autoComplete>
</h:panelGrid>
</h:form>
yhtäsuurimerkit -->
...
...
@@ -56,17 +39,31 @@
</h:form>
<!-- infoviilausta, kauppa infoon -->
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
target=
"head"
/>
<h1>
#{i18n['incomingflow.userdetails']}
</h1>
<br
/>
<br
/>
<h1>
<p:outputLabel
value=
"#{userView.selectedUser.firstnames}"
/>
(
<p:outputLabel
value=
"#{userView.selectedUser.nick}"
/>
)
<p:outputLabel
value=
"#{userView.selectedUser.lastname}"
/>
</h1>
<br
/>
<h:panelGrid
id=
"cropper"
columns=
"
3
"
>
<h:panelGrid
id=
"cropper"
columns=
"
2
"
>
<h:panelGroup>
<p:fieldset
legend=
"#{i18n['incomingflow.usereditor']}"
toggleable=
"true"
>
<user:edit
id=
"usereditor"
commitaction=
"#{incomingView.saveUser()}"
commitvalue=
"#{i18n['user.save']}"
camAlwaysOn=
"true"
photocamupdate=
"@all"
/>
</p:fieldset>
</h:panelGroup>
<h:panelGroup>
<p:fieldset
legend=
"#{i18n['incomingflow.printedCard']}"
toggleable=
"true"
>
<h:panelGrid
columns=
"2"
>
<h:panelGroup>
<h:form
id=
"imgCropperForm"
rendered=
"#{!empty userView.selectedUser.currentImage}"
>
<p:commandButton
value=
"#{i18n['user.imageCropRefresh']}"
ajax=
"false"
update=
"imgCropperForm"
/>
<h:outputLabel
value=
"#{i18n['user.cropUserImage']}:"
/>
...
...
@@ -79,13 +76,12 @@
<h:form>
<p:graphicImage
url=
"/dydata/usercard/#{userView.selectedUser.user.id}.png"
width=
"300"
/>
<br
/>
<h:commandButton
action=
"#{incomingView.printCard}"
value=
"#{i18n['print']}"
/>
(status: #{incomingView.printedStatus}
)
<h:commandButton
action=
"#{incomingView.printCard}"
value=
"#{i18n['print']}"
/>
(status:
<p:outputLabel
value=
"#{incomingView.printedStatus}"
/>
)
</h:form>
</h:panelGroup>
</h:panelGrid>
</p:fieldset>
</h:panelGroup>
</h:panelGrid>
<h:outputText
rendered=
"#{empty incomingView.groupMemberships}"
value=
"#{i18n['placegroupview.noMemberships']}"
/>
...
...
code/MoyaWeb/WebContent/resources/cditools/reader/backendReader.xhtml
View file @
107fc90
...
...
@@ -49,7 +49,7 @@ xmlns:reader="http://java.sun.com/jsf/composite/cditools/reader"
</p:dataTable>
<p:outputLabel
value=
"#{i18n['reader.autopoll']}"
/>
<p:outputLabel
value=
"#{i18n['reader.autopoll']}"
/>
<p:selectBooleanButton
offLabel=
"#{i18n['off']}"
onLabel=
"#{i18n['on']}"
value=
"#{readerView.pollingMode}"
immediate=
"true"
>
<p:ajax
update=
"reader_autopoll,readerevents"
/>
</p:selectBooleanButton>
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
View file @
107fc90
...
...
@@ -167,6 +167,8 @@ incomingflow.codeattached.title = Koodi liittetty
incomingflow.giveplace
=
Merkitse annetuksi
incomingflow.invalidbarcode.message
=
Viivakoodilla ei l
\u
00F6ytynyt mit
\u
00E4
\u
00E4n
incomingflow.invalidbarcode.title
=
virheellinen koodi
incomingflow.printedCard
=
Kortti
incomingflow.usereditor
=
K
\u
00E4ytt
\u
00E4j
\u
00E4
lanEventPrivateProperty.defaultValue
=
Default value
lanEventPrivateProperty.editProperty
=
Edit property
...
...
@@ -196,6 +198,10 @@ navi.auth.login = frontpage
navi.auth.loginerror
=
frontpage
navi.auth.logout
=
frontpage
off
=
Pois
on
=
P
\u
00E4
\u
00E4ll
\u
00E4
page.bill.billSummary.header
=
Summary of bills
page.bill.edit.header
=
Edit bill
page.bill.list.header
=
Bills
...
...
@@ -230,6 +236,8 @@ productshop.minusTen = -10
productshop.plusOne
=
+1
productshop.plusTen
=
+10
reader.autopoll
=
Jatkuva lukijan seuraaminen
registerleaflet.title
=
Rekisteriseloste
resetMail.header
=
Reset lost password
...
...
@@ -242,8 +250,9 @@ submenu.NotImplementedYet = Not implemented
submenu.admin.adduser
=
K
\u
00E4ytt
\u
00E4j
\u
00E4nlis
\u
00E4ys
submenu.admin.adduser.index
=
K
\u
00E4ytt
\u
00E4j
\u
00E4nlis
\u
00E4ys
submenu.frontpage
=
Frontpage
submenu.info.incoming
=
Incomingview
submenu.info.incoming
=
Sis
\u
00E4
\u
00E4ntulo
submenu.info.index
=
Infon
\u
00E4kym
\u
00E4
submenu.info.shop
=
Kauppa
subnavi.cards
=
\u0009\u0009
subnavi.info
=
Info
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
107fc90
...
...
@@ -472,9 +472,11 @@ incomingflow.giveplace = Mark given
incomingflow.invalidbarcode.message
=
Nothing found with barcode, you can now add it to the user
incomingflow.invalidbarcode.title
=
Invalid code
incomingflow.multisearch
=
Multisearch
incomingflow.printedCard
=
Card
incomingflow.search
=
Search
incomingflow.ungiveplace
=
Mark not given
incomingflow.userdetails
=
User details
incomingflow.usereditor
=
User
infoview.back
=
Back
infoview.computerplace
=
Computer places
...
...
@@ -630,6 +632,10 @@ newsgroup.writerRole = Writer roles
newslist.header
=
Newsgroups
off
=
Off
on
=
On
org.hibernate.validator.constraints.Email.message
=
not a well-formed email address
org.hibernate.validator.constraints.Length.message
=
length must be between {min} and {max}
org.hibernate.validator.constraints.NotEmpty.message
=
may not be empty
...
...
@@ -857,6 +863,7 @@ productshop.total = Total
reader.assocToCard
=
Associate to card
reader.automaticProduct
=
Default product
reader.automaticProductCount
=
Amount
reader.autopoll
=
Reader autopoll
reader.create
=
Create reader
reader.createNewCard
=
Create new card
reader.description
=
Description
...
...
@@ -1026,8 +1033,9 @@ submenu.foodmanager.listFoodwaves = List active foodwaves
submenu.foodwave.list
=
Foodwaves
submenu.foodwave.listTemplates
=
Food provides
submenu.index
=
Frontpage
submenu.info.incoming
=
Sis
\u
00E4
\u
00E4ntulo
submenu.info.incoming
=
Incomingview
submenu.info.index
=
Infoview
submenu.info.shop
=
Shop
submenu.license.manageCodes
=
Manage codes
submenu.license.viewCodes
=
View codes
submenu.map.create
=
Create map
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
107fc90
...
...
@@ -480,9 +480,11 @@ incomingflow.giveplace = Merkitse annetuksi
incomingflow.invalidbarcode.message
=
Piipatulla koodilla ei l
\u
00F6ytynyt mit
\u
00E4
\u
00E4n, voit lis
\u
00E4t
\u
00E4 koodin k
\u
00E4ytt
\u
00E4j
\u
00E4
\u
00E4n
incomingflow.invalidbarcode.title
=
Virheellinen koodi
incomingflow.multisearch
=
Monihaku
incomingflow.printedCard
=
Kortti
incomingflow.search
=
Etsi
incomingflow.ungiveplace
=
Ei olekkaan annettu
incomingflow.userdetails
=
K
\u
00E4ytt
\u
00E4j
\u
00E4n tiedot
incomingflow.usereditor
=
K
\u
00E4ytt
\u
00E4j
\u
00E4
index.title
=
Etusivu
...
...
@@ -639,6 +641,10 @@ newsgroup.writerRole = Kirjoittajaryhm\u00E4
newslist.header
=
Uutisryhm
\u
00E4t
off
=
Pois
on
=
P
\u
00E4
\u
00E4ll
\u
00E4
org.hibernate.validator.constraints.Email.message
=
V
\u
00E4
\u
00E4rin muotoiltu s
\u
00E4hk
\u
00F6postiosoite
org.hibernate.validator.constraints.Length.message
=
length must be between {min} and {max}
org.hibernate.validator.constraints.NotEmpty.message
=
may not be empty
...
...
@@ -842,6 +848,7 @@ productshop.total = Yhteens\u00E4
reader.assocToCard
=
Yhdist
\u
00E4 korttiin
reader.automaticProduct
=
Oletustuote
reader.automaticProductCount
=
M
\u
00E4
\u
00E4r
\u
00E4
reader.autopoll
=
Jatkuva lukijan seuraaminen
reader.create
=
Luo lukija
reader.createNewCard
=
Luo uusi kortti
reader.description
=
Kuvaus
...
...
@@ -1006,8 +1013,9 @@ submenu.foodmanager.listFoodwaves = Aktiiviset ruokatilaukset
submenu.foodwave.list
=
Ruokatilaukset
submenu.frontpage
=
Etusivu
submenu.index
=
Etusivu
submenu.info.incoming
=
Incomingview
submenu.info.incoming
=
Sis
\u
00E4
\u
00E4ntulo
submenu.info.index
=
Infon
\u
00E4kym
\u
00E4
submenu.info.shop
=
Kauppa
submenu.license.manageCodes
=
Hallinnoi lisenssej
\u
00E4
submenu.license.viewCodes
=
N
\u
00E4yt
\u
00E4 koodit
submenu.map.create
=
Uusi kartta
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserView.java
View file @
107fc90
...
...
@@ -122,6 +122,11 @@ public class UserView extends GenericCDIView {
printedCard
=
card
;
}
/**
* This is the user that is currently logged in.
* @return
*/
@Produces
@LoggedIn
public
EventUser
getCurrentUser
()
{
...
...
@@ -149,6 +154,11 @@ public class UserView extends GenericCDIView {
}
/**
* This is the user we are currently editing, if that is not found we user current user
* @return
*/
@Produces
@SelectedUser
public
EventUser
getSelectedUser
()
{
...
...
@@ -403,6 +413,11 @@ public class UserView extends GenericCDIView {
this
.
user
=
user
;
}
/**
* This is user what is currently on "user" -variable, you should almost newer use this.
* Use getCurrentUser() -instead.
* @return
*/
public
EventUser
getUser
()
{
return
user
;
}
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/flow/IncomingView.java
View file @
107fc90
...
...
@@ -176,14 +176,17 @@ public class IncomingView extends GenericCDIView {
public
void
attachCodeToCard
()
{
if
(
eventToAttach
==
null
)
{
throw
new
RuntimeException
(
"mitä kettua?"
)
;
return
;
}
cardBean
.
giveCard
(
userview
.
getCurrentUser
(),
autoGivePlaces
);
cardBean
.
giveCard
(
userview
.
getSelectedUser
(),
autoGivePlaces
);
userview
.
attachCodeToCard
(
eventToAttach
);
eventToAttach
=
null
;
showAttachDialog
=
false
;
userview
.
setUser
(
null
);
// refresh user
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
new
FacesMessage
(
I18n
.
get
(
"incomingflow.codeattached.title"
),
I18n
.
get
(
"incomingflow.codeattached.message"
)));
}
...
...
@@ -214,7 +217,7 @@ public class IncomingView extends GenericCDIView {
*/
public
CardState
getPrintedStatus
()
{
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getUser
());
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
get
Selected
User
());
CardState
ret
=
null
;
if
(
card
!=
null
)
{
ret
=
card
.
getCardState
();
...
...
@@ -230,8 +233,7 @@ public class IncomingView extends GenericCDIView {
}
public
ListDataModel
<
GroupMembership
>
getGroupMemberships
()
{
memberlist
=
new
ListDataModel
<
GroupMembership
>(
placegroupBean
.
getMembershipsAndCreations
(
userview
.
getUser
()));
memberlist
=
new
ListDataModel
<
GroupMembership
>(
placegroupBean
.
getMembershipsAndCreations
(
userview
.
getSelectedUser
()));
return
memberlist
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment