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
......@@ -17,7 +17,7 @@
<!-- custom 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>
<body>
......
......@@ -66,9 +66,7 @@
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>contributor/person_module/erp5_officejs_support_request_ui_test_person_002</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......@@ -236,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.39192.36126.39662</string> </value>
<value> <string>961.39461.64521.8755</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1503481031.13</float>
<float>1503502469.82</float>
<string>UTC</string>
</tuple>
</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 */
(function (window, rJS, RSVP, loopEventListener) {
"use strict";
......@@ -26,15 +26,16 @@
.allowPublicAcquisition("updateHeader", function () {
return;
})
.declareMethod('getSearchCriteria', function(name, seriesName) {
.declareMethod('getSearchCriteria', function (name, seriesName) {
console.log("In getSearchCriteria");
var search_criteria;
console.log(name, seriesName);
if (seriesName != 'Support Request') {
var cur_mid_night = new Date();
if (seriesName !== 'Support Request') {
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.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_7.setDate(cur_mid_night.getDate() - 7);
days_30.setDate(cur_mid_night.getDate() - 30);
......@@ -42,9 +43,9 @@
days_7.setHours(0, 0, 0, 0);
days_30.setHours(0, 0, 0, 0);
var begin_date, end_date;
if (name === 'Less than 2 days') {
begin_date = days_2;
cur_mid_night.setDate(cur_mid_night.getDate() + 1);
end_date = cur_mid_night;
} else if (name === '2-7 days') {
begin_date = days_7;
......@@ -61,9 +62,8 @@
console.log(name);
console.log(end_date);
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) + ' )';
}
else {
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 {
search_criteria = '( translated_simulation_state_title: "' + name + '")';
}
console.log("Search criteria: ", search_criteria);
......@@ -96,7 +96,7 @@
.push(function () {
return gadget.changeState({
field_listbox_begin_from: options.field_listbox_begin_from
})
});
});
})
.declareJob("renderGraph", function () {
......@@ -230,8 +230,7 @@
title: "Support Request activites"
}
}
}
);
});
});
})
......@@ -242,7 +241,7 @@
// render the erp5 listbox
queue
.push(function () {
return gadget.getDeclaredGadget("test")
return gadget.getDeclaredGadget("test");
})
.push(function (result_list) {
var erp5_form = result_list,
......@@ -258,7 +257,7 @@
// render the erp5 listbox
queue
.push(function () {
return gadget.getDeclaredGadget("test")
return gadget.getDeclaredGadget("test");
})
.push(function (result_list) {
var erp5_form = result_list,
......@@ -316,7 +315,7 @@
jio_key: "support_request_module",
view: test_href
}),
gadget.renderGraph(), //Launched as service, not blocking
gadget.renderGraph() //Launched as service, not blocking
]);
});
}
......@@ -325,7 +324,6 @@
console.log(error);
});
return queue;
//})
})
.declareService(function () {
......@@ -339,18 +337,17 @@
return gadget.jio_getAttachment(
'support_request_module',
hateoas_url + 'support_request_module'
+ "/SupportRequestModule_getRSSWithToken"
+ "/SupportRequestModule_getRSSLinkAsJson"
)
.push(function (result) {
rss_button.href = result.restricted_access_url;
rss_button.innerHTML = "RSS Link";
rss_button.target = "_blank";
})
})
});
});
}
click_event.returnValue = true;
}
// Listen to form submit
return loopEventListener(
gadget.element.querySelector("#generate-rss"),
......@@ -386,8 +383,7 @@
}
}, false, false)
.onEvent('submit', function () {
var curElement = document.activeElement;
var gadget = this;
var curElement = document.activeElement, gadget = this;
if (curElement.name === 'restore') {
console.log("Restore button cliked!");
} else if (curElement.name === 'create') {
......
......@@ -66,9 +66,7 @@
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>contributor/person_module/erp5_officejs_support_request_ui_test_person_002</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......@@ -238,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.39351.42999.18875</string> </value>
<value> <string>961.39594.58186.7577</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1503490171.57</float>
<float>1503504898.37</float>
<string>UTC</string>
</tuple>
</state>
......
hr#post_item {
border-color: #0E81C2;
}
\ No newline at end of file
#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 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.38112.35462.38963</string> </value>
<value> <string>961.39462.18361.64392</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1503418576.4</float>
<float>1503496700.14</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SupportRequest_getNexediJSLink</string> </value>
<value> <string>SupportRequestModule_getRSSLinkAsJson</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -438,16 +438,7 @@
<item>
<key> <string>sort_columns</string> </key>
<value>
<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>
<list/>
</value>
</item>
<item>
......
......@@ -116,7 +116,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.SupportRequest_getNexediJSLink()</string> </value>
<value> <string>python: cell.SupportRequest_getSupportRequestLink()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SupportRequestModule_getRSSWithToken</string> </value>
<value> <string>SupportRequest_getSupportRequestLink</string> </value>
</item>
</dictionary>
</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