Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
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
1
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 @@
...
@@ -166,8 +166,12 @@
<p:graphicImage
url=
"/dydata/usercard/#{userView.selectedUser.user.id}.png"
width=
"300"
/>
<p:graphicImage
url=
"/dydata/usercard/#{userView.selectedUser.user.id}.png"
width=
"300"
/>
<br
/>
<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>
</p:fieldset>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/resources/i18n.properties
View file @
b54117b
...
@@ -190,6 +190,7 @@ incomingView.cancel = Peruuta
...
@@ -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.message
=
Piipattu k
\u
00E4ytt
\u
00E4j
\u
00E4 on jo n
\u
00E4kyviss
\u
00E4
incomingflow.alreadyShowingUser.title
=
Valmiiksi valittu
incomingflow.alreadyShowingUser.title
=
Valmiiksi valittu
incomingflow.cardCodes
=
Kortin koodit
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.message
=
Piipattu koodi liitetty n
\u
00E4ytett
\u
00E4v
\u
00E4
\u
00E4n korttiin
incomingflow.codeattached.title
=
Koodi liittetty
incomingflow.codeattached.title
=
Koodi liittetty
incomingflow.giveplace
=
Merkitse annetuksi
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
...
@@ -513,6 +513,7 @@ incomingflow.alreadyShowingUser.message = We are already showing selected user
incomingflow.alreadyShowingUser.title
=
Already selected
incomingflow.alreadyShowingUser.title
=
Already selected
incomingflow.barcode
=
Barcode
incomingflow.barcode
=
Barcode
incomingflow.cardCodes
=
Barcodes in card
incomingflow.cardCodes
=
Barcodes in card
incomingflow.cardfiling.label
=
Card filing:
incomingflow.changereader
=
Change Reader
incomingflow.changereader
=
Change Reader
incomingflow.codeattached.message
=
Code attached to current user's card
incomingflow.codeattached.message
=
Code attached to current user's card
incomingflow.codeattached.title
=
Code attached
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
...
@@ -521,6 +521,7 @@ incomingflow.alreadyShowingUser.message = Piipattu k\u00E4ytt\u00E4j\u00E4 on jo
incomingflow.alreadyShowingUser.title
=
Valmiiksi valittu
incomingflow.alreadyShowingUser.title
=
Valmiiksi valittu
incomingflow.barcode
=
Viivakoodi
incomingflow.barcode
=
Viivakoodi
incomingflow.cardCodes
=
Korttiin liitetyt koodit
incomingflow.cardCodes
=
Korttiin liitetyt koodit
incomingflow.cardfiling.label
=
Kortin kansiointi:
incomingflow.changereader
=
Vaihda lukijaa
incomingflow.changereader
=
Vaihda lukijaa
incomingflow.codeattached.message
=
Piipattu koodi liitetty aktiiviseen k
\u
00E4ytt
\u
00E4j
\u
00E4
\u
00E4n
incomingflow.codeattached.message
=
Piipattu koodi liitetty aktiiviseen k
\u
00E4ytt
\u
00E4j
\u
00E4
\u
00E4n
incomingflow.codeattached.title
=
Koodi liitetty
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;
...
@@ -27,6 +27,7 @@ import javax.faces.context.FacesContext;
import
javax.faces.model.ListDataModel
;
import
javax.faces.model.ListDataModel
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
javax.json.JsonObject
;
import
org.primefaces.event.SelectEvent
;
import
org.primefaces.event.SelectEvent
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -74,10 +75,9 @@ public class IncomingView extends GenericCDIView {
...
@@ -74,10 +75,9 @@ public class IncomingView extends GenericCDIView {
@Inject
@Inject
private
ReaderNameContainer
namecontainer
;
private
ReaderNameContainer
namecontainer
;
@Inject
@Inject
private
FlowUserContainer
flowUserContainer
;
private
FlowUserContainer
flowUserContainer
;
@EJB
@EJB
private
BarcodeBeanLocal
barcodeBean
;
private
BarcodeBeanLocal
barcodeBean
;
...
@@ -149,14 +149,13 @@ public class IncomingView extends GenericCDIView {
...
@@ -149,14 +149,13 @@ public class IncomingView extends GenericCDIView {
if
(!
initialized
)
{
if
(!
initialized
)
{
logger
.
debug
(
"INITIALIZING!!!!"
);
logger
.
debug
(
"INITIALIZING!!!!"
);
if
(
flowUserContainer
.
getUserId
()
!=
null
&&
flowUserContainer
.
getUserId
()
>
0
)
{
if
(
flowUserContainer
.
getUserId
()
!=
null
&&
flowUserContainer
.
getUserId
()
>
0
)
{
userview
.
setUserid
(
flowUserContainer
.
getUserId
());
userview
.
setUserid
(
flowUserContainer
.
getUserId
());
}
}
flowUserContainer
.
setUserId
(
null
);
flowUserContainer
.
setUserId
(
null
);
// initializePoller();
// initializePoller();
initialized
=
true
;
initialized
=
true
;
super
.
beginConversation
();
super
.
beginConversation
();
...
@@ -215,7 +214,6 @@ public class IncomingView extends GenericCDIView {
...
@@ -215,7 +214,6 @@ public class IncomingView extends GenericCDIView {
return
;
return
;
}
}
cardBean
.
giveCard
(
userview
.
getSelectedUser
(),
autoGivePlaces
);
cardBean
.
giveCard
(
userview
.
getSelectedUser
(),
autoGivePlaces
);
userview
.
attachCodeToCard
(
eventToAttach
);
userview
.
attachCodeToCard
(
eventToAttach
);
...
@@ -226,11 +224,9 @@ public class IncomingView extends GenericCDIView {
...
@@ -226,11 +224,9 @@ public class IncomingView extends GenericCDIView {
userview
.
setPrintedCard
(
null
);
// refresh card
userview
.
setPrintedCard
(
null
);
// refresh card
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
new
FacesMessage
(
I18n
.
get
(
"incomingflow.codeattached.title"
),
I18n
.
get
(
"incomingflow.codeattached.message"
)));
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
new
FacesMessage
(
I18n
.
get
(
"incomingflow.codeattached.title"
),
I18n
.
get
(
"incomingflow.codeattached.message"
)));
}
}
public
boolean
isShowAttachDialog
()
{
public
boolean
isShowAttachDialog
()
{
return
showAttachDialog
;
return
showAttachDialog
;
}
}
...
@@ -270,6 +266,23 @@ public class IncomingView extends GenericCDIView {
...
@@ -270,6 +266,23 @@ public class IncomingView extends GenericCDIView {
return
ret
;
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
()
{
public
String
printCard
()
{
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getUser
());
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getUser
());
card
.
setCardState
(
CardState
.
VALIDATED
);
card
.
setCardState
(
CardState
.
VALIDATED
);
...
@@ -283,12 +296,11 @@ public class IncomingView extends GenericCDIView {
...
@@ -283,12 +296,11 @@ public class IncomingView extends GenericCDIView {
}
}
public
ListDataModel
<
CardCode
>
getCardCodes
()
{
public
ListDataModel
<
CardCode
>
getCardCodes
()
{
if
(
userview
.
getPrintedCard
()
==
null
)
if
(
userview
.
getPrintedCard
()
==
null
)
return
new
ListDataModel
<
CardCode
>(
new
ArrayList
<
CardCode
>());
return
new
ListDataModel
<
CardCode
>(
new
ArrayList
<
CardCode
>());
cardCodes
=
new
ListDataModel
<
CardCode
>(
userview
.
getPrintedCard
().
getCardCodes
());
cardCodes
=
new
ListDataModel
<
CardCode
>(
userview
.
getPrintedCard
().
getCardCodes
());
return
cardCodes
;
return
cardCodes
;
}
}
...
@@ -297,7 +309,7 @@ public class IncomingView extends GenericCDIView {
...
@@ -297,7 +309,7 @@ public class IncomingView extends GenericCDIView {
if
(
cardCodes
!=
null
&&
cardCodes
.
isRowAvailable
())
{
if
(
cardCodes
!=
null
&&
cardCodes
.
isRowAvailable
())
{
CardCode
code
=
cardCodes
.
getRowData
();
CardCode
code
=
cardCodes
.
getRowData
();
cardTemplateBean
.
removeCardCode
(
code
);
cardTemplateBean
.
removeCardCode
(
code
);
// flush that fucker
// flush that fucker
userview
.
setPrintedCard
(
null
);
userview
.
setPrintedCard
(
null
);
}
}
...
@@ -320,5 +332,5 @@ public class IncomingView extends GenericCDIView {
...
@@ -320,5 +332,5 @@ public class IncomingView extends GenericCDIView {
}
}
return
null
;
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