Commit 2712a770 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_web_renderjs_ui: few improvements

parent 8f5c527d
......@@ -160,35 +160,66 @@
return gadget.getUrlParameter('extended_search')
.push(function (extended_search) {
var query,
extended_search_domain_list = [];
if (extended_search) {
jio_query_list.push(Query.parseStringToObject(extended_search));
query = Query.parseStringToObject(extended_search);
if (query.type === "complex") {
for (i = 0; i < query.query_list.length; i += 1) {
if (query.query_list[i].key.indexOf("selection_domain_") === 0) {
extended_search_domain_list.push(query.query_list[i]);
} else {
jio_query_list.push(new SimpleQuery(query.query_list[i]));
}
}
} else {
jio_query_list.push(new SimpleQuery(query));
}
}
if (domain_id) {
domain_list = options.layout.x.domain_list || [];
for (i = 0; i < domain_list.length; i += 1) {
sub_query_list = [];
data.extended_search_mapping[column_list[i]] = {
"key": "selection_domain_" + domain_id,
"value": domain_list[i]
};
sub_query_list.push(new SimpleQuery({
key: "selection_domain_" + domain_id,
operator: "",
type: "simple",
value: domain_list[i]
}));
query_list.push({
"query": Query.objectToSearchText(new ComplexQuery({
operator: "AND",
query_list: jio_query_list.concat(sub_query_list),
type: "complex"
})),
"list_method_template": options.list_method_template,
"list_method": options.list_method,
"relative_url": options.relative_url,
"group_by": group_by,
"select_list": select_list
});
sub_query_list = [];
if (extended_search_domain_list.length > 0) {
for (j = 0; j < extended_search_domain_list.length; j += 1) {
if (extended_search_domain_list[j].key === "selection_domain_" + domain_id &&
extended_search_domain_list[j].value === domain_list[i]) {
sub_query_list.push(new SimpleQuery({
key: extended_search_domain_list[j].key,
operator: "",
type: "simple",
value: extended_search_domain_list[j].value
}));
}
}
} else {
sub_query_list.push(new SimpleQuery({
key: "selection_domain_" + domain_id,
operator: "",
type: "simple",
value: domain_list[i]
}));
}
if (sub_query_list.length > 0) {
query_list.push({
"query": Query.objectToSearchText(new ComplexQuery({
operator: "AND",
query_list: jio_query_list.concat(sub_query_list),
type: "complex"
})),
"list_method_template": options.list_method_template,
"list_method": options.list_method,
"relative_url": options.relative_url,
"group_by": group_by,
"select_list": select_list
});
}
}
data.query_list = query_list;
} else if (group_by instanceof Array && group_by.length > 1) {
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>997.50503.16089.7338</string> </value>
<value> <string>997.52346.20864.10120</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1643288573.04</float>
<float>1643321915.13</float>
<string>UTC</string>
</tuple>
</state>
......
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