Commit 90e26225 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Form view editable: use getUrlForList

parent abc8008c
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
rJS(window) rJS(window)
.declareAcquiredMethod("submitContent", "submitContent") .declareAcquiredMethod("submitContent", "submitContent")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("notifyChange", "notifyChange") .declareAcquiredMethod("notifyChange", "notifyChange")
...@@ -79,46 +79,49 @@ ...@@ -79,46 +79,49 @@
// render the header // render the header
.push(function () { .push(function () {
return RSVP.all([ var url_for_parameter_list = [
gadget.getUrlFor({command: 'change', options: {page: "tab"}}), {command: 'change', options: {page: "tab"}},
gadget.getUrlFor({command: 'change', options: {page: "action"}}), {command: 'change', options: {page: "action"}},
gadget.state.erp5_document._links.action_object_new_content_action ? {command: 'history_previous'},
gadget.getUrlFor({command: 'change', options: { {command: 'selection_previous'},
{command: 'selection_next'},
{command: 'change', options: {page: "export"}}
];
if (gadget.state.erp5_document._links.action_object_new_content_action) {
url_for_parameter_list.push({command: 'change', options: {
view: gadget.state.erp5_document._links.action_object_new_content_action.href, view: gadget.state.erp5_document._links.action_object_new_content_action.href,
editable: true editable: true
}}) : }});
"", }
gadget.getUrlFor({command: 'history_previous'}), return RSVP.all([
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}),
calculatePageTitle(gadget, gadget.state.erp5_document), calculatePageTitle(gadget, gadget.state.erp5_document),
gadget.isDesktopMedia(), gadget.isDesktopMedia(),
(gadget.state.erp5_document._links.action_object_jio_report || gadget.getUrlParameter('selection_index'),
gadget.state.erp5_document._links.action_object_jio_exchange || gadget.getUrlForList(url_for_parameter_list)
gadget.state.erp5_document._links.action_object_jio_print) ?
gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"",
gadget.getUrlParameter('selection_index')
]); ]);
}) })
.push(function (all_result) { .push(function (result_list) {
var header_dict = { var url_list = result_list[3],
tab_url: all_result[0], header_dict = {
actions_url: all_result[1], tab_url: url_list[0],
add_url: all_result[2], actions_url: url_list[1],
selection_url: all_result[3], add_url: url_list[6] || '',
selection_url: url_list[2],
// Only display previous/next links if url has a selection_index, // Only display previous/next links if url has a selection_index,
// ie, if we can paginate the result list of the search // ie, if we can paginate the result list of the search
previous_url: all_result[9] ? all_result[4] : '', previous_url: result_list[2] ? url_list[3] : '',
next_url: all_result[9] ? all_result[5] : '', next_url: result_list[2] ? url_list[4] : '',
page_title: all_result[6] page_title: result_list[0]
}, };
is_desktop = all_result[7];
if (gadget.state.save_action === true) { if (gadget.state.save_action === true) {
header_dict.save_action = true; header_dict.save_action = true;
} }
if (is_desktop) { if (result_list[1]) {
header_dict.export_url = all_result[8]; header_dict.export_url = (
gadget.state.erp5_document._links.action_object_jio_report ||
gadget.state.erp5_document._links.action_object_jio_exchange ||
gadget.state.erp5_document._links.action_object_jio_print
) ? url_list[5] : '';
} }
return gadget.updateHeader(header_dict); return gadget.updateHeader(header_dict);
}); });
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.7721.48108.61320</string> </value> <value> <string>971.20564.48309.33399</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>1540991725.13</float> <float>1540995384.96</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