Commit db647a0d authored by Romain Courteaud's avatar Romain Courteaud

[erp5_deferred_style] Allow passing previous_skin_selection

This allows restoring the correct skin selection in ERP5JS.
Deferred reports can now be used in ERP5JS.

REQUEST is used to support direct form rendering, like: ./Base_viewHistory?deferred_portal_skin=ODS&portal_skin=Deferred

Thanks to Georgios Dagkakis for his work on this topic.
See !702
parent b3ed2210
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>renderjs_ui_deferred_style_zuite</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>testDeferredStyleJournalAction</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 Form print Action</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Default Module View</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForDeferredRenderjsUi/macros/init" />
<tr>
<td>open</td>
<td>${renderjs_url}/accounting_module</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Export'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Journal'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>//input[@name="field_your_deferred_style"]</td>
<td></td>
</tr>
<tr>
<td>select</td>
<td>//div[contains(@data-gadget-url, 'gadget_erp5_pt_form_dialog.html')]//div[@data-gadget-scope='field_your_simulation_state']//select</td>
<td>label=Closed</td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'No person found for your user'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?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>testDeferredStylePrintAction</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 Form print Action</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Default Module View</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<!-- Clean Up -->
<tr>
<td>open</td>
<td>${base_url}/bar_module/ListBoxZuite_reset</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/foo_module/FooModule_createObjects</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Created Successfully.</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/wait_for_activities" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForDeferredRenderjsUi/macros/init" />
<tr>
<td>open</td>
<td>${renderjs_url}/foo_module/1</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Export'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block tal:define="click_configuration python: {'text': 'Print'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_page_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>click</td>
<td>//input[@name="field_your_deferred_style"]</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_listbox_loaded" />
<tal:block tal:define="notification_configuration python: {'class': 'error',
'text': 'No person found for your user'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_notification" />
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_deferred_renderjs_ui_test</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
context.Zuite_setPreference('')
preference = context.portal_preferences.erp5_ui_test_preference
preference.edit(
preferred_report_style='ODS',
preferred_report_format='html',
preferred_accounting_transaction_section_category='group/demo_group',
preferred_section_category='group/demo_group',
preferred_accounting_transaction_source_ection='organisation_module/my_organisation'
)
return 'Set Deferred Preference Successfully.'
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DeferredRJSZuite_setPreference</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Set Test Runner Preferences</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>description</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>text</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Common Template for PTZuite, it will reuse parts of the Listbox Zuite</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Zuite_CommonTemplateForDeferredRenderjsUi</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>Common Template for All CRM Renderjs ui Zuite</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:block metal:define-macro="init">
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/portal_preferences/DeferredRJSZuite_setPreference</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Set Deferred Preference Successfully.</td>
<td></td>
</tr>
<tr>
<td>store</td>
<td>${base_url}/web_site_module/renderjs_runner/#</td>
<td>renderjs_url</td>
</tr>
</tal:block>
</tal:block>
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2011 Nexedi SARL and Contributors. All Rights Reserved.
# Kazuhiko <kazuhiko@nexedi.com>
# Rafael Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import unittest
from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase
class TestRenderJSUIDeferredStyle(ERP5TypeFunctionalTestCase):
foreground = 0
run_only = "renderjs_ui_deferred_style_zuite"
def getBusinessTemplateList(self):
return (
'erp5_deferred_style',
'erp5_ods_style',
'erp5_odt_style',
'erp5_accounting',
'erp5_simplified_invoicing',
'erp5_accounting_ui_test',
'erp5_web_renderjs_ui_test',
)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestRenderJSUIDeferredStyle))
return suite
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testFunctionalRJSDeferredStyle</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testFunctionalRJSDeferredStyle</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
RenderJS UI tests for Deferred Style.
\ No newline at end of file
Copyright (C) 2019 Nexedi SA
\ No newline at end of file
erp5_accounting
erp5_simplified_invoicing
erp5_web_renderjs_ui_test
erp5_accounting_ui_test
erp5_deferred_style
erp5_ods_style
erp5_odt_style
\ No newline at end of file
portal_tests/renderjs_ui_deferred_style_zuite
portal_tests/renderjs_ui_deferred_style_zuite/**
\ No newline at end of file
erp5_deferred_renderjs_ui_test
\ No newline at end of file
test.erp5.testFunctionalRJSDeferredStyle
\ No newline at end of file
erp5_full_text_mroonga_catalog
\ No newline at end of file
erp5_deferred_renderjs_ui_test
\ No newline at end of file
...@@ -3,6 +3,7 @@ portal = context.getPortalObject() ...@@ -3,6 +3,7 @@ portal = context.getPortalObject()
request = portal.REQUEST request = portal.REQUEST
format = request.get('format', '') format = request.get('format', '')
skin_name = request.get('deferred_portal_skin', portal.portal_skins.getDefaultSkin()) skin_name = request.get('deferred_portal_skin', portal.portal_skins.getDefaultSkin())
previous_skin_selection = request.get('previous_skin_selection', None)
tag = 'active-report-wrapped-%s' % random.randint(0, 1000) tag = 'active-report-wrapped-%s' % random.randint(0, 1000)
priority = 3 priority = 3
...@@ -10,16 +11,18 @@ priority = 3 ...@@ -10,16 +11,18 @@ priority = 3
user = portal.portal_membership.getAuthenticatedMember() user = portal.portal_membership.getAuthenticatedMember()
person_value = user.getUserValue() person_value = user.getUserValue()
if person_value is None: if person_value is None:
portal.changeSkin(None) portal.changeSkin(previous_skin_selection)
return context.Base_redirect('view', keep_items=dict( return context.Base_redirect('view', keep_items=dict(
portal_status_message=translateString( portal_status_message=translateString(
"No person found for your user"))) "No person found for your user"),
portal_status_level='error'))
if person_value.getDefaultEmailText('') in ('', None): if person_value.getDefaultEmailText('') in ('', None):
portal.changeSkin(None) portal.changeSkin(previous_skin_selection)
return context.Base_redirect('view', keep_items=dict( return context.Base_redirect('view', keep_items=dict(
portal_status_message=translateString( portal_status_message=translateString(
"You haven't defined your email address"))) "You haven't defined your email address"),
portal_status_level='error'))
# save request parameters # save request parameters
request_form = portal.ERP5Site_filterRequestForDeferredStyle(request) request_form = portal.ERP5Site_filterRequestForDeferredStyle(request)
...@@ -54,6 +57,6 @@ activity_context.activate( ...@@ -54,6 +57,6 @@ activity_context.activate(
context.activate(activity='SQLQueue', after_tag=tag).getTitle() context.activate(activity='SQLQueue', after_tag=tag).getTitle()
portal.changeSkin(None) portal.changeSkin(previous_skin_selection)
return context.Base_redirect('view', keep_items=dict( return context.Base_redirect('view', keep_items=dict(
portal_status_message=translateString("Report Started"))) portal_status_message=translateString("Report Started")))
...@@ -3,15 +3,17 @@ request = container.REQUEST ...@@ -3,15 +3,17 @@ request = container.REQUEST
portal = context.getPortalObject() portal = context.getPortalObject()
N_ = portal.Base_translateString N_ = portal.Base_translateString
previous_skin_selection = request.get('previous_skin_selection', None)
user = portal.portal_membership.getAuthenticatedMember() user = portal.portal_membership.getAuthenticatedMember()
person_value = user.getUserValue() person_value = user.getUserValue()
if person_value is None: if person_value is None:
portal.changeSkin(None) portal.changeSkin(previous_skin_selection)
return context.Base_redirect('view', keep_items=dict( return context.Base_redirect('view', keep_items=dict(
portal_status_message=N_("No person found for your user"))) portal_status_message=N_("No person found for your user")))
if person_value.getDefaultEmailText('') in ('', None): if person_value.getDefaultEmailText('') in ('', None):
portal.changeSkin(None) portal.changeSkin(previous_skin_selection)
return context.Base_redirect('view', keep_items=dict( return context.Base_redirect('view', keep_items=dict(
portal_status_message=N_("You haven't defined your email address"))) portal_status_message=N_("You haven't defined your email address")))
...@@ -41,6 +43,6 @@ context.activate(activity="SQLQueue", tag=tag, after_tag=after_tag, ...@@ -41,6 +43,6 @@ context.activate(activity="SQLQueue", tag=tag, after_tag=after_tag,
context.activate(activity='SQLQueue', after_tag=tag).getTitle() context.activate(activity='SQLQueue', after_tag=tag).getTitle()
portal.changeSkin(None) portal.changeSkin(previous_skin_selection)
return context.Base_redirect('view', keep_items=dict( return context.Base_redirect('view', keep_items=dict(
portal_status_message=N_("Report Started"))) portal_status_message=N_("Report Started")))
...@@ -210,6 +210,8 @@ kw.update(keep_items=extra_param) # better backward compatibility ...@@ -210,6 +210,8 @@ kw.update(keep_items=extra_param) # better backward compatibility
if dialog_category == "object_search" : if dialog_category == "object_search" :
portal.portal_selections.setSelectionParamsFor(kw['selection_name'], kw) portal.portal_selections.setSelectionParamsFor(kw['selection_name'], kw)
request.set('previous_skin_selection', portal.portal_skins.getCurrentSkinName())
# Finally we will call the Dialog Method # Finally we will call the Dialog Method
# Handle deferred style, unless we are executing the update action # Handle deferred style, unless we are executing the update action
if dialog_method != update_method and kw.get('deferred_style', 0): if dialog_method != update_method and kw.get('deferred_style', 0):
...@@ -217,23 +219,8 @@ if dialog_method != update_method and kw.get('deferred_style', 0): ...@@ -217,23 +219,8 @@ if dialog_method != update_method and kw.get('deferred_style', 0):
# XXX Hardcoded Deferred style name # XXX Hardcoded Deferred style name
kw['portal_skin'] = 'Deferred' kw['portal_skin'] = 'Deferred'
page_template = getattr(getattr(context, dialog_method), 'pt', None)
if page_template == 'report_view':
# Limit Reports in Deferred style to known working styles
if request_form.get('your_portal_skin', None) not in ("ODT", "ODS"):
# RJS own validation - deferred option works here only with ODS/ODT skins
return context.Base_renderForm(dialog_id,
message=translate('Deferred reports are possible only with preference '\
'"Report Style" set to "ODT" or "ODS"'),
level=WARNING,
keep_items=extra_param)
# If the action form has report_view as it's method, it
if page_template != 'report_view':
# use simple wrapper # use simple wrapper
kw['deferred_style_dialog_method'] = dialog_method kw['deferred_style_dialog_method'] = dialog_method
kw['deferred_style_dialog_method'] = dialog_method
request.set('deferred_style_dialog_method', dialog_method) request.set('deferred_style_dialog_method', dialog_method)
dialog_method = 'Base_activateSimpleView' dialog_method = 'Base_activateSimpleView'
......
...@@ -178,6 +178,7 @@ for k, v in kw.items() : ...@@ -178,6 +178,7 @@ for k, v in kw.items() :
# Handle deferred style, unless we are executing the update action # Handle deferred style, unless we are executing the update action
if dialog_method != update_method and clean_kw.get('deferred_style', 0): if dialog_method != update_method and clean_kw.get('deferred_style', 0):
clean_kw['previous_skin_selection'] = context.getPortalObject().portal_skins.getCurrentSkinName()
clean_kw['deferred_portal_skin'] = clean_kw.get('portal_skin', None) clean_kw['deferred_portal_skin'] = clean_kw.get('portal_skin', None)
# XXX Hardcoded Deferred style name # XXX Hardcoded Deferred style name
clean_kw['portal_skin'] = 'Deferred' clean_kw['portal_skin'] = 'Deferred'
......
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