Commit 3d3228e0 authored by Roque Porchetto's avatar Roque Porchetto

erp5_wendelin_telecom_UI: fixing wrong urls in list items

parent f7bc26a3
......@@ -9,7 +9,7 @@
/////////////////////////////////////////////////////////////////
//.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -17,11 +17,21 @@
/*.allowPublicAcquisition('updateHeader', function () {
return;
})*/
.allowPublicAcquisition('getUrlFor', function (argument_list) {
if (argument_list[0].command === 'index') {
return this.getUrlFor({command: 'index', options: {jio_key: argument_list[0].options.jio_key, page: "data_set"}});
.allowPublicAcquisition('getUrlForList', function (argument_list) {
var i,
options_list = argument_list[0],
result_list = [];
for (i = 0; i < options_list.length; i += 1) {
if (options_list[i].command === 'index') {
result_list.push({
command: 'display_stored_state',
options: {jio_key: options_list[i].options.jio_key, page: "data_set"}
});
} else {
result_list.push(options_list[i]);
}
}
return this.getUrlFor.apply(this, argument_list);
return this.getUrlForList.apply(this, [result_list]);
})
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.23886.41625.38894</string> </value>
<value> <string>969.9069.22873.24849</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1529569007.15</float>
<float>1532525611.57</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -8,7 +8,7 @@
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -16,27 +16,22 @@
.allowPublicAcquisition('updateHeader', function () {
return;
})
.allowPublicAcquisition('getUrlFor', function (argument_list) {
if (argument_list[0].command === 'index') {
return this.getUrlFor({command: 'index', options: {jio_key: argument_list[0].options.jio_key, page: "file_fif"}});
}
return this.getUrlFor.apply(this, argument_list);
})
/*.allowPublicAcquisition('getUrlFor', function (argument_list) {
if (argument_list[0].command === 'index') {
return this.getUrlFor({command: 'display_stored_state', options: {jio_key: argument_list[0].options.jio_key}});
.allowPublicAcquisition('getUrlForList', function (argument_list) {
var i,
options_list = argument_list[0],
result_list = [];
for (i = 0; i < options_list.length; i += 1) {
if (options_list[i].command === 'index') {
result_list.push({
command: 'display_stored_state',
options: {jio_key: options_list[i].options.jio_key, page: "file_fif"}
});
} else {
result_list.push(options_list[i]);
}
}
return this.getUrlFor.apply(this, argument_list);
return this.getUrlForList.apply(this, [result_list]);
})
.allowPublicAcquisition('getUrlParameter', function (argument_list) {
return this.getUrlParameter(argument_list)
.push(function (result) {
if ((result === undefined) && (argument_list[0] === 'field_listbox_sort_list:json')) {
return [['title', 'ascending']];
}
return result;
});
})*/
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_list')
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.55613.28819.51438</string> </value>
<value> <string>969.6188.36317.22374</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1531386424.82</float>
<float>1532525619.7</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