Commit ae2c774a authored by Romain Courteaud's avatar Romain Courteaud

[erp5_officejs_afs_directory] Add compatibility with getCommandUrlForList

parent 35545b63
......@@ -16,6 +16,32 @@
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('getCommandUrlForList', function (options_list) {
var i,
result_list = [],
dict,
key,
portal;
for (i = 0; i < options_list.length; i += 1) {
dict = options_list[i];
// XXX better way than to extract from query like this?
if (dict.command === "index") {
key = dict.options.jio_key;
portal = dict.options.query.split(":")[1].split('"')[1];
result_list.push("#/" + key + "?page=afs_" + portal + "&view=view");
}
}
if (result_list.length) {
return result_list;
}
return this.getDeclaredGadget("router")
.push(function (router) {
return router.getCommandUrlForList.apply(router, [options_list]);
});
})
.declareMethod('getCommandUrlFor', function () {
var argument_list = arguments,
dict = argument_list[0],
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.35816.29349.45448</string> </value>
<value> <string>967.46163.46553.15650</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1514901992.66</float>
<float>1526973372.8</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