[Erp5-report] r32662 seb - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateIt...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Feb 17 09:32:23 CET 2010
Author: seb
Date: Wed Feb 17 09:32:20 2010
New Revision: 32662
URL: http://svn.erp5.org?rev=32662&view=rev
Log:
2010-02-17 Seb
* Make Base_updateDialogForm and ListBox_initializeFastInput able
to support listbox with another id than "listbox"
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_updateDialogForm.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_updateDialogForm.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_updateDialogForm.xml?rev=32662&r1=32661&r2=32662&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_updateDialogForm.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_updateDialogForm.xml [utf8] Wed Feb 17 09:32:20 2010
@@ -60,18 +60,19 @@
\n
for k in kw.keys():\n
v = kw[k]\n
- if k == \'listbox\':\n
+ if k.endswith(\'listbox\'):\n
listbox = {}\n
+ listbox_key = "%s_key" % k\n
if v is not None:\n
i = 1\n
for line in v:\n
- if line.has_key(\'listbox_key\'):\n
- key = \'%s\' % line[\'listbox_key\']\n
+ if line.has_key(listbox_key):\n
+ key = \'%s\' % line[listbox_key]\n
else:\n
key = str(zfill(i,3))\n
listbox[key] = line\n
i+=1\n
- request.set(\'listbox\',listbox)\n
+ request.set(k,listbox)\n
else:\n
request.set(\'my_%s\' % k, v)\n
request.set(\'%s\' % k, v)\n
@@ -122,6 +123,7 @@
<string>_getitem_</string>
<string>v</string>
<string>listbox</string>
+ <string>listbox_key</string>
<string>None</string>
<string>i</string>
<string>line</string>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml?rev=32662&r1=32661&r2=32662&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ListBox_initializeFastInput.xml [utf8] Wed Feb 17 09:32:20 2010
@@ -55,7 +55,8 @@
<key> <string>_body</string> </key>
<value> <string>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
@@ -69,9 +70,10 @@
portal_object = context.getPortalObject()\n
int_len = 3\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
+ listbox=request[listbox_id]\n
\n
keys_list = listbox.keys()\n
\n
@@ -88,7 +90,7 @@
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
@@ -119,7 +121,7 @@
</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>errors</string> </key>
@@ -139,18 +141,20 @@
<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>empty_line_number</string>
+ <string>listbox_id</string>
<string>kw</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
<string>zfill</string>
+ <string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
@@ -160,6 +164,7 @@
<string>portal_object</string>
<string>int_len</string>
<string>hasattr</string>
+ <string>listbox_key</string>
<string>listbox</string>
<string>keys_list</string>
<string>int</string>
@@ -169,7 +174,6 @@
<string>is_empty</string>
<string>key</string>
<string>value</string>
- <string>None</string>
<string>range</string>
<string>str</string>
</tuple>
@@ -185,6 +189,7 @@
<value>
<tuple>
<int>0</int>
+ <none/>
</tuple>
</value>
</item>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=32662&r1=32661&r2=32662&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Wed Feb 17 09:32:20 2010
@@ -1,1 +1,1 @@
-1475
+1476
More information about the Erp5-report
mailing list