Commit cf4fd2b0 authored by Tomáš Peterka's avatar Tomáš Peterka

[erp5_core + xhtml + rjs + tests] Add new REPORT action type object_jio_report to be consistent

Old action type "object_report_jio" will still appear in both UIs and will work until the end of 2017.
Please note that after upgrade it is necessary to change object_report_jio to object_jio_report.
parent 8072877f
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_report_jio</string> <string>action_type/object_jio_report</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_report_jio</string> </value> <value> <string>object_jio_report</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_report_jio</string> <string>action_type/object_jio_report</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_report_jio</string> </value> <value> <string>object_jio_report</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -80,7 +80,8 @@ ...@@ -80,7 +80,8 @@
return gadget.jio_getAttachment(options.jio_key, "links") return gadget.jio_getAttachment(options.jio_key, "links")
.push(function (result) { .push(function (result) {
erp5_document = result; erp5_document = result;
report_list = asArray(erp5_document._links.action_object_report_jio); report_list = asArray(erp5_document._links.action_object_report_jio)
.concat(asArray(erp5_document._links.action_object_jio_report));
return RSVP.all([ return RSVP.all([
renderLinkList(gadget, "Reports", "bar-chart-o", report_list, true) renderLinkList(gadget, "Reports", "bar-chart-o", report_list, true)
......
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
new_content_action, new_content_action,
form_gadget.getUrlFor({command: 'change', options: {page: "action"}}), form_gadget.getUrlFor({command: 'change', options: {page: "action"}}),
form_gadget.getUrlFor({command: 'display', options: {}}), form_gadget.getUrlFor({command: 'display', options: {}}),
form_gadget.state.erp5_document._links.action_object_report_jio ? form_gadget.state.erp5_document._links.action_object_report_jio || form_gadget.state.erp5_document._links.action_object_jio_report ?
form_gadget.getUrlFor({command: 'change', options: {page: "export"}}) : form_gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"", "",
calculatePageTitle(form_gadget, form_gadget.state.erp5_document) calculatePageTitle(form_gadget, form_gadget.state.erp5_document)
......
...@@ -77,8 +77,9 @@ ...@@ -77,8 +77,9 @@
form_options.form_definition = gadget.state.form_definition; form_options.form_definition = gadget.state.form_definition;
form_options.view = gadget.state.view; form_options.view = gadget.state.view;
form_options.jio_key = gadget.state.jio_key; form_options.jio_key = gadget.state.jio_key;
form_options.editable = 0; form_options.editable = 0; // because for editable=1 there is a special
// page template 'pt_form_editable'. Once it is
// is removed, this 0 should turn into gadget.state.editable
return erp5_form.render(form_options); return erp5_form.render(form_options);
}) })
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
gadget.getUrlFor({command: 'selection_previous'}), gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'}), gadget.getUrlFor({command: 'selection_next'}),
gadget.getUrlFor({command: 'change', options: {page: "tab"}}), gadget.getUrlFor({command: 'change', options: {page: "tab"}}),
gadget.state.erp5_document._links.action_object_report_jio ? gadget.state.erp5_document._links.action_object_report_jio || gadget.state.erp5_document._links.action_object_jio_report ?
gadget.getUrlFor({command: 'change', options: {page: "export"}}) : gadget.getUrlFor({command: 'change', options: {page: "export"}}) :
"", "",
calculatePageTitle(gadget, gadget.state.erp5_document) calculatePageTitle(gadget, gadget.state.erp5_document)
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</tr> </tr>
<!-- Header has a link to the export page <!-- Header has a link to the export page
Here, we assume that portal_types/Bar%20Module has no object_report_jio --> Here, we assume that portal_types/Bar%20Module has no Object JIO Report Action -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@class, 'ui-disabled')]</td> <td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@class, 'ui-disabled')]</td>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</tr> </tr>
<!-- Header has a link to the export page <!-- Header has a link to the export page
Here we assume that portal_types/Foo%20Module has at least one object_report_jio --> Here we assume that portal_types/Foo%20Module has at least one Object JIO Report Action -->
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@href, '#!change') and contains(@href, 'n.page=export')]</td> <td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@href, '#!change') and contains(@href, 'n.page=export')]</td>
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</tr> </tr>
<!-- Header has a link to the export page <!-- Header has a link to the export page
Here, we assume that portal_types/Bar has no object_report_jio --> Here, we assume that portal_types/Bar has no Object JIO Report Action -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@class, 'ui-disabled')]</td> <td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@class, 'ui-disabled')]</td>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</tr> </tr>
<!-- Header has a link to the export page <!-- Header has a link to the export page
Here, we assume that portal_types/Foo has at least one object_report_jio --> Here, we assume that portal_types/Foo has at least one Object JIO Report Action -->
<tr> <tr>
<td>assertElementPresent</td> <td>assertElementPresent</td>
<td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@href, '#!change') and contains(@href, 'n.page=export')]</td> <td>//div[@data-gadget-scope='header']//a[text()='Export' and contains(@href, '#!change') and contains(@href, 'n.page=export')]</td>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</tr> </tr>
<!-- Wait for gadget to be loaded <!-- Wait for gadget to be loaded
Here we assume portal_types/Foo has at least one object_report_jio --> Here we assume portal_types/Foo has at least one Object JIO Report Action -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</tr> </tr>
<!-- Wait for gadget to be loaded <!-- Wait for gadget to be loaded
Here we assume portal_types/Foo has at least one object_report_jio --> Here we assume portal_types/Foo has at least one Object JIO Report Action -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</tr> </tr>
<!-- Wait for gadget to be loaded <!-- Wait for gadget to be loaded
Here we assume portal_types/Foo has at least one object_report_jio --> Here we assume portal_types/Foo has at least one Object JIO Report Action -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</tr> </tr>
<!-- Wait for gadget to be loaded <!-- Wait for gadget to be loaded
Here we assume portal_types/Foo has at least one object_report_jio --> Here we assume portal_types/Foo has at least one Object JIO Report Action -->
<tr> <tr>
<td>waitForElementPresent</td> <td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td> <td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_export.html']</td>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_report</string>
<string>action_type/object_jio_report</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>object_jio_report</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>object_jio_report</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -4,7 +4,8 @@ actions that does not provide one. ...@@ -4,7 +4,8 @@ actions that does not provide one.
from Products.PythonScripts.standard import url_quote from Products.PythonScripts.standard import url_quote
if dialog_category == 'object_report': if dialog_category == 'object_report':
return sorted(actions.get('object_report', []) + actions.get('object_report_jio', []), key=lambda x: x["priority"]) # XXX 01/01/2018 remove 'object_report_jio' because it is deprecated since 4/10/2017
return sorted(actions.get('object_report', []) + actions.get('object_report_jio', []) + actions.get('object_jio_report', []), key=lambda x: x["priority"])
elif dialog_category == 'object_exchange': elif dialog_category == 'object_exchange':
return sorted(actions.get('object_exchange', []) + actions.get('object_exchange_jio', []), key=lambda x: x["priority"]) return sorted(actions.get('object_exchange', []) + actions.get('object_exchange_jio', []), key=lambda x: x["priority"])
elif dialog_category == 'object_action': elif dialog_category == 'object_action':
......
...@@ -103,7 +103,8 @@ ...@@ -103,7 +103,8 @@
exchange_actions actions/object_exchange | nothing; exchange_actions actions/object_exchange | nothing;
exchange_jio_actions actions/object_exchange_jio | nothing; exchange_jio_actions actions/object_exchange_jio | nothing;
report_actions actions/object_report | nothing; report_actions actions/object_report | nothing;
report_jio_actions actions/object_report_jio | nothing; report_jio_actions actions/object_jio_report | nothing;
report_jio_actions_deprecated actions/object_report_jio | nothing;
button_actions actions/object_button | nothing; button_actions actions/object_button | nothing;
fast_input_actions actions/object_fast_input | nothing; fast_input_actions actions/object_fast_input | nothing;
fast_input_jio_actions actions/object_fast_input_jio | nothing; fast_input_jio_actions actions/object_fast_input_jio | nothing;
...@@ -223,7 +224,7 @@ ...@@ -223,7 +224,7 @@
<span class="image"></span> <span class="image"></span>
<span class="description" i18n:translate="" i18n:domain="ui">Import / Export</span> <span class="description" i18n:translate="" i18n:domain="ui">Import / Export</span>
</button> </button>
<button tal:condition="python: report_actions or report_jio_actions" class="report" type="submit" name="Base_doReport:method" title="Report" <button tal:condition="python: report_actions or report_jio_actions or report_jio_actions_deprecated" class="report" type="submit" name="Base_doReport:method" title="Report"
i18n:attributes="title" i18n:domain="ui"> i18n:attributes="title" i18n:domain="ui">
<span class="image"></span> <span class="image"></span>
<span class="description" i18n:translate="" i18n:domain="ui">Report</span> <span class="description" i18n:translate="" i18n:domain="ui">Report</span>
......
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