Commit f4cc7c84 authored by Valentin Benozillo's avatar Valentin Benozillo Committed by Xiaowu Zhang

[erp5_officejs] Configurator can take multiple portal_type

parent a603cbfc
......@@ -9,6 +9,7 @@
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="jiodev.js"></script>
<script src="gadget_erp5_page_ojs_erp5_configurator.js"></script>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.5989.20580.56712</string> </value>
<value> <string>965.42364.3970.61457</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1501488569.98</float>
<float>1525101566.57</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, URI, navigator */
/*global window, rJS, RSVP, URI, SimpleQuery, ComplexQuery, Query, navigator */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP, URI, navigator) {
(function (window, rJS, RSVP, URI, SimpleQuery, ComplexQuery, Query, navigator) {
"use strict";
function setjIOERP5Configuration(gadget) {
......@@ -15,19 +15,38 @@
})
.push(function (result) {
var configuration = {},
portal_type = result[0],
jio_query_list = [],
attachment_synchro = result[1] !== "",
extended_attachment_url = result[1],
portal_type = result[0].split(','),
query = '',
i,
// https://bugs.chromium.org/p/chromium/issues/detail?id=375297
// mobile device memory is limited for blob,
// we reach this limit with parallel operation.
is_low_memory = (navigator.userAgent.indexOf("Chrome") > 0) &&
(navigator.userAgent.indexOf('Mobile') > 0);
for (i = 0; i < portal_type.length; i += 1) {
jio_query_list.push(new SimpleQuery({
key: "portal_type",
operator: "",
type: "simple",
value: portal_type[i]
}));
}
query = Query.objectToSearchText(new ComplexQuery({
operator: "OR",
query_list: jio_query_list,
type: "complex"
}));
configuration = {
type: "replicate",
// XXX This drop the signature lists...
query: {
query: 'portal_type:"' + portal_type + '"',
query: query,
limit: [0, 50],
sort_on: [["modification_date", "descending"]]
},
......@@ -236,4 +255,4 @@
});
});
}(window, rJS, RSVP, URI, navigator));
}(window, rJS, RSVP, URI, SimpleQuery, ComplexQuery, Query, navigator));
......@@ -259,7 +259,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>vincent</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -273,7 +273,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.1757.48193.16793</string> </value>
<value> <string>967.13533.35763.57446</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -291,7 +291,7 @@
</tuple>
<state>
<tuple>
<float>1516800617.44</float>
<float>1525102062.15</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