Commit ae08abf1 authored by Roque's avatar Roque

erp5_web_project_ui: refactoring and support requests

parent da86f6d1
...@@ -12,12 +12,15 @@ ...@@ -12,12 +12,15 @@
const TOTAL_SPAN = "total"; const TOTAL_SPAN = "total";
const OUTDATED_SPAN = "outdated"; const OUTDATED_SPAN = "outdated";
const QUERY_LIMIT = 100000; const QUERY_LIMIT = 100000;
//XXX hardcoded portal_type-title dict (build a template?) //XXX hardcoded portal_types, states and titles dict (build a template?)
const PORTAL_TITLE_DICT = {"Task": "Tasks", const PORTAL_TITLE_DICT = {"Task": "Tasks",
"Test Result" : "Test Results", "Test Result" : "Test Results",
"Bug" : "Bugs", "Bug" : "Bugs",
"Project Milestone" : "Milestones", "Project Milestone" : "Milestones",
"Task Report": "Task Reports"}; "Task Report": "Task Reports",
"Support Request" : "Support Requests"};
const PORTAL_TYPE_LIST = ["Task", "Bug", "Task Report", "Support Request"];
const VALID_STATE_LIST = ["planned", "auto_planned", "ordered", "confirmed", "ready", "stopped", "started", "submitted", "validated"];
function getProjectId(id) { function getProjectId(id) {
var segments = id.split("/"); var segments = id.split("/");
...@@ -55,17 +58,15 @@ ...@@ -55,17 +58,15 @@
} }
function getProjectDocumentList(gadget, limit_date) { function getProjectDocumentList(gadget, limit_date) {
var document_query, var document_query;
portal_type_list = ["Task", "Bug", "Task Report"],
valid_state_list = ["planned", "auto_planned", "ordered", "confirmed", "ready", "stopped", "started"];
document_query = Query.objectToSearchText(new SimpleQuery({ document_query = Query.objectToSearchText(new SimpleQuery({
key: "source_project__validation_state", key: "source_project__validation_state",
operator: "=", operator: "=",
type: "simple", type: "simple",
value: "validated" value: "validated"
})); }));
document_query += ' AND simulation_state: ("' + valid_state_list.join('", "') + '")'; document_query += ' AND simulation_state: ("' + VALID_STATE_LIST.join('", "') + '")';
document_query += ' AND portal_type: ("' + portal_type_list.join('", "') + '")'; document_query += ' AND portal_type: ("' + PORTAL_TYPE_LIST.join('", "') + '")';
if (limit_date) { if (limit_date) {
document_query += ' AND modification_date: < "' + limit_date + '"'; document_query += ' AND modification_date: < "' + limit_date + '"';
} }
...@@ -305,7 +306,6 @@ ...@@ -305,7 +306,6 @@
"AND")), "AND")),
test_state_list = ["failed", "stopped", "public_stopped"]; test_state_list = ["failed", "stopped", "public_stopped"];
test_result_query += ' AND simulation_state: ("' + test_state_list.join('", "') + '")'; test_result_query += ' AND simulation_state: ("' + test_state_list.join('", "') + '")';
return gadget.jio_allDocs({ return gadget.jio_allDocs({
query: test_result_query, query: test_result_query,
limit: QUERY_LIMIT, limit: QUERY_LIMIT,
......
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