Commit c888c545 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_hal_json_style: show correctly workflow title on history view

parent 81572d3c
......@@ -937,7 +937,17 @@ def renderForm(traversed_document, form, response_dict, key_prefix=None, selecti
report_form_params = report_item.selection_params.copy() \
if report_item.selection_params is not None \
else {}
# request.prefixed_selection_name maybe used in tales expression
if report_form:
listbox = getattr(getattr(report_context, report_form), 'listbox', None)
if listbox is not None:
listbox_selection_name = report_prefix + "_" + listbox.get_value('selection_name')
REQUEST.other['prefixed_selection_name'] = listbox_selection_name
if report_form_params:
params = portal.portal_selections.getSelectionParamsFor(listbox_selection_name)
params.update(report_form_params)
portal.portal_selections.setSelectionParamsFor(listbox_selection_name,params)
if report_item.selection_name:
selection_name = report_prefix + "_" + report_item.selection_name
report_form_params.update(selection_name=selection_name)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testReportViewDisplayWorkflowTitle</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Report View Workflow Title</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Report View Workflow Title</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/PTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/foo_module/1?page=tab</td>
<td></td>
</tr>
<!-- Wait for gadget to be loaded -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_tab.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Title 1</td>
<td></td>
</tr>
<!-- Follow one link -->
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='History' and contains(@href, '#!change') and contains(@href, 'history') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_report_view.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Current</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Draft</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//h1[@data-i18n='Edit Workflow']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//h1[@data-i18n='Foo Workflow']</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/web_page_module/rjs_renderjs_js?page=tab</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-scope='m']//a[text()='History' and contains(@href, '#!change') and contains(@href, 'history') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@data-gadget-scope='m']//a[text()='History' and contains(@href, '#!change') and contains(@href, 'history') and contains(@href, 'u.page=')]</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_pt_report_view.html']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//h1[@data-i18n='External Processing Workflow']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//h1[@data-i18n='Document Publication Workflow']</td>
<td></td>
</tr>
<tr>
<td>verifyElementPresent</td>
<td>//h1[@data-i18n='Edit Workflow']</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
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