Commit 500f1ad5 authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Tomáš Peterka

[renderjs_ui] Allow "export" and "print" actions everywhere

parent 17c1341e
......@@ -67,19 +67,20 @@
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
var gadget = this,
erp5_document,
report_list,
print_list;
erp5_document;
// Get the whole view as attachment because actions can change based on
// what view we are at. If no view available than fallback to "links".
return gadget.jio_getAttachment(options.jio_key, options.view || "links")
.push(function (result) {
var export_list = ensureArray(result._links.action_object_jio_exchange),
report_list = ensureArray(result._links.action_object_jio_report),
print_list = ensureArray(result._links.action_object_jio_print);
erp5_document = result;
report_list = ensureArray(erp5_document._links.action_object_jio_report),
print_list = ensureArray(erp5_document._links.action_object_jio_print);
return RSVP.all([
renderLinkList(gadget, "Export", "exchange", export_list),
renderLinkList(gadget, "Reports", "bar-chart-o", report_list),
renderLinkList(gadget, "Print", "print", print_list)
]);
......
......@@ -185,7 +185,7 @@
</tuple>
<state>
<tuple>
<float>1489072592.51</float>
<float>1519748965.0</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -101,7 +101,9 @@
new_content_action,
form_gadget.getUrlFor({command: 'change', options: {page: "action"}}),
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_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)
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.11893.45662.8840</string> </value>
<value> <string>965.51066.14142.56217</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1517476487.28</float>
<float>1519825040.18</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -96,6 +96,7 @@
calculatePageTitle(form_gadget, form_gadget.state.erp5_document),
form_gadget.isDesktopMedia(),
(form_gadget.state.erp5_document._links.action_object_jio_report ||
form_gadget.state.erp5_document._links.action_object_jio_exchange ||
form_gadget.state.erp5_document._links.action_object_jio_print) ?
form_gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
""
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.42541.60712.40362</string> </value>
<value> <string>965.51052.62661.21777</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1519237391.73</float>
<float>1519826231.82</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -102,6 +102,7 @@
gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
(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) ?
gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"",
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.24991.31929.23654</string> </value>
<value> <string>965.40945.8646.64034</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1518620258.94</float>
<float>1519662748.36</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