Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
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 f9733a22
authored
Nov 04, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some minor fixes and localisations
1 parent
7602d5ca
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
25 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
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/servlet/PlaceMap.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/ProductShopView.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
View file @
f9733a2
...
@@ -96,7 +96,6 @@ public class MenuBean implements MenuBeanLocal {
...
@@ -96,7 +96,6 @@ public class MenuBean implements MenuBeanLocal {
userEvent
.
setKey
(
"topnavi.userevent"
);
userEvent
.
setKey
(
"topnavi.userevent"
);
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/poll/index"
),
PollPermission
.
ANSWER
);
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/poll/index"
),
PollPermission
.
ANSWER
);
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/poll/answerToPoll"
),
PollPermission
.
ANSWER
).
setVisible
(
false
);
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/poll/answerToPoll"
),
PollPermission
.
ANSWER
).
setVisible
(
false
);
;
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/user/invite"
),
UserPermission
.
INVITE_USERS
);
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/user/invite"
),
UserPermission
.
INVITE_USERS
);
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/feedback/index"
),
UserPermission
.
VITUTTAAKO
);
userEvent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/feedback/index"
),
UserPermission
.
VITUTTAAKO
);
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ProductBean.java
View file @
f9733a2
...
@@ -206,8 +206,7 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -206,8 +206,7 @@ public class ProductBean implements ProductBeanLocal {
{
{
case
GLOBAL_BILLED:
case
GLOBAL_BILLED:
BigDecimal
globBillTot
=
BigDecimal
.
ZERO
;
BigDecimal
globBillTot
=
BigDecimal
.
ZERO
;
for
(
Product
p
:
limit
.
getProducts
())
for
(
Product
p
:
limit
.
getProducts
())
{
{
BillSummary
globBilledSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
());
BillSummary
globBilledSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
());
globBillTot
=
globBillTot
.
add
(
globBilledSummary
.
getTotal
());
globBillTot
=
globBillTot
.
add
(
globBilledSummary
.
getTotal
());
}
}
...
@@ -216,8 +215,7 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -216,8 +215,7 @@ public class ProductBean implements ProductBeanLocal {
break
;
break
;
case
GLOBAL_BILL_PAID:
case
GLOBAL_BILL_PAID:
BigDecimal
globBillPaid
=
BigDecimal
.
ZERO
;
BigDecimal
globBillPaid
=
BigDecimal
.
ZERO
;
for
(
Product
p
:
limit
.
getProducts
())
for
(
Product
p
:
limit
.
getProducts
())
{
{
BillSummary
billPaidSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
());
BillSummary
billPaidSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
());
globBillPaid
=
globBillPaid
.
add
(
billPaidSummary
.
getPaid
());
globBillPaid
=
globBillPaid
.
add
(
billPaidSummary
.
getPaid
());
}
}
...
@@ -233,16 +231,14 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -233,16 +231,14 @@ public class ProductBean implements ProductBeanLocal {
break
;
break
;
case
USER_ACCOUNTEVENTS:
case
USER_ACCOUNTEVENTS:
BigDecimal
userProductCount
=
accounteventfacade
.
getProductCount
(
limit
.
getProducts
(),
user
);
BigDecimal
userProductCount
=
accounteventfacade
.
getProductCount
(
limit
.
getProducts
(),
user
);
if
(
userProductCount
!=
null
)
if
(
userProductCount
!=
null
)
{
{
count
=
count
.
add
(
userProductCount
);
count
=
count
.
add
(
userProductCount
);
}
}
ret
=
limit
.
getUpperLimit
().
subtract
(
count
);
ret
=
limit
.
getUpperLimit
().
subtract
(
count
);
break
;
break
;
case
USER_BILLED:
case
USER_BILLED:
BigDecimal
userBillTot
=
BigDecimal
.
ZERO
;
BigDecimal
userBillTot
=
BigDecimal
.
ZERO
;
for
(
Product
p
:
limit
.
getProducts
())
for
(
Product
p
:
limit
.
getProducts
())
{
{
BillSummary
userBilledSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
(),
user
);
BillSummary
userBilledSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
(),
user
);
userBillTot
=
userBillTot
.
add
(
userBilledSummary
.
getTotal
());
userBillTot
=
userBillTot
.
add
(
userBilledSummary
.
getTotal
());
}
}
...
@@ -251,8 +247,7 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -251,8 +247,7 @@ public class ProductBean implements ProductBeanLocal {
break
;
break
;
case
USER_BILL_PAID:
case
USER_BILL_PAID:
BigDecimal
userBillPaid
=
BigDecimal
.
ZERO
;
BigDecimal
userBillPaid
=
BigDecimal
.
ZERO
;
for
(
Product
p
:
limit
.
getProducts
())
for
(
Product
p
:
limit
.
getProducts
())
{
{
BillSummary
userPaidSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
(),
user
);
BillSummary
userPaidSummary
=
billLineFacade
.
getLineSummary
(
p
,
eventbean
.
getCurrentEvent
(),
user
);
userBillPaid
=
userBillPaid
.
add
(
userPaidSummary
.
getPaid
());
userBillPaid
=
userBillPaid
.
add
(
userPaidSummary
.
getPaid
());
}
}
...
@@ -364,15 +359,15 @@ public class ProductBean implements ProductBeanLocal {
...
@@ -364,15 +359,15 @@ public class ProductBean implements ProductBeanLocal {
@Override
@Override
public
List
<
Product
>
findPlaceProducts
()
{
public
List
<
Product
>
findPlaceProducts
()
{
ArrayList
<
Product
>
returnProducts
=
new
ArrayList
<
Product
>();
ArrayList
<
Product
>
returnProducts
=
new
ArrayList
<
Product
>();
for
(
Product
product
:
findProductsForEvent
())
{
for
(
Product
product
:
findProductsForEvent
())
{
if
(
product
.
getPlaces
()
!=
null
&&
product
.
getPlaces
().
size
()
>
0
)
{
if
(
product
.
getPlaces
()
!=
null
&&
product
.
getPlaces
().
size
()
>
0
)
{
returnProducts
.
add
(
product
);
returnProducts
.
add
(
product
);
}
}
}
}
return
returnProducts
;
return
returnProducts
;
}
}
}
}
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
View file @
f9733a2
...
@@ -223,8 +223,8 @@ resetMail.username = Username
...
@@ -223,8 +223,8 @@ resetMail.username = Username
resetmailSent.body
=
Email has been sent containing a link where you can change the password.
resetmailSent.body
=
Email has been sent containing a link where you can change the password.
resetmailSent.header
=
Email sent
resetmailSent.header
=
Email sent
submenu.NotImplementedYet
=
Not implemented
submenu.NotImplementedYet
=
Not implemented
submenu.frontpage
=
Frontpage
submenu.frontpage
=
Frontpage
subnavi.cards
=
\u0009\u0009
subnavi.cards
=
\u0009\u0009
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
f9733a2
...
@@ -910,6 +910,7 @@ submenu.auth.sendResetMail = Password reset
...
@@ -910,6 +910,7 @@ submenu.auth.sendResetMail = Password reset
submenu.bill.billSummary
=
Bill summary
submenu.bill.billSummary
=
Bill summary
submenu.bill.list
=
My bills
submenu.bill.list
=
My bills
submenu.bill.listAll
=
All bills
submenu.bill.listAll
=
All bills
submenu.eventorg.editEvent
=
Edit event
submenu.eventorg.list
=
Manage Event
submenu.eventorg.list
=
Manage Event
submenu.feedback.index
=
U Mad?!
submenu.feedback.index
=
U Mad?!
submenu.foodadmin.createTemplate
=
Create foodwave template
submenu.foodadmin.createTemplate
=
Create foodwave template
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
f9733a2
...
@@ -892,6 +892,7 @@ submenu.auth.sendResetMail = Salasanan palautus
...
@@ -892,6 +892,7 @@ submenu.auth.sendResetMail = Salasanan palautus
submenu.bill.billSummary
=
Laskujen yhteenveto
submenu.bill.billSummary
=
Laskujen yhteenveto
submenu.bill.list
=
N
\u
00E4yt
\u
00E4 omat laskut
submenu.bill.list
=
N
\u
00E4yt
\u
00E4 omat laskut
submenu.bill.listAll
=
Kaikki laskut
submenu.bill.listAll
=
Kaikki laskut
submenu.eventorg.editEvent
=
Tapahtuman tiedot
submenu.eventorg.list
=
Organisaation hallinta
submenu.eventorg.list
=
Organisaation hallinta
submenu.feedback.index
=
Vituttaako?
submenu.feedback.index
=
Vituttaako?
submenu.foodadmin.createTemplate
=
Luo tilauspohja
submenu.foodadmin.createTemplate
=
Luo tilauspohja
...
...
code/MoyaWeb/src/fi/codecrew/moya/servlet/PlaceMap.java
View file @
f9733a2
...
@@ -246,6 +246,7 @@ public class PlaceMap extends HttpServlet {
...
@@ -246,6 +246,7 @@ public class PlaceMap extends HttpServlet {
}
}
Color
color
=
null
;
Color
color
=
null
;
if
(!
p
.
isBuyable
())
{
if
(!
p
.
isBuyable
())
{
logger
.
info
(
"Locking place."
);
color
=
LOCKED_COLOR
;
color
=
LOCKED_COLOR
;
}
}
...
@@ -253,8 +254,7 @@ public class PlaceMap extends HttpServlet {
...
@@ -253,8 +254,7 @@ public class PlaceMap extends HttpServlet {
logger
.
debug
(
"Setting place selected {}"
,
p
);
logger
.
debug
(
"Setting place selected {}"
,
p
);
color
=
SELECTED_COLOR
;
color
=
SELECTED_COLOR
;
}
else
if
(
user
.
equals
(
p
.
getCurrentUser
())
}
else
if
(
user
.
equals
(
p
.
getCurrentUser
())
||
(
p
.
getGroup
()
!=
null
&&
user
.
equals
(
p
.
getGroup
()
||
(
p
.
getGroup
()
!=
null
&&
user
.
equals
(
p
.
getGroup
().
getCreator
()))
.
getCreator
()))
||
(
p
.
getPlaceReserver
()
!=
null
&&
user
.
equals
(
p
||
(
p
.
getPlaceReserver
()
!=
null
&&
user
.
equals
(
p
.
getPlaceReserver
().
getUser
())))
{
.
getPlaceReserver
().
getUser
())))
{
color
=
OWNED_COLOR
;
color
=
OWNED_COLOR
;
...
@@ -271,6 +271,9 @@ public class PlaceMap extends HttpServlet {
...
@@ -271,6 +271,9 @@ public class PlaceMap extends HttpServlet {
}
catch
(
NumberFormatException
x
)
{
}
catch
(
NumberFormatException
x
)
{
logger
.
error
(
"Cannot convert string {} to color."
,
p
.
getProduct
().
getColor
());
logger
.
error
(
"Cannot convert string {} to color."
,
p
.
getProduct
().
getColor
());
}
}
}
else
{
logger
.
info
(
"Nothing special for this place. Color should be default."
);
}
}
g
.
setColor
(
BORDER_COLOR
);
g
.
setColor
(
BORDER_COLOR
);
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/ProductShopView.java
View file @
f9733a2
...
@@ -94,9 +94,7 @@ public class ProductShopView extends GenericCDIView {
...
@@ -94,9 +94,7 @@ public class ProductShopView extends GenericCDIView {
public
void
initBillView
()
{
public
void
initBillView
()
{
if
(
requirePermissions
(
ShopPermission
.
LIST_USERPRODUCTS
)
if
(
requirePermissions
(
ShopPermission
.
LIST_USERPRODUCTS
)
&&
shoppingcart
==
null
)
{
&&
shoppingcart
==
null
)
{
shoppingcart
=
new
ListDataModel
<
ProductShopItem
>(
shoppingcart
=
new
ListDataModel
<
ProductShopItem
>(
ProductShopItem
.
productList
(
productBean
.
listUserShoppableProducts
()));
ProductShopItem
.
productList
(
productBean
.
listUserShoppableProducts
()));
updateCartLimits
(
null
);
updateCartLimits
(
null
);
logger
.
debug
(
"Initialized billing shoppingcart to {}"
,
shoppingcart
);
logger
.
debug
(
"Initialized billing shoppingcart to {}"
,
shoppingcart
);
this
.
beginConversation
();
this
.
beginConversation
();
...
@@ -193,8 +191,7 @@ public class ProductShopView extends GenericCDIView {
...
@@ -193,8 +191,7 @@ public class ProductShopView extends GenericCDIView {
prodCounts
.
put
(
sc
.
getProduct
().
getId
(),
sc
.
getCount
());
prodCounts
.
put
(
sc
.
getProduct
().
getId
(),
sc
.
getCount
());
}
}
HashMap
<
Integer
,
BigDecimal
>
limits
=
productBean
.
getProductLimit
(
HashMap
<
Integer
,
BigDecimal
>
limits
=
productBean
.
getProductLimit
(
prodCounts
,
user
);
prodCounts
,
user
);
// Update the updated cart first
// Update the updated cart first
if
(
item
!=
null
)
{
if
(
item
!=
null
)
{
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserView.java
View file @
f9733a2
...
@@ -128,6 +128,7 @@ public class UserView extends GenericCDIView {
...
@@ -128,6 +128,7 @@ public class UserView extends GenericCDIView {
}
}
public
void
handleImageUpload
(
FileUploadEvent
event
)
{
public
void
handleImageUpload
(
FileUploadEvent
event
)
{
logger
.
info
(
"Handling fileupload with event {} and file"
,
event
,
event
.
getFile
());
FacesMessage
msg
=
new
FacesMessage
(
"Succesful"
,
event
.
getFile
().
getFileName
()
+
" is uploaded."
);
FacesMessage
msg
=
new
FacesMessage
(
"Succesful"
,
event
.
getFile
().
getFileName
()
+
" is uploaded."
);
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
msg
);
FacesContext
.
getCurrentInstance
().
addMessage
(
null
,
msg
);
UploadedFile
f
=
event
.
getFile
();
UploadedFile
f
=
event
.
getFile
();
...
...
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