Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
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 ab9d6a3c
authored
Oct 26, 2012
by
Riku Silvola
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of codecrew.fi:bortal
2 parents
ae5d3663
454f7c0e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
44 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/CardPrintBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ProductPBean.java
code/LanBortalWeb/WebContent/foodadmin/editTemplate.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/actionlog/ActionLogMessageView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/BillBean.java
View file @
ab9d6a3
...
...
@@ -209,11 +209,9 @@ public class BillBean implements BillBeanLocal {
Product
creditproduct
=
productBean
.
findCreditProduct
();
EventUser
user
=
bill
.
getUser
();
AccountEvent
ac
=
productBean
.
createAccountEvent
(
creditproduct
,
bill
.
totalPrice
(),
user
);
AccountEvent
ac
=
productBean
.
createAccountEvent
(
creditproduct
,
bill
.
totalPrice
(),
user
);
logger
.
info
(
"Created creditentry. {}, userproducts {}"
,
ac
,
user
.
getAccountEvents
().
size
());
logger
.
info
(
"Created creditentry. {}, userproducts {}"
,
ac
,
user
.
getAccountEvents
().
size
());
ac
.
setDelivered
(
when
);
ac
.
setEventTime
(
when
);
...
...
@@ -224,27 +222,20 @@ public class BillBean implements BillBeanLocal {
bill
.
setPaidDate
(
when
.
getTime
());
// bill = billFacade.merge(bill);
boolean
checked
=
false
;
for
(
BillLine
bl
:
bill
.
getBillLines
())
{
Product
prod
=
bl
.
getLineProduct
();
if
(
prod
!=
null
&&
prod
.
getProductFlags
().
contains
(
ProductFlag
.
PREPAID_INSTANT_CREATE
))
{
logger
.
debug
(
"Creating Bill prepaidInstant product {}, {}"
,
prod
.
getName
(),
bl
.
getQuantity
());
if
(
prod
.
getProductFlags
().
contains
(
ProductFlag
.
RESERVE_PLACE_WHEN_BOUGHT
)
||
prod
.
getProductFlags
().
contains
(
ProductFlag
.
CREATE_NEW_PLACE_WHEN_BOUGHT
))
{
placebean
.
lockPlaceProduct
(
bill
.
getUser
(),
prod
,
bl
.
getQuantity
());
if
(
prod
!=
null
&&
prod
.
getProductFlags
().
contains
(
ProductFlag
.
PREPAID_INSTANT_CREATE
))
{
logger
.
debug
(
"Creating Bill prepaidInstant product {}, {}"
,
prod
.
getName
(),
bl
.
getQuantity
());
if
(
prod
.
getProductFlags
().
contains
(
ProductFlag
.
RESERVE_PLACE_WHEN_BOUGHT
)
||
prod
.
getProductFlags
().
contains
(
ProductFlag
.
CREATE_NEW_PLACE_WHEN_BOUGHT
))
{
placebean
.
lockPlaceProduct
(
bill
.
getUser
(),
prod
,
bl
.
getQuantity
());
}
AccountEvent
ac2
=
productPBean
.
createAccountEvent
(
prod
,
bl
.
getQuantity
(),
user
,
bill
.
getSentDate
(),
bl
.
getFoodwave
());
logger
.
info
(
"Created ac from product. {}, userproducts {}"
,
ac2
,
user
.
getAccountEvents
().
size
());
AccountEvent
ac2
=
productPBean
.
createAccountEvent
(
prod
,
bl
.
getQuantity
(),
user
,
bill
.
getSentDate
(),
bl
.
getFoodwave
());
logger
.
info
(
"Created ac from product. {}, userproducts {}"
,
ac2
,
user
.
getAccountEvents
().
size
());
ac2
.
setSeller
(
permbean
.
getCurrentUser
());
...
...
@@ -253,9 +244,7 @@ public class BillBean implements BillBeanLocal {
}
MailMessage
msg
=
new
MailMessage
();
msg
.
setSubject
(
I18n
.
get
(
"bill.billMarkedPaidMail.subject"
));
msg
.
setMessage
(
I18n
.
get
(
"bill.billMarkedPaidMail.message"
,
(
bill
.
getBillNumber
()
==
null
)
?
"----"
:
bill
.
getBillNumber
()
.
toString
()));
msg
.
setMessage
(
I18n
.
get
(
"bill.billMarkedPaidMail.message"
,
(
bill
.
getBillNumber
()
==
null
)
?
"----"
:
bill
.
getBillNumber
().
toString
()));
msg
.
setTo
(
bill
.
getUser
().
getUser
());
utilbean
.
sendMail
(
msg
);
eventUserFacade
.
flush
();
...
...
@@ -265,13 +254,9 @@ public class BillBean implements BillBeanLocal {
@Override
@RolesAllowed
({
BillPermission
.
S_CREATE_BILL
,
BillPermission
.
S_WRITE_ALL
})
public
void
createBill
(
Bill
bill
)
{
if
(!
permbean
.
isCurrentUser
(
bill
.
getUser
())
&&
!
permbean
.
hasPermission
(
BillPermission
.
WRITE_ALL
))
{
loggingBean
.
logMessage
(
SecurityLogType
.
permissionDenied
,
permbean
.
getCurrentUser
(),
"Not enought rights to create bill for user "
);
throw
new
EJBAccessException
(
"Could not create bill for another user"
);
if
(!
permbean
.
isCurrentUser
(
bill
.
getUser
())
&&
!
permbean
.
hasPermission
(
BillPermission
.
WRITE_ALL
))
{
loggingBean
.
logMessage
(
SecurityLogType
.
permissionDenied
,
permbean
.
getCurrentUser
(),
"Not enought rights to create bill for user "
);
throw
new
EJBAccessException
(
"Could not create bill for another user"
);
}
billFacade
.
create
(
bill
);
generateBillNumber
(
bill
);
...
...
@@ -285,13 +270,9 @@ public class BillBean implements BillBeanLocal {
@Override
@RolesAllowed
({
BillPermission
.
S_VIEW_OWN
,
BillPermission
.
S_READ_ALL
})
public
List
<
Bill
>
find
(
EventUser
user
)
{
if
(!
permbean
.
isCurrentUser
(
user
)
&&
!
permbean
.
hasPermission
(
BillPermission
.
READ_ALL
))
{
loggingBean
.
logMessage
(
SecurityLogType
.
permissionDenied
,
permbean
.
getCurrentUser
(),
"Not enought rights to get bill list for user "
);
throw
new
EJBAccessException
(
"Could not list bills for another user"
);
if
(!
permbean
.
isCurrentUser
(
user
)
&&
!
permbean
.
hasPermission
(
BillPermission
.
READ_ALL
))
{
loggingBean
.
logMessage
(
SecurityLogType
.
permissionDenied
,
permbean
.
getCurrentUser
(),
"Not enought rights to get bill list for user "
);
throw
new
EJBAccessException
(
"Could not list bills for another user"
);
}
return
billFacade
.
find
(
user
);
}
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/CardPrintBean.java
View file @
ab9d6a3
...
...
@@ -107,6 +107,9 @@ public class CardPrintBean implements CardPrintBeanLocal {
.
read
(
new
ByteArrayInputStream
(
user
.
getCurrentImage
()
.
getImageData
()));
if
(
faceBufferedImage
.
getWidth
()
>
1024
||
faceBufferedImage
.
getHeight
()
>
1024
)
{
throw
new
Exception
(
"Image dimensions too large, please take/upload smaller!"
);
}
int
originalWidth
=
faceBufferedImage
.
getWidth
();
int
originalHeight
=
faceBufferedImage
.
getHeight
();
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ProductPBean.java
View file @
ab9d6a3
...
...
@@ -78,15 +78,14 @@ public class ProductPBean {
unitPrice
=
unitPrice
.
multiply
(
d
.
getPercentage
());
}
AccountEvent
ret
=
new
AccountEvent
(
user
,
product
,
unitPrice
,
quantity
,
Calendar
.
getInstance
());
AccountEvent
ret
=
new
AccountEvent
(
user
,
product
,
unitPrice
,
quantity
,
Calendar
.
getInstance
());
ret
.
setDelivered
(
Calendar
.
getInstance
());
ret
.
setSeller
(
permbean
.
getCurrentUser
());
if
(
foodwave
!=
null
)
{
ret
.
setFoodWave
(
foodwave
);
if
(
foodwave
.
getAccountEvents
()
==
null
)
{
if
(
foodwave
.
getAccountEvents
()
==
null
)
{
foodwave
.
setAccountEvents
(
new
ArrayList
<
AccountEvent
>());
}
foodwave
.
getAccountEvents
().
add
(
ret
);
...
...
code/LanBortalWeb/WebContent/foodadmin/editTemplate.xhtml
View file @
ab9d6a3
...
...
@@ -41,14 +41,14 @@
<h:commandButton
action=
"#{foodWaveView.saveTemplate()}"
value=
"#{i18n['foodwavetemplate.save']}"
/>
</h:panelGrid>
<h:selectOneMenu
value=
"#{foodWaveView.currentProduct}"
<
!-- <
h:selectOneMenu value="#{foodWaveView.currentProduct}"
converter="#{productConverter}">
<f:selectItems value="#{foodWaveView.products}" var="product"
itemLabel="#{product.name}"></f:selectItems>
</h:selectOneMenu>
<p:commandButton value="#{i18n['foodwavetemplate.addproduct']}"
actionListener="#{foodWaveView.addProductToTemplate}"
update=
"productTable"
/>
update="productTable" />
-->
<h:panelGrid
columns=
"4"
>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/actionlog/ActionLogMessageView.java
View file @
ab9d6a3
...
...
@@ -7,6 +7,7 @@ import javax.faces.bean.RequestScoped;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.ActionLogBeanLocal
;
import
fi.insomnia.bortal.enums.apps.ContentPermission
;
import
fi.insomnia.bortal.model.ActionLogMessage
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
...
...
@@ -29,6 +30,9 @@ public class ActionLogMessageView extends GenericCDIView {
}
public
List
<
ActionLogMessage
>
getMessages
()
{
return
actionLogBean
.
getAllActionLogEvents
();
if
(
super
.
hasPermission
(
ContentPermission
.
MANAGE_ACTIONLOG
))
{
return
actionLogBean
.
getAllActionLogEvents
();
}
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