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
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
Sebastian
erp5
Commits
a27ecf00
Commit
a27ecf00
authored
Sep 28, 2017
by
Boxiang Sun
Committed by
Tristan Cavelier
Sep 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_support_request_ui: Improve support request statistic computing speed.
parent
5f8457eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js
...Item/web_page_module/gadget_supportrequest_homepage_js.js
+9
-6
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml
...tem/web_page_module/gadget_supportrequest_homepage_js.xml
+2
-2
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py
...quest/SupportRequest_getSupportRequestStatisticsAsJson.py
+10
-5
No files found.
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js
View file @
a27ecf00
...
...
@@ -154,11 +154,12 @@
data
:
[
{
value_dict
:
{
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
],
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
,
"
> 30
"
],
1
:
[
sp_data
.
le2
.
validated
,
sp_data
[
'
2to7
'
].
validated
,
sp_data
[
'
7to30
'
].
validated
sp_data
[
'
7to30
'
].
validated
,
sp_data
.
gt30
.
validated
]
},
colors
:
[
'
#d48265
'
],
...
...
@@ -167,11 +168,12 @@
},
{
value_dict
:
{
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
],
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
,
"
> 30
"
],
1
:
[
sp_data
.
le2
.
submitted
,
sp_data
[
'
2to7
'
].
submitted
,
sp_data
[
'
7to30
'
].
submitted
sp_data
[
'
7to30
'
].
submitted
,
sp_data
.
gt30
.
submitted
]
},
colors
:
[
'
#61a0a8
'
],
...
...
@@ -180,11 +182,12 @@
},
{
value_dict
:
{
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
],
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
,
"
> 30
"
],
1
:
[
sp_data
.
le2
.
suspended
,
sp_data
[
'
2to7
'
].
suspended
,
sp_data
[
'
7to30
'
].
suspended
sp_data
[
'
7to30
'
].
suspended
,
sp_data
.
gt30
.
suspended
]
},
colors
:
[
'
#c23531
'
],
...
...
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml
View file @
a27ecf00
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
962.2574
2.4974.61781
</string>
</value>
<value>
<string>
962.2574
3.31377.26094
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
150660
5728.66
</float>
<float>
150660
6769.12
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py
View file @
a27ecf00
...
...
@@ -14,15 +14,15 @@ date_30_midnight = DateTime(str(date_30.year()) + "-" + str(date_30.month()) + "
support_request_list
=
portal
.
portal_catalog
(
portal_type
=
"Support Request"
,
modification_date
=
{
'query'
:
date_30_midnight
,
'range'
:
'nlt'
}
select_list
=
[
'simulation_state'
,
'modification_date'
]
)
count_by_state
=
{}
count_by_date
=
{
"le2"
:
{},
"2to7"
:
{},
"7to30"
:
{}}
count_by_date
=
{
"le2"
:
{},
"2to7"
:
{},
"7to30"
:
{}
,
"gt30"
:
{}
}
for
sr
in
support_request_list
:
sr_date
=
sr
.
get
ModificationDate
(
)
sr_state
=
sr
.
get
SimulationState
(
)
sr_date
=
sr
.
get
Property
(
"modification_date"
)
sr_state
=
sr
.
get
Property
(
"simulation_state"
)
if
sr_state
not
in
count_by_state
:
count_by_state
[
sr_state
]
=
0
...
...
@@ -35,8 +35,13 @@ for sr in support_request_list:
count_by_date
[
"le2"
][
sr_state
]
=
count_by_date
[
"le2"
][
sr_state
]
+
1
elif
sr_date
>=
date_7_midnight
:
count_by_date
[
"2to7"
][
sr_state
]
=
count_by_date
[
"2to7"
][
sr_state
]
+
1
el
se
:
el
if
sr_date
>=
date_30_midnight
:
count_by_date
[
"7to30"
][
sr_state
]
=
count_by_date
[
"7to30"
][
sr_state
]
+
1
else
:
count_by_date
[
"gt30"
][
sr_state
]
=
count_by_date
[
"gt30"
][
sr_state
]
+
1
if
sr_date
<
date_30_midnight
:
continue
count_by_state
[
sr_state
]
=
count_by_state
[
sr_state
]
+
1
...
...
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