From 1885875b4640e4608935d838d1ea5c547fa3f28c Mon Sep 17 00:00:00 2001 From: Georgios Dagkakis Date: Thu, 21 Jun 2018 16:25:57 +0000 Subject: [PATCH 1/2] erp5_deferred_style: Allow passing previous_skin_selection To be used so that it can work in new UI --- .../erp5_deferred_style/Base_activateSimpleView.py | 6 +++--- .../erp5_deferred_style/Base_activateSimpleView.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.py b/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.py index 538e5e05927..0b687157527 100644 --- a/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.py +++ b/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.py @@ -10,13 +10,13 @@ priority = 3 user = portal.portal_membership.getAuthenticatedMember() person_value = user.getUserValue() if person_value is None: - portal.changeSkin(None) + portal.changeSkin(previous_skin_selection) return context.Base_redirect('view', keep_items=dict( portal_status_message=translateString( "No person found for your user"))) if person_value.getDefaultEmailText('') in ('', None): - portal.changeSkin(None) + portal.changeSkin(previous_skin_selection) return context.Base_redirect('view', keep_items=dict( portal_status_message=translateString( "You haven't defined your email address"))) @@ -54,6 +54,6 @@ activity_context.activate( context.activate(activity='SQLQueue', after_tag=tag).getTitle() -portal.changeSkin(None) +portal.changeSkin(previous_skin_selection) return context.Base_redirect('view', keep_items=dict( portal_status_message=translateString("Report Started"))) diff --git a/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.xml b/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.xml index 7de91450d40..d5f6f14e021 100644 --- a/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.xml +++ b/bt5/erp5_deferred_style/SkinTemplateItem/portal_skins/erp5_deferred_style/Base_activateSimpleView.xml @@ -50,7 +50,7 @@ _params - deferred_style_dialog_method, **kw + deferred_style_dialog_method, previous_skin_selection=None, **kw id -- 2.30.9 From 0baabd87c72a49e7d95bf6343e5ca6cdc38e2f69 Mon Sep 17 00:00:00 2001 From: Georgios Dagkakis Date: Thu, 21 Jun 2018 16:30:05 +0000 Subject: [PATCH 2/2] erp5_hal_json_style: Set previous_skin_selection in kw when Base_activateSimpleView is to be called for deferred report --- .../portal_skins/erp5_hal_json_style/Base_callDialogMethod.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py b/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py index a74aeee5639..31c1099f869 100644 --- a/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py +++ b/bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py @@ -215,6 +215,7 @@ if dialog_category == "object_search" : # Handle deferred style, unless we are executing the update action if dialog_method != update_method and kw.get('deferred_style', 0): kw['deferred_portal_skin'] = kw.get('portal_skin', None) + kw['previous_skin_selection'] = portal.portal_skins.getCurrentSkinName() # XXX Hardcoded Deferred style name kw['portal_skin'] = 'Deferred' -- 2.30.9