Commit 61a98dbf authored by Vincent Pelletier's avatar Vincent Pelletier

Separate "normal" and "should be removed" filters in ERP5XhtmlStyle_filterParameterList.

Fix defautl action name in list_main.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8867 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc9e3c38
......@@ -68,23 +68,54 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>def isValid(value_name):\n
<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
\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
if not value_name.startswith(\'field_\') \\\n
and not value_name.startswith(\'subfield_\') \\\n
and not value_name.startswith(\'default_field\') \\\n
and not value_name.startswith(\'select_\') \\\n
or value_name == \'field_id\':\n
prefix = value_name.split(\'_\')[0]\n
if value_name == \'field_id\' \\\n
or prefix not in (\'field\', \'subfield\', \'default\', \'select\', \'search\'):\n
context.log(\'filter\', \'keeping %s\' % (value_name, ))\n
return True\n
return False\n
\n
# Remove some special values\n
# FIXME: This list should be mostly empty, every variable not to propagate must have a distinct prefix and thus be handled by isValid.\n
for k in (\'-C\', \'SearchableText\', \'uids\', \'listbox_uid\', \'list_selection_name\', \'list_start\', \'portal_status_message\', \'update_action\', \'dialog_method\', \'cancel_method\', \'title\', \'description\', \'reset\', \'md5_object_uid_list\', \'id\', \'came_from\'):\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\', \'portal_status_message\', \'reset\'):\n
if parameter_list.has_key(k):\n
del parameter_list[k]\n
\n
# erp5_xhtml_style special fields.\n
# XXX: This should not be needed.\n
for k in (\'update_action\', \'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 (\'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
......@@ -137,10 +168,10 @@ return parameter_list\n
<tuple>
<string>parameter_list</string>
<string>isValid</string>
<string>_getiter_</string>
<string>k</string>
<string>_getattr_</string>
<string>_write_</string>
<string>_getiter_</string>
<string>k</string>
</tuple>
</value>
</item>
......
......@@ -73,7 +73,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
-->\n
</tal:block>\n
<tal:block metal:define-macro="master">\n
<tal:block tal:define="form_action string:Base_doSelect:method;\n
<tal:block tal:define="form_action string:Base_doSelect;\n
form_id form/id;\n
list_mode python: True;\n
listmode_default_listbox python: here.ERP5XhtmlStyle_getListbox(form=form);\n
......
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