From eaf11f01066c508b9b8dd703cc31d0cc01e6ffff Mon Sep 17 00:00:00 2001 From: Rafael Monnerat <rafael@nexedi.com> Date: Tue, 29 Jul 2008 23:28:57 +0000 Subject: [PATCH] Accept receive parameter throw a button. This is useful for multiple skins for xhtml style. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22742 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_xhtml_style/Base_doAction.xml | 15 +++++++++++---- .../erp5_xhtml_style/Base_doFavorite.xml | 14 ++++++++++---- .../portal_skins/erp5_xhtml_style/Base_doJump.xml | 10 ++++++++-- .../erp5_xhtml_style/Base_doLanguage.xml | 12 ++++++++++-- .../erp5_xhtml_style/Base_doModule.xml | 14 ++++++++++---- .../ERP5/bootstrap/erp5_xhtml_style/bt/revision | 2 +- 6 files changed, 50 insertions(+), 17 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml index 9149012268..97fcae8db1 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doAction.xml @@ -70,6 +70,9 @@ N_ = portal.Base_translateString\n preserved_parameters={\'form_id\': form_id, \'cancel_url\': cancel_url}\n request = context.REQUEST\n \n +if select_action is None:\n + select_action = request.form["Base_doAction"]\n +\n # prevent lose checked itens after select action\n # For backward compatibility, do nothing if\n # Base_updateListboxSelection cannot be found.\n @@ -147,7 +150,7 @@ return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters, </item> <item> <key> <string>_params</string> </key> - <value> <string>select_action, form_id, cancel_url, **kw</string> </value> + <value> <string>select_action=None, form_id, cancel_url, **kw</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -183,12 +186,12 @@ return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters, <string>N_</string> <string>preserved_parameters</string> <string>request</string> - <string>getattr</string> <string>None</string> + <string>_getitem_</string> + <string>getattr</string> <string>Base_updateListboxSelection</string> <string>Base_doAction</string> <string>len</string> - <string>_getitem_</string> <string>doAction0</string> <string>redirect_url</string> <string>_write_</string> @@ -213,7 +216,11 @@ return context.ERP5Site_redirect(redirect_url, keep_items=preserved_parameters, <item> <key> <string>func_defaults</string> </key> <value> - <none/> + <tuple> + <none/> + <none/> + <none/> + </tuple> </value> </item> <item> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doFavorite.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doFavorite.xml index 042b3ed21f..601139a94f 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doFavorite.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doFavorite.xml @@ -65,7 +65,9 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>if select_favorite == \'\':\n + <value> <string>if select_favorite is None:\n + select_favorite = context.REQUEST.form["Base_doFavorite"]\n +if select_favorite == \'\':\n return\n return context.ERP5Site_redirect(select_favorite, **kw)\n </string> </value> @@ -90,7 +92,7 @@ return context.ERP5Site_redirect(select_favorite, **kw)\n </item> <item> <key> <string>_params</string> </key> - <value> <string>select_favorite, **kw</string> </value> + <value> <string>select_favorite=None, **kw</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -118,9 +120,11 @@ return context.ERP5Site_redirect(select_favorite, **kw)\n <tuple> <string>select_favorite</string> <string>kw</string> - <string>_apply_</string> + <string>None</string> + <string>_getitem_</string> <string>_getattr_</string> <string>context</string> + <string>_apply_</string> </tuple> </value> </item> @@ -132,7 +136,9 @@ return context.ERP5Site_redirect(select_favorite, **kw)\n <item> <key> <string>func_defaults</string> </key> <value> - <none/> + <tuple> + <none/> + </tuple> </value> </item> <item> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doJump.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doJump.xml index 80cbc0586d..a38ee92e9b 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doJump.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doJump.xml @@ -72,6 +72,9 @@ Base_updateListboxSelection = getattr(context, \'Base_updateListboxSelection\', if Base_updateListboxSelection is not None:\n Base_updateListboxSelection()\n \n +if select_jump is None:\n + select_jump = context.REQUEST.form["Base_doJump"]\n +\n if select_jump == \'\':\n return\n \n @@ -100,7 +103,7 @@ return context.ERP5Site_redirect(select_jump,\n </item> <item> <key> <string>_params</string> </key> - <value> <string>select_jump, **kw</string> </value> + <value> <string>select_jump=None, **kw</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -132,6 +135,7 @@ return context.ERP5Site_redirect(select_jump,\n <string>context</string> <string>None</string> <string>Base_updateListboxSelection</string> + <string>_getitem_</string> <string>_getattr_</string> <string>container</string> <string>request</string> @@ -148,7 +152,9 @@ return context.ERP5Site_redirect(select_jump,\n <item> <key> <string>func_defaults</string> </key> <value> - <none/> + <tuple> + <none/> + </tuple> </value> </item> <item> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doLanguage.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doLanguage.xml index 0e077837d7..1ebe807f67 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doLanguage.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doLanguage.xml @@ -67,6 +67,10 @@ <key> <string>_body</string> </key> <value> <string># XXX Localizer-dependent\n portal = context.getPortalObject()\n +\n +if select_language is None:\n + select_language = context.REQUEST.form["Base_doLanguage"]\n +\n portal.Localizer.changeLanguage(select_language)\n </string> </value> </item> @@ -90,7 +94,7 @@ portal.Localizer.changeLanguage(select_language)\n </item> <item> <key> <string>_params</string> </key> - <value> <string>select_language</string> </value> + <value> <string>select_language=None</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -120,6 +124,8 @@ portal.Localizer.changeLanguage(select_language)\n <string>_getattr_</string> <string>context</string> <string>portal</string> + <string>None</string> + <string>_getitem_</string> </tuple> </value> </item> @@ -131,7 +137,9 @@ portal.Localizer.changeLanguage(select_language)\n <item> <key> <string>func_defaults</string> </key> <value> - <none/> + <tuple> + <none/> + </tuple> </value> </item> <item> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml index acd2a05cda..b0c01082df 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_doModule.xml @@ -65,7 +65,9 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>if select_module == \'\':\n + <value> <string>if select_module == None:\n + select_module = context.REQUEST.form["Base_doModule"]\n +if select_module == \'\':\n return\n return context.ERP5Site_redirect(\'%s/view\' % select_module, **kw)\n </string> </value> @@ -90,7 +92,7 @@ return context.ERP5Site_redirect(\'%s/view\' % select_module, **kw)\n </item> <item> <key> <string>_params</string> </key> - <value> <string>select_module, **kw</string> </value> + <value> <string>select_module=None, **kw</string> </value> </item> <item> <key> <string>errors</string> </key> @@ -118,9 +120,11 @@ return context.ERP5Site_redirect(\'%s/view\' % select_module, **kw)\n <tuple> <string>select_module</string> <string>kw</string> - <string>_apply_</string> + <string>None</string> + <string>_getitem_</string> <string>_getattr_</string> <string>context</string> + <string>_apply_</string> </tuple> </value> </item> @@ -132,7 +136,9 @@ return context.ERP5Site_redirect(\'%s/view\' % select_module, **kw)\n <item> <key> <string>func_defaults</string> </key> <value> - <none/> + <tuple> + <none/> + </tuple> </value> </item> <item> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision index 55b22b1aa9..bccc87b80e 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision @@ -1 +1 @@ -580 \ No newline at end of file +581 \ No newline at end of file -- 2.30.9