Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 b54117be
authored
Oct 22, 2014
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show card filing info in incoming view
1 parent
7792a8c8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
19 deletions
code/moya-web/WebContent/info/incoming.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/resources/i18n.properties
code/moya-web/src/main/java/fi/codecrew/moya/resources/i18n_en.properties
code/moya-web/src/main/java/fi/codecrew/moya/resources/i18n_fi.properties
code/moya-web/src/main/java/fi/codecrew/moya/web/flow/IncomingView.java
code/moya-web/WebContent/info/incoming.xhtml
View file @
b54117b
...
...
@@ -166,8 +166,12 @@
<p:graphicImage
url=
"/dydata/usercard/#{userView.selectedUser.user.id}.png"
width=
"300"
/>
<br
/>
<h:commandButton
action=
"#{incomingView.printCard}"
value=
"#{i18n['print']}"
/>
(status:
<p:outputLabel
value=
"#{incomingView.printedStatus}"
/>
)
<h:commandButton
action=
"#{incomingView.printCard}"
value=
"#{i18n['print']}"
/>
<b>
(status:
<p:outputLabel
value=
"#{incomingView.printedStatus}"
/>
)
<p:outputLabel
value=
"#{i18n['incomingflow.cardfiling.label']}"
rendered=
"#{!empty incomingView.cardFiling}"
/>
<p:outputLabel
value=
"#{incomingView.cardFiling}"
rendered=
"#{!empty incomingView.cardFiling}"
/>
</b>
</p:fieldset>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/resources/i18n.properties
View file @
b54117b
...
...
@@ -190,6 +190,7 @@ incomingView.cancel = Peruuta
incomingflow.alreadyShowingUser.message
=
Piipattu k
\u
00E4ytt
\u
00E4j
\u
00E4 on jo n
\u
00E4kyviss
\u
00E4
incomingflow.alreadyShowingUser.title
=
Valmiiksi valittu
incomingflow.cardCodes
=
Kortin koodit
incomingflow.cardfiling.label
=
Card filing:
incomingflow.codeattached.message
=
Piipattu koodi liitetty n
\u
00E4ytett
\u
00E4v
\u
00E4
\u
00E4n korttiin
incomingflow.codeattached.title
=
Koodi liittetty
incomingflow.giveplace
=
Merkitse annetuksi
...
...
code/moya-web/src/main/java/fi/codecrew/moya/resources/i18n_en.properties
View file @
b54117b
...
...
@@ -513,6 +513,7 @@ incomingflow.alreadyShowingUser.message = We are already showing selected user
incomingflow.alreadyShowingUser.title
=
Already selected
incomingflow.barcode
=
Barcode
incomingflow.cardCodes
=
Barcodes in card
incomingflow.cardfiling.label
=
Card filing:
incomingflow.changereader
=
Change Reader
incomingflow.codeattached.message
=
Code attached to current user's card
incomingflow.codeattached.title
=
Code attached
...
...
code/moya-web/src/main/java/fi/codecrew/moya/resources/i18n_fi.properties
View file @
b54117b
...
...
@@ -521,6 +521,7 @@ incomingflow.alreadyShowingUser.message = Piipattu k\u00E4ytt\u00E4j\u00E4 on jo
incomingflow.alreadyShowingUser.title
=
Valmiiksi valittu
incomingflow.barcode
=
Viivakoodi
incomingflow.cardCodes
=
Korttiin liitetyt koodit
incomingflow.cardfiling.label
=
Kortin kansiointi:
incomingflow.changereader
=
Vaihda lukijaa
incomingflow.codeattached.message
=
Piipattu koodi liitetty aktiiviseen k
\u
00E4ytt
\u
00E4j
\u
00E4
\u
00E4n
incomingflow.codeattached.title
=
Koodi liitetty
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/flow/IncomingView.java
View file @
b54117b
...
...
@@ -27,6 +27,7 @@ import javax.faces.context.FacesContext;
import
javax.faces.model.ListDataModel
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.json.JsonObject
;
import
org.primefaces.event.SelectEvent
;
import
org.slf4j.Logger
;
...
...
@@ -74,10 +75,9 @@ public class IncomingView extends GenericCDIView {
@Inject
private
ReaderNameContainer
namecontainer
;
@Inject
private
FlowUserContainer
flowUserContainer
;
@EJB
private
BarcodeBeanLocal
barcodeBean
;
...
...
@@ -149,14 +149,13 @@ public class IncomingView extends GenericCDIView {
if
(!
initialized
)
{
logger
.
debug
(
"INITIALIZING!!!!"
);
if
(
flowUserContainer
.
getUserId
()
!=
null
&&
flowUserContainer
.
getUserId
()
>
0
)
{
if
(
flowUserContainer
.
getUserId
()
!=
null
&&
flowUserContainer
.
getUserId
()
>
0
)
{
userview
.
setUserid
(
flowUserContainer
.
getUserId
());
}
flowUserContainer
.
setUserId
(
null
);
// initializePoller();
initialized
=
true
;
super
.
beginConversation
();
...
...
@@ -215,7 +214,6 @@ public class IncomingView extends GenericCDIView {
return
;
}
cardBean
.
giveCard
(
userview
.
getSelectedUser
(),
autoGivePlaces
);
userview
.
attachCodeToCard
(
eventToAttach
);
...
...
@@ -226,11 +224,9 @@ public class IncomingView extends GenericCDIView {
userview
.
setPrintedCard
(
null
);
// refresh card
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
new
FacesMessage
(
I18n
.
get
(
"incomingflow.codeattached.title"
),
I18n
.
get
(
"incomingflow.codeattached.message"
)));
}
public
boolean
isShowAttachDialog
()
{
return
showAttachDialog
;
}
...
...
@@ -270,6 +266,23 @@ public class IncomingView extends GenericCDIView {
return
ret
;
}
/**
* Try to get card filing info from the metadata. Empty string if not found.
*
* @return Card filing info String or empty string.
*/
public
String
getCardFiling
()
{
try
{
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getSelectedUser
());
JsonObject
cardMeta
=
card
.
getMeta
();
JsonObject
cardFilingObject
=
cardMeta
.
getJsonObject
(
"card-filing"
);
return
cardFilingObject
.
getString
(
"cardplace"
);
}
catch
(
Exception
e
)
{
logger
.
warn
(
"Could not get card filing info"
,
e
);
}
return
""
;
}
public
String
printCard
()
{
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getUser
());
card
.
setCardState
(
CardState
.
VALIDATED
);
...
...
@@ -283,12 +296,11 @@ public class IncomingView extends GenericCDIView {
}
public
ListDataModel
<
CardCode
>
getCardCodes
()
{
if
(
userview
.
getPrintedCard
()
==
null
)
if
(
userview
.
getPrintedCard
()
==
null
)
return
new
ListDataModel
<
CardCode
>(
new
ArrayList
<
CardCode
>());
cardCodes
=
new
ListDataModel
<
CardCode
>(
userview
.
getPrintedCard
().
getCardCodes
());
return
cardCodes
;
}
...
...
@@ -297,7 +309,7 @@ public class IncomingView extends GenericCDIView {
if
(
cardCodes
!=
null
&&
cardCodes
.
isRowAvailable
())
{
CardCode
code
=
cardCodes
.
getRowData
();
cardTemplateBean
.
removeCardCode
(
code
);
// flush that fucker
userview
.
setPrintedCard
(
null
);
}
...
...
@@ -320,5 +332,5 @@ public class IncomingView extends GenericCDIView {
}
return
null
;
}
}
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