Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
erp5
Commits
36353614
Commit
36353614
authored
Aug 16, 2017
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_travel_expense: Add support for PDF as proof of payment
parent
65c1dc88
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
11 deletions
+17
-11
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html
...m/web_page_module/gadget_hr_expense_record_view_html.html
+1
-1
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.xml
...em/web_page_module/gadget_hr_expense_record_view_html.xml
+4
-3
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js
...eItem/web_page_module/gadget_hr_expense_record_view_js.js
+1
-1
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.xml
...Item/web_page_module/gadget_hr_expense_record_view_js.xml
+4
-3
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_updateRelatedTicket.py
...skins/erp5_hr_record/ExpenseRecord_updateRelatedTicket.py
+6
-2
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_view/your_image.xml
...5_hr_request/ExpenseValidationRequest_view/your_image.xml
+1
-1
No files found.
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.html
View file @
36353614
...
...
@@ -73,7 +73,7 @@
<
div
class
=
"
ui-field-contain
"
>
<
label
data
-
i18n
=
"
Photo
"
>
Photo
<
/label
>
<
input
name
=
"
photo
"
type
=
"
file
"
accept
=
"
image/*
"
capture
=
"
camera
"
>
<
input
name
=
"
photo
"
type
=
"
file
"
><!--
accept
=
"
image/*
"
capture
=
"
camera
"
--
>
<
/div
>
<
div
class
=
"
ui-field-contain
"
>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_html.xml
View file @
36353614
...
...
@@ -68,6 +68,7 @@
<value>
<tuple>
<string>
contributor/person_module/2
</string>
<string>
contributor/person_module/5
</string>
</tuple>
</value>
</item>
...
...
@@ -232,7 +233,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
P4
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -246,7 +247,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
56.44329.14852.21316
</string>
</value>
<value>
<string>
9
60.56103.37527.44765
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -264,7 +265,7 @@
</tuple>
<state>
<tuple>
<float>
1
484576962.29
</float>
<float>
1
502900981.42
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.js
View file @
36353614
...
...
@@ -410,6 +410,7 @@
.
push
(
function
(
result
)
{
img
=
new
Image
();
img
.
src
=
result
.
target
.
result
;
gadget
.
options
.
doc
.
photo_data
=
img
.
src
;
return
RSVP
.
all
([
gadget
.
props
.
deferred1
.
promise
,
...
...
@@ -426,7 +427,6 @@
ctx.fillText('Longitude: ' + gadget.props.geoLocation.coords.longitude +" Latitude: " + gadget.props.geoLocation.coords.latitude, 0, canvas.height - 20);
gadget.options.doc.photo_data = canvas.toDataURL();
*/
gadget
.
options
.
doc
.
photo_data
=
img
.
src
;
preview
.
src
=
gadget
.
options
.
doc
.
photo_data
;
});
}
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_expense_record_view_js.xml
View file @
36353614
...
...
@@ -68,6 +68,7 @@
<value>
<tuple>
<string>
contributor/person_module/2
</string>
<string>
contributor/person_module/5
</string>
</tuple>
</value>
</item>
...
...
@@ -228,7 +229,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
cedric.le.ninivin
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -242,7 +243,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
56.58658.21925.32853
</string>
</value>
<value>
<string>
9
61.29556.33516.42052
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +261,7 @@
</tuple>
<state>
<tuple>
<float>
1
486473658.84
</float>
<float>
1
502904411.77
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ExpenseRecord_updateRelatedTicket.py
View file @
36353614
...
...
@@ -74,13 +74,17 @@ publication_section = portal.ERP5Site_getPreferredExpenseDocumentPublicationSect
photo_data
=
record
.
getPhotoData
()
if
photo_data
:
if
","
in
photo_data
and
ticket
:
photo_data
=
photo_data
.
split
(
","
)[
1
]
photo_type
,
photo_data
=
photo_data
.
split
(
","
)
filename
=
"tmp.png"
# XXX This is getting more hackish
if
"application/pdf"
in
photo_type
:
filename
=
"tmp.pdf"
image
=
portal
.
portal_contributions
.
newContent
(
data
=
photo_data
.
decode
(
'base64'
),
reference
=
ticket
.
getReference
()
+
"-justificatif"
,
title
=
ticket
.
getReference
()
+
" Justificatif"
,
description
=
ticket
.
getDescription
(),
filename
=
"tmp.png"
,
filename
=
filename
,
follow_up
=
ticket
.
getRelativeUrl
(),
publication_section
=
publication_section
.
getRelativeUrl
(),
group
=
ticket
.
getDestinationDecisionValue
().
getGroup
()
...
...
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_view/your_image.xml
View file @
36353614
...
...
@@ -301,7 +301,7 @@
<key>
<string>
_text
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
python:\'<a href="%(image_url)s">
<img
src=
"%(image_url)s?display=large"
></a>
\' % {\'image_url\': here.ExpenseValidationRequest_getRelatedExpenseProofUrl()}
python:\'<a href="%(image_url)s">
<img
src=
"%(image_url)s?
format=png&
display=large"
></a>
\' % {\'image_url\': here.ExpenseValidationRequest_getRelatedExpenseProofUrl()}
]]>
</string>
</value>
</item>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment