Commit 32ca5e01 authored by Boxiang Sun's avatar Boxiang Sun

erp5_officejs_support_request_ui: New implementation.

parent 37a57752
#wrap1 iframe {
height: 100%;
}
#wrap2 iframe {
height: 100%;
}
#generate-rss {
padding: 8pt;
margin-top: 30pt;
margin-right: 12pt;
background-color: #FF6600;
color: #FFFFFF;
border-radius: 0.325em;
border-width: 1px;
border-style: solid;
min-width: 8em;
line-height: 1.5;
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_homepage.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_supportrequest_homepage_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget SupportRequest Homepage CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1503496717.49</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.39463.33273.62822</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1503504237.1</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1503496597.54</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<!-- custom script --> <!-- custom script -->
<script src="gadget_erp5_page_homepage.js" type="text/javascript"></script> <script src="gadget_erp5_page_homepage.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="gadget_erp5_pt_form_view_discussable.css"> <link rel="stylesheet" type="text/css" href="gadget_erp5_page_homepage.css">
</head> </head>
<body> <body>
......
...@@ -66,9 +66,7 @@ ...@@ -66,9 +66,7 @@
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple/>
<string>contributor/person_module/erp5_officejs_support_request_ui_test_person_002</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -236,7 +234,7 @@ ...@@ -236,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.39192.36126.39662</string> </value> <value> <string>961.39461.64521.8755</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +252,7 @@ ...@@ -254,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1503481031.13</float> <float>1503502469.82</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global document, window, Option, rJS, RSVP, Chart, loopEventListener*/ /*global document, window, Option, rJS, RSVP, Chart, loopEventListener, console*/
/*jslint nomen: true, indent: 2, maxerr: 150 */ /*jslint nomen: true, indent: 2, maxerr: 150 */
(function (window, rJS, RSVP, loopEventListener) { (function (window, rJS, RSVP, loopEventListener) {
"use strict"; "use strict";
...@@ -26,15 +26,16 @@ ...@@ -26,15 +26,16 @@
.allowPublicAcquisition("updateHeader", function () { .allowPublicAcquisition("updateHeader", function () {
return; return;
}) })
.declareMethod('getSearchCriteria', function(name, seriesName) { .declareMethod('getSearchCriteria', function (name, seriesName) {
console.log("In getSearchCriteria"); console.log("In getSearchCriteria");
var search_criteria; var search_criteria;
console.log(name, seriesName); console.log(name, seriesName);
if (seriesName != 'Support Request') { if (seriesName !== 'Support Request') {
var cur_mid_night = new Date(); var cur_mid_night = new Date(), begin_date, end_date,
days_2 = new Date(), days_7 = new Date(), days_30 = new Date();
cur_mid_night.setHours(0, 0, 0, 0); cur_mid_night.setHours(0, 0, 0, 0);
cur_mid_night.setDate(cur_mid_night.getDate() + 1); cur_mid_night.setDate(cur_mid_night.getDate() + 1);
var days_2 = new Date(), days_7 = new Date(), days_30 = new Date();
days_2.setDate(cur_mid_night.getDate() - 2); days_2.setDate(cur_mid_night.getDate() - 2);
days_7.setDate(cur_mid_night.getDate() - 7); days_7.setDate(cur_mid_night.getDate() - 7);
days_30.setDate(cur_mid_night.getDate() - 30); days_30.setDate(cur_mid_night.getDate() - 30);
...@@ -42,9 +43,9 @@ ...@@ -42,9 +43,9 @@
days_7.setHours(0, 0, 0, 0); days_7.setHours(0, 0, 0, 0);
days_30.setHours(0, 0, 0, 0); days_30.setHours(0, 0, 0, 0);
var begin_date, end_date;
if (name === 'Less than 2 days') { if (name === 'Less than 2 days') {
begin_date = days_2; begin_date = days_2;
cur_mid_night.setDate(cur_mid_night.getDate() + 1);
end_date = cur_mid_night; end_date = cur_mid_night;
} else if (name === '2-7 days') { } else if (name === '2-7 days') {
begin_date = days_7; begin_date = days_7;
...@@ -61,9 +62,8 @@ ...@@ -61,9 +62,8 @@
console.log(name); console.log(name);
console.log(end_date); console.log(end_date);
console.log(end_date.toISOString()); console.log(end_date.toISOString());
search_criteria = '( translated_simulation_state_title: "' + seriesName + '" AND modification_date: >= ' + begin_date.toISOString().slice(0,10) + ' AND modification_date: <= ' + end_date.toISOString().slice(0,10) + ' )'; search_criteria = '( translated_simulation_state_title: "' + seriesName + '" AND modification_date: >= ' + begin_date.toISOString().slice(0, 10) + ' AND modification_date: < ' + end_date.toISOString().slice(0, 10) + ' )';
} } else {
else {
search_criteria = '( translated_simulation_state_title: "' + name + '")'; search_criteria = '( translated_simulation_state_title: "' + name + '")';
} }
console.log("Search criteria: ", search_criteria); console.log("Search criteria: ", search_criteria);
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
.push(function () { .push(function () {
return gadget.changeState({ return gadget.changeState({
field_listbox_begin_from: options.field_listbox_begin_from field_listbox_begin_from: options.field_listbox_begin_from
}) });
}); });
}) })
.declareJob("renderGraph", function () { .declareJob("renderGraph", function () {
...@@ -230,8 +230,7 @@ ...@@ -230,8 +230,7 @@
title: "Support Request activites" title: "Support Request activites"
} }
} }
} });
);
}); });
}) })
...@@ -242,7 +241,7 @@ ...@@ -242,7 +241,7 @@
// render the erp5 listbox // render the erp5 listbox
queue queue
.push(function () { .push(function () {
return gadget.getDeclaredGadget("test") return gadget.getDeclaredGadget("test");
}) })
.push(function (result_list) { .push(function (result_list) {
var erp5_form = result_list, var erp5_form = result_list,
...@@ -258,7 +257,7 @@ ...@@ -258,7 +257,7 @@
// render the erp5 listbox // render the erp5 listbox
queue queue
.push(function () { .push(function () {
return gadget.getDeclaredGadget("test") return gadget.getDeclaredGadget("test");
}) })
.push(function (result_list) { .push(function (result_list) {
var erp5_form = result_list, var erp5_form = result_list,
...@@ -316,7 +315,7 @@ ...@@ -316,7 +315,7 @@
jio_key: "support_request_module", jio_key: "support_request_module",
view: test_href view: test_href
}), }),
gadget.renderGraph(), //Launched as service, not blocking gadget.renderGraph() //Launched as service, not blocking
]); ]);
}); });
} }
...@@ -325,7 +324,6 @@ ...@@ -325,7 +324,6 @@
console.log(error); console.log(error);
}); });
return queue; return queue;
//}) //})
}) })
.declareService(function () { .declareService(function () {
...@@ -339,18 +337,17 @@ ...@@ -339,18 +337,17 @@
return gadget.jio_getAttachment( return gadget.jio_getAttachment(
'support_request_module', 'support_request_module',
hateoas_url + 'support_request_module' hateoas_url + 'support_request_module'
+ "/SupportRequestModule_getRSSWithToken" + "/SupportRequestModule_getRSSLinkAsJson"
) )
.push(function (result) { .push(function (result) {
rss_button.href = result.restricted_access_url; rss_button.href = result.restricted_access_url;
rss_button.innerHTML = "RSS Link"; rss_button.innerHTML = "RSS Link";
rss_button.target = "_blank"; rss_button.target = "_blank";
}) });
}) });
} }
click_event.returnValue = true; click_event.returnValue = true;
} }
// Listen to form submit // Listen to form submit
return loopEventListener( return loopEventListener(
gadget.element.querySelector("#generate-rss"), gadget.element.querySelector("#generate-rss"),
...@@ -386,8 +383,7 @@ ...@@ -386,8 +383,7 @@
} }
}, false, false) }, false, false)
.onEvent('submit', function () { .onEvent('submit', function () {
var curElement = document.activeElement; var curElement = document.activeElement, gadget = this;
var gadget = this;
if (curElement.name === 'restore') { if (curElement.name === 'restore') {
console.log("Restore button cliked!"); console.log("Restore button cliked!");
} else if (curElement.name === 'create') { } else if (curElement.name === 'create') {
......
...@@ -66,9 +66,7 @@ ...@@ -66,9 +66,7 @@
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple/>
<string>contributor/person_module/erp5_officejs_support_request_ui_test_person_002</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -238,7 +236,7 @@ ...@@ -238,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.39351.42999.18875</string> </value> <value> <string>961.39594.58186.7577</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +254,7 @@ ...@@ -256,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1503490171.57</float> <float>1503504898.37</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
hr#post_item { hr#post_item {
border-color: #0E81C2; border-color: #0E81C2;
} }
#wrap1 iframe {
height: 100%;
}
#wrap2 iframe {
height: 100%;
}
#generate-rss {
padding: 8pt;
margin-top: 30pt;
margin-right: 12pt;
background-color: #FF6600;
color: #FFFFFF;
border-radius: 0.325em;
border-width: 1px;
border-style: solid;
min-width: 8em;
line-height: 1.5;
}
\ No newline at end of file
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.38112.35462.38963</string> </value> <value> <string>961.39462.18361.64392</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1503418576.4</float> <float>1503496700.14</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SupportRequest_getNexediJSLink</string> </value> <value> <string>SupportRequestModule_getRSSLinkAsJson</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -438,16 +438,7 @@ ...@@ -438,16 +438,7 @@
<item> <item>
<key> <string>sort_columns</string> </key> <key> <string>sort_columns</string> </key>
<value> <value>
<list> <list/>
<tuple>
<string>post_start_date_hidden</string>
<string>Comment Date</string>
</tuple>
<tuple>
<string>post_start_date</string>
<string>Comment Date</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: cell.SupportRequest_getNexediJSLink()</string> </value> <value> <string>python: cell.SupportRequest_getSupportRequestLink()</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SupportRequestModule_getRSSWithToken</string> </value> <value> <string>SupportRequest_getSupportRequestLink</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment