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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
848c28eb
Commit
848c28eb
authored
Sep 27, 2017
by
Boxiang Sun
Committed by
Tristan Cavelier
Sep 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_support_request_ui: Drop the SR which more than 30 days.
parent
2d47c86f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
22 deletions
+17
-22
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js
...Item/web_page_module/gadget_supportrequest_homepage_js.js
+6
-9
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
+9
-11
No files found.
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js
View file @
848c28eb
...
...
@@ -153,12 +153,11 @@
data
:
[
{
value_dict
:
{
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
,
"
> 30
"
],
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
],
1
:
[
sp_data
.
le2
.
validated
,
sp_data
[
'
2to7
'
].
validated
,
sp_data
[
'
7to30
'
].
validated
,
sp_data
.
gt30
.
validated
sp_data
[
'
7to30
'
].
validated
]
},
colors
:
[
'
#d48265
'
],
...
...
@@ -167,12 +166,11 @@
},
{
value_dict
:
{
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
,
"
> 30
"
],
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
],
1
:
[
sp_data
.
le2
.
submitted
,
sp_data
[
'
2to7
'
].
submitted
,
sp_data
[
'
7to30
'
].
submitted
,
sp_data
.
gt30
.
submitted
sp_data
[
'
7to30
'
].
submitted
]
},
colors
:
[
'
#61a0a8
'
],
...
...
@@ -181,12 +179,11 @@
},
{
value_dict
:
{
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
,
"
> 30
"
],
0
:
[
"
< 2
"
,
"
2-7
"
,
"
7-30
"
],
1
:
[
sp_data
.
le2
.
suspended
,
sp_data
[
'
2to7
'
].
suspended
,
sp_data
[
'
7to30
'
].
suspended
,
sp_data
.
gt30
.
suspended
sp_data
[
'
7to30
'
].
suspended
]
},
colors
:
[
'
#c23531
'
],
...
...
bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml
View file @
848c28eb
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
962.
17232.34531.58794
</string>
</value>
<value>
<string>
962.
23501.9134.29371
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
1506
095076.51
</float>
<float>
1506
471192.27
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py
View file @
848c28eb
...
...
@@ -2,11 +2,6 @@ from json import dumps
portal
=
context
.
getPortalObject
()
support_request_list
=
portal
.
portal_catalog
(
portal_type
=
"Support Request"
)
count_by_state
=
{}
count_by_date
=
{
"le2"
:
{},
"2to7"
:
{},
"7to30"
:
{},
"gt30"
:
{}}
# Get the split date
now_date
=
DateTime
()
date_2
=
now_date
-
2
...
...
@@ -17,6 +12,13 @@ date_2_midnight = DateTime(str(date_2.year()) + "-" + str(date_2.month()) + "-"
date_7_midnight
=
DateTime
(
str
(
date_7
.
year
())
+
"-"
+
str
(
date_7
.
month
())
+
"-"
+
str
(
date_7
.
day
()))
date_30_midnight
=
DateTime
(
str
(
date_30
.
year
())
+
"-"
+
str
(
date_30
.
month
())
+
"-"
+
str
(
date_30
.
day
()))
support_request_list
=
portal
.
portal_catalog
(
portal_type
=
"Support Request"
,
modification_date
=
{
'query'
:
date_30_midnight
,
'range'
:
'nlt'
}
)
count_by_state
=
{}
count_by_date
=
{
"le2"
:
{},
"2to7"
:
{},
"7to30"
:
{}}
for
sr
in
support_request_list
:
sr_date
=
sr
.
getModificationDate
()
...
...
@@ -33,13 +35,9 @@ 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
elif
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_date
[
"7to30"
][
sr_state
]
=
count_by_date
[
"7to30"
][
sr_state
]
+
1
count_by_state
[
sr_state
]
=
count_by_state
[
sr_state
]
+
1
result
=
{}
...
...
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