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 @@ ...@@ -68,23 +68,54 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <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 """\n
Return true when the given field name can be propagated, false otherwise.\n Return true when the given field name can be propagated, false otherwise.\n
\n \n
FIXME: _select should be a prefix, not a sufix, to avoid potential collisions with property names.\n FIXME: _select should be a prefix, not a sufix, to avoid potential collisions with property names.\n
"""\n """\n
if not value_name.startswith(\'field_\') \\\n prefix = value_name.split(\'_\')[0]\n
and not value_name.startswith(\'subfield_\') \\\n if value_name == \'field_id\' \\\n
and not value_name.startswith(\'default_field\') \\\n or prefix not in (\'field\', \'subfield\', \'default\', \'select\', \'search\'):\n
and not value_name.startswith(\'select_\') \\\n context.log(\'filter\', \'keeping %s\' % (value_name, ))\n
or value_name == \'field_id\':\n
return True\n return True\n
return False\n return False\n
\n \n
# Remove some special values\n # Remove a strange value. No idea on its meaning nor what it does here.\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 if parameter_list.has_key(\'-C\'):\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 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 if parameter_list.has_key(k):\n
del parameter_list[k]\n del parameter_list[k]\n
\n \n
...@@ -137,10 +168,10 @@ return parameter_list\n ...@@ -137,10 +168,10 @@ return parameter_list\n
<tuple> <tuple>
<string>parameter_list</string> <string>parameter_list</string>
<string>isValid</string> <string>isValid</string>
<string>_getiter_</string>
<string>k</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>_write_</string> <string>_write_</string>
<string>_getiter_</string>
<string>k</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -73,7 +73,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n ...@@ -73,7 +73,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
-->\n -->\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="master">\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 form_id form/id;\n
list_mode python: True;\n list_mode python: True;\n
listmode_default_listbox python: here.ERP5XhtmlStyle_getListbox(form=form);\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