diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js index 02cd645184f4e142035eb124c51e745701667b9e..fc5e7d1b40ac8398961179da283eb3800ef9c69f 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js @@ -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'], diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml index fca68633d6f8e3f9a8d1da242fb7f8873acd771e..fa95f7dc9a9fcad9b656ceee4d9a2d8a78e07666 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml @@ -236,7 +236,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>962.25742.4974.61781</string> </value> + <value> <string>962.25743.31377.26094</string> </value> </item> <item> <key> <string>state</string> </key> @@ -254,7 +254,7 @@ </tuple> <state> <tuple> - <float>1506605728.66</float> + <float>1506606769.12</float> <string>UTC</string> </tuple> </state> diff --git a/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py index ddf0a4371a0edd4f1e45ff601d57aaff75f82a40..c16cc5e043c6216515dbd44fe67ee6ed3618c0e3 100644 --- a/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py +++ b/bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py @@ -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.getModificationDate() - sr_state = sr.getSimulationState() + sr_date = sr.getProperty("modification_date") + sr_state = sr.getProperty("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 - else: + 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_state[sr_state] = count_by_state[sr_state] + 1