diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getViewModeListboxSelectionName.py b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getViewModeListboxSelectionName.py new file mode 100644 index 0000000000000000000000000000000000000000..93b0f4ebc9c8d6b992e444a2817702d945cb39ea --- /dev/null +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getViewModeListboxSelectionName.py @@ -0,0 +1,17 @@ +if REQUEST is None or form.getId() != "Base_viewListModeRenderer": + return "%s_%s_selection" % (form.getId(), field.getId()) + +request_selection_name = REQUEST.get("selection_name") +if request_selection_name: + selection_parameters = context.portal_selections.getSelectionParamsFor("%s_list_mode_proxy_selection" % request_selection_name) +else: + selection_parameters = {} + +return "%s_%s_selection" % ( + REQUEST.get("proxy_form_id") or + selection_parameters.get("proxy_form_id") or + form.getId(), + REQUEST.get("proxy_field_id") or + selection_parameters.get("proxy_field_id") or + field.getId(), +) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getViewModeListboxSelectionName.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getViewModeListboxSelectionName.xml new file mode 100644 index 0000000000000000000000000000000000000000..6ac3e52cb652d0a6290b8ef234b8efcb295f7a0b --- /dev/null +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getViewModeListboxSelectionName.xml @@ -0,0 +1,62 @@ +<?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>form, field, REQUEST=None</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Base_getViewModeListboxSelectionName</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_view_mode_listbox.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_view_mode_listbox.xml index 80c0601cbfec13cb0833d43c67afb09f671ad898..cbcef403bff7306869539ee56475c7030b2c72e4 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_view_mode_listbox.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_viewFieldLibrary/my_view_mode_listbox.xml @@ -603,7 +603,7 @@ string:Base_viewListMode?proxy_form_id=${form/getId}&proxy_field_id=${field/getI <dictionary> <item> <key> <string>_text</string> </key> - <value> <string>python: \'%s_%s_selection\' % (request.get("proxy_form_id") or context.portal_selections.getSelectionParamsFor(\'%s_list_mode_proxy_selection\' % context.REQUEST.get(\'selection_name\', \'\')).get(\'proxy_form_id\') or form.getId(), request.get("proxy_field_id") or context.portal_selections.getSelectionParamsFor(\'%s_list_mode_proxy_selection\' % context.REQUEST.get(\'selection_name\', \'\')).get(\'proxy_field_id\') or field.getId())</string> </value> + <value> <string>python: context.Base_getViewModeListboxSelectionName(form=form, field=field, REQUEST=request)</string> </value> </item> </dictionary> </pickle>