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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
bf46d0a5
Commit
bf46d0a5
authored
Feb 08, 2017
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_travel_expense: don't create and insert dom manually
parent
2b79140a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
30 deletions
+36
-30
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_html.html
...em/web_page_module/gadget_hr_leave_request_list_html.html
+8
-2
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_html.xml
...tem/web_page_module/gadget_hr_leave_request_list_html.xml
+3
-3
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_js.js
...teItem/web_page_module/gadget_hr_leave_request_list_js.js
+22
-22
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_js.xml
...eItem/web_page_module/gadget_hr_leave_request_list_js.xml
+3
-3
No files found.
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_html.html
View file @
bf46d0a5
...
...
@@ -9,11 +9,17 @@
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"handlebars.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_officejs_page_leave_request_record_list.js"
></script>
</head>
<script
class=
"page-template"
type=
"text/x-handlebars-template"
>
{{
#
if
day_left
}}
<
p
data
-
i18n
=
"
Leaves days left:
"
>
Leaves
days
left
:
<
span
>
{{
day_left
}}
<
/span></
p
>
{{
/
if
}}
<
div
class
=
"
leave_request_listbox
"
><
/div
>
</script>
</head>
<body>
<div
data-gadget-url=
"gadget_officejs_widget_listbox.html"
data-gadget-scope=
"listbox"
></div>
</body>
</html>
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_html.xml
View file @
bf46d0a5
...
...
@@ -260,7 +260,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
supercedriclen
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -274,7 +274,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
5.40831.35926.40840
</string>
</value>
<value>
<string>
95
7.11901.58686.802
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -292,7 +292,7 @@
</tuple>
<state>
<tuple>
<float>
148
0528773.62
</float>
<float>
148
6546513.23
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_js.js
View file @
bf46d0a5
...
...
@@ -2,8 +2,12 @@
/*jslint indent: 2, nomen: true, maxlen: 80*/
(
function
(
window
,
RSVP
,
rJS
,
document
)
{
"
use strict
"
;
rJS
(
window
)
var
gadget_klass
=
rJS
(
window
),
source
=
gadget_klass
.
__template_element
.
querySelector
(
"
.page-template
"
)
.
innerHTML
,
template
=
Handlebars
.
compile
(
source
);
gadget_klass
.
ready
(
function
(
g
)
{
g
.
props
=
{};
return
g
.
getElement
()
...
...
@@ -31,6 +35,7 @@
});
})
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
'
getSetting
'
,
'
getSetting
'
)
...
...
@@ -70,7 +75,21 @@
});
})
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
listbox
"
);
return
gadget
.
jio_allDocs
({
query
:
'
portal_type: "Leave Report Record"
'
,
select_list
:
[
"
confirmed_leaves_days_left
"
],
});
})
.
push
(
function
(
result
)
{
var
options
=
{};
if
(
result
.
data
.
total_rows
>
0
)
{
options
.
day_left
=
result
.
data
.
rows
[
0
].
value
.
confirmed_leaves_days_left
;
}
return
gadget
.
translateHtml
(
template
(
options
));
})
.
push
(
function
(
html
)
{
gadget
.
props
.
element
.
innerHTML
=
html
;
return
gadget
.
declareGadget
(
"
gadget_officejs_widget_listbox.html
"
,
{
element
:
gadget
.
props
.
element
.
querySelector
(
'
.leave_request_listbox
'
)});
})
.
push
(
function
(
listbox
)
{
return
listbox
.
render
({
...
...
@@ -96,25 +115,6 @@
sort_on
:
[[
"
start_date
"
,
"
descending
"
]]
}
});
})
.
push
(
function
()
{
return
gadget
.
jio_allDocs
({
query
:
'
portal_type: "Leave Report Record"
'
,
select_list
:
[
"
confirmed_leaves_days_left
"
],
});
})
.
push
(
function
(
result
)
{
var
p
;
if
(
result
.
data
.
total_rows
!=
1
)
{
return
;
}
p
=
document
.
createElement
(
"
p
"
);
p
.
textContent
=
"
Leaves days left:
"
+
result
.
data
.
rows
[
0
].
value
.
confirmed_leaves_days_left
;
gadget
.
props
.
element
.
insertBefore
(
p
,
gadget
.
props
.
element
.
querySelector
(
"
div
"
)
);
});
});
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_list_js.xml
View file @
bf46d0a5
...
...
@@ -256,7 +256,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
supercedriclen
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -270,7 +270,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
6.57347.13686.32631
</string>
</value>
<value>
<string>
95
7.11870.44460.28228
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>
148
5341013.1
</float>
<float>
148
6546441.25
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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