Commit ed11e251 authored by Vincent Pelletier's avatar Vincent Pelletier

Base_doDialog,...

Base_doDialog, TemplateTool_callViewInstallRepositoryBusinessTemplateListDialog: propagate explicitelly dialog_category.
ERP5XhtmlStyle_filterParameterList: name the variables to keep instead of the variables to remove.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10290 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7b261ecd
......@@ -68,7 +68,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.ERP5XhtmlStyle_redirect(select_dialog.split()[0], **kw)\n
<value> <string>return context.ERP5XhtmlStyle_redirect(select_dialog.split()[0], keep_items={\'dialog_category\': dialog_category}, **kw)\n
</string> </value>
</item>
<item>
......@@ -91,7 +91,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>select_dialog, **kw</string> </value>
<value> <string>select_dialog, dialog_category, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -111,13 +111,14 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>select_dialog</string>
<string>dialog_category</string>
<string>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
......
......@@ -68,50 +68,30 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX: This file contains many duplicated loops when filtering, this is done on purpose :\n
# Each loop contains variable names which concern a certain hidden field generator (listbox, xhtml style,...).\n
# Above each loop is said wether it is normal or shoul dbe fixed.\n
<value> <string>kept_names = (\'editable_mode\', \'ignore_layout\', # erp5_web\n
\'selection_name\', \'selection_index\', # list mode\n
\'form_id\', # list mode and view mode\n
\'object_uid\', \'object_path\', # view mode\n
\'field_id\', \'form_pickle\', \'form_signature\', # related string field\n
\'bt_list\', # business template installation system\n
\'cancel_url\',\n
)\n
# Dialog mode is absent from the kept_name list on purpose :\n
# none of its variable should ever get transmited because\n
# it\'s the deepest level of navigation.\n
# Cancel url is always overwritten, except when rendering\n
# a dialog. So this is safe to propagate it.\n
\n
kept_names = dict([(key, None) for key in kept_names])\n
\n
def isValid(value_name):\n
"""\n
Return true when the given field name can be propagated, false otherwise.\n
\n
FIXME: _select should be a prefix, not a sufix, to avoid potential collisions with property names.\n
"""\n
prefix = value_name.split(\'_\')[0]\n
if value_name == \'field_id\' \\\n
or prefix not in (\'field\', \'subfield\', \'default\', \'select\', \'search\'):\n
if kept_names.has_key(value_name):\n
return True\n
return False\n
\n
# Remove a strange value. No idea on its meaning nor what it does here.\n
if parameter_list.has_key(\'-C\'):\n
del parameter_list[\'-C\']\n
\n
# erp5_xhtml_style special fields.\n
# This is normal.\n
for k in (\'came_from\', \'SearchableText\', \'workflow_action\', \'portal_status_message\', \'reset\', \'dialog_id\', \'update_method\', \'dialog_method\', \'cancel_method\'):\n
if parameter_list.has_key(k):\n
del parameter_list[k]\n
\n
# Listbox search fields special values\n
# XXX: This should not be needed.\n
# for k in (\'id\', \'title\', \'description\', \'reporter\'):\n
# if parameter_list.has_key(k):\n
# del parameter_list[k]\n
\n
# Listbox special fields.\n
# XXX: This should not be needed.\n
for k in (\'listbox\', \'list_start\', \'uids\', \'listbox_uid\', \'list_selection_name\', \'md5_object_uid_list\'):\n
if parameter_list.has_key(k):\n
del parameter_list[k]\n
\n
# Subversion special fields\n
# XXX: This should not be needed.\n
for k in (\'changelog\', \'added\', \'removed\', \'modified\'):\n
if parameter_list.has_key(k):\n
del parameter_list[k]\n
\n
for k in parameter_list.keys():\n
if not isValid(k):\n
del parameter_list[k]\n
......@@ -160,11 +140,17 @@ return parameter_list\n
<value>
<tuple>
<string>parameter_list</string>
<string>kept_names</string>
<string>dict</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>key</string>
<string>None</string>
<string>isValid</string>
<string>_getattr_</string>
<string>_write_</string>
<string>_getiter_</string>
<string>k</string>
<string>_write_</string>
</tuple>
</value>
</item>
......
......@@ -68,10 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Clear selection\n
<value> <string>kw.update(context.REQUEST.form)\n
# Clear selection\n
context.portal_selections.setSelectionCheckedUidsFor(\'template_tool_install_selection\', [])\n
# Then call the listbox\n
return context.ERP5XhtmlStyle_redirect("%s/%s" % (context.absolute_url(), \'TemplateTool_viewInstallRepositoryBusinessTemplateListDialog\'))\n
return context.ERP5XhtmlStyle_redirect("%s/%s" % (context.absolute_url(), \'TemplateTool_viewInstallRepositoryBusinessTemplateListDialog\'), keep_items={\'dialog_category\': dialog_category}, **kw)\n
</string> </value>
</item>
<item>
......@@ -94,7 +95,7 @@ return context.ERP5XhtmlStyle_redirect("%s/%s" % (context.absolute_url(), \'Temp
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>dialog_category=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -114,15 +115,17 @@ return context.ERP5XhtmlStyle_redirect("%s/%s" % (context.absolute_url(), \'Temp
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>dialog_category</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>_apply_</string>
</tuple>
</value>
</item>
......@@ -134,7 +137,9 @@ return context.ERP5XhtmlStyle_redirect("%s/%s" % (context.absolute_url(), \'Temp
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
......
215
\ No newline at end of file
222
\ 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