[Erp5-report] r45524 vincent - /erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_sk...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 15 17:17:50 CEST 2011


Author: vincent
Date: Fri Apr 15 17:17:50 2011
New Revision: 45524

URL: http://svn.erp5.org?rev=45524&view=rev
Log:
Add support for non-default listbox field id.

Also, remove a few no-ops.

Modified:
    erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml

Modified: erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml?rev=45524&r1=45523&r2=45524&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/ListBox_initializeFastInput.xml [utf8] Fri Apr 15 17:17:50 2011
@@ -54,7 +54,8 @@
 
 from Products.ERP5Type.Document import newTempBase\n
 from string import zfill\n
-\n
+if listbox_id is None:\n
+  listbox_id = \'listbox\'\n
 \n
 request = context.REQUEST\n
 \n
@@ -96,17 +97,14 @@ def sort_fast_input_lines(x, y):\n
   else:\n
     return 0\n
 \n
-if hasattr(request, \'listbox\'):\n
+if hasattr(request, listbox_id):\n
+  listbox_key = "%s_key" % listbox_id\n
   # initialize the listbox \n
-  listbox=request[\'listbox\']\n
-\n
+  listbox=request[listbox_id]\n
   keys_list = listbox.keys()\n
-\n
   if keys_list != []:\n
-    #keys_list.sort(lambda x,y: cmp(int(x),int(y)))\n
     if context.getPortalType() in (\'Monetary Issue\',):\n
       keys_list.sort(sort_container)\n
-      pass\n
     else:\n
       keys_list.sort(sort_fast_input_lines)\n
     first_empty_line_id = int(keys_list[-1])+1\n
@@ -120,7 +118,7 @@ if hasattr(request, \'listbox\'):\n
     for key in listbox[i]:\n
       value = listbox[i][key]\n
       # 0 was added because of checkbox field in some fast input\n
-      if (value not in [\'\',None,0]) and (key != \'listbox_key\'):\n
+      if (value not in [\'\',None,0]) and (key != listbox_key):\n
         is_empty = 0\n
       if (request.has_key(\'field_errors\')):\n
         is_empty = 0\n
@@ -147,7 +145,7 @@ return l\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>empty_line_number=0, **kw</string> </value>
+            <value> <string>empty_line_number=0, listbox_id=None, **kw</string> </value>
         </item>
         <item>
             <key> <string>id</string> </key>



More information about the Erp5-report mailing list