[Erp5-report] r15474 - /erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateIte...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 3 18:39:22 CEST 2007


Author: yusei
Date: Fri Aug  3 18:39:22 2007
New Revision: 15474

URL: http://svn.erp5.org?rev=15474&view=rev
Log:
It is possible that multiple listboxs are in dialog mode and some may be proxy fields.
So I added a condition for proxy field.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Form_getListbox.xml

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Form_getListbox.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Form_getListbox.xml?rev=15474&r1=15473&r2=15474&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Form_getListbox.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Form_getListbox.xml Fri Aug  3 18:39:22 2007
@@ -79,11 +79,21 @@
 if form.meta_type != \'ERP5 Form\':\n
   return None\n
 \n
+# XXX We should not use meta_type properly,\n
+# XXX We need to discuss this problem.(yusei)\n
+def isListBox(field):\n
+  if field.meta_type==\'ListBox\':\n
+    return True\n
+  elif field.meta_type==\'ProxyField\':\n
+    template_field = field.getRecursiveTemplateField()\n
+    return isListBox(template_field)\n
+  return False\n
+\n
 # we start with \'bottom\' because most of the time\n
 # the listbox is there.\n
 for group in (\'bottom\', \'center\', \'left\', \'right\', \'Default\'):\n
   for field in form.get_fields_in_group(group):\n
-     if field.meta_type == \'ListBox\' and not(field[\'hidden\']) and field[\'enabled\']:\n
+     if isListBox(field) and not(field[\'hidden\']) and field[\'enabled\']:\n
        return field\n
 
 
@@ -139,6 +149,7 @@
                             <string>form</string>
                             <string>_getattr_</string>
                             <string>None</string>
+                            <string>isListBox</string>
                             <string>_getiter_</string>
                             <string>group</string>
                             <string>field</string>




More information about the Erp5-report mailing list