Commit 3e2a73df authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Form list: use getUrlForList

parent 90e26225
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// Acquired methods // Acquired methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter") .declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("renderEditorPanel", "renderEditorPanel") .declareAcquiredMethod("renderEditorPanel", "renderEditorPanel")
...@@ -89,36 +89,40 @@ ...@@ -89,36 +89,40 @@
// render the header // render the header
.push(function () { .push(function () {
var new_content_action = form_gadget.state.erp5_document._links.action_object_new_content_action; var new_content_action = form_gadget.state.erp5_document._links.action_object_new_content_action,
url_for_parameter_list = [
{command: 'change', options: {page: "action"}},
{command: 'display', options: {}},
{command: 'change', options: {page: "export"}}
];
if (new_content_action !== undefined) { if (new_content_action !== undefined) {
new_content_action = form_gadget.getUrlFor({command: 'change', options: {view: new_content_action.href, editable: true}}); url_for_parameter_list.push({command: 'change', options: {
} else { view: new_content_action.href,
new_content_action = ""; editable: true
}});
} }
return RSVP.all([ return RSVP.all([
new_content_action, calculatePageTitle(form_gadget, form_gadget.state.erp5_document),
form_gadget.getUrlFor({command: 'change', options: {page: "action"}}), form_gadget.getUrlForList(url_for_parameter_list)
form_gadget.getUrlFor({command: 'display', options: {}}),
(form_gadget.state.erp5_document._links.action_object_jio_report ||
form_gadget.state.erp5_document._links.action_object_jio_print ||
form_gadget.state.erp5_document._links.action_object_jio_exchange) ?
form_gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"",
calculatePageTitle(form_gadget, form_gadget.state.erp5_document)
]); ]);
}) })
.push(function (all_gadget) { .push(function (result_list) {
var url_list = result_list[1];
return form_gadget.updateHeader({ return form_gadget.updateHeader({
panel_action: true, panel_action: true,
jump_url: "", jump_url: "",
fast_input_url: "", fast_input_url: "",
add_url: all_gadget[0], add_url: url_list[3] || '',
actions_url: all_gadget[1], actions_url: url_list[0],
export_url: all_gadget[3], export_url: (
page_title: all_gadget[4], form_gadget.state.erp5_document._links.action_object_jio_report ||
front_url: all_gadget[2], form_gadget.state.erp5_document._links.action_object_jio_print ||
form_gadget.state.erp5_document._links.action_object_jio_exchange
) ? url_list[2] : '',
page_title: result_list[0],
front_url: url_list[1],
filter_action: true filter_action: true
}); });
}); });
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>966.8130.3423.18312</string> </value> <value> <string>971.20638.49773.13568</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1526654620.37</float> <float>1540997693.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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