Commit 610e7ab6 authored by Jérome Perrin's avatar Jérome Perrin

don't use 7 lines, but the preferred number of lines in list mode

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23097 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 328714ca
...@@ -71,17 +71,22 @@ from string import zfill\n ...@@ -71,17 +71,22 @@ from string import zfill\n
global portal_object, new_id, l\n global portal_object, new_id, l\n
\n \n
portal_object = context.getPortalObject()\n portal_object = context.getPortalObject()\n
\n
if lines_num is None:\n
lines_num = portal_object.portal_preferences.getPreferredListboxListModeLineCount() or 40\n
\n
new_id = 0\n new_id = 0\n
l = []\n l = []\n
\n \n
\n
# function to create a new fast input line\n # function to create a new fast input line\n
def createInputLine():\n def createInputLine():\n
global portal_object, new_id, l\n global portal_object, new_id, l\n
new_id += 1\n new_id += 1\n
int_len = 3\n int_len = 3\n
o = newTempBase( portal_object\n o = newTempBase( portal_object,\n
, str(new_id)\n str(new_id),\n
, uid =\'new_%s\' % zfill(new_id, int_len)\n uid =\'new_%s\' % zfill(new_id, int_len)\n
)\n )\n
l.append(o)\n l.append(o)\n
\n \n
...@@ -107,7 +112,7 @@ return l\n ...@@ -107,7 +112,7 @@ return l\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>lines_num=7, **kw</string> </value> <value> <string>lines_num=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -142,6 +147,7 @@ return l\n ...@@ -142,6 +147,7 @@ return l\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_object</string> <string>portal_object</string>
<string>None</string>
<string>new_id</string> <string>new_id</string>
<string>l</string> <string>l</string>
<string>createInputLine</string> <string>createInputLine</string>
...@@ -160,7 +166,7 @@ return l\n ...@@ -160,7 +166,7 @@ return l\n
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <tuple>
<int>7</int> <none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
544 545
\ No newline at end of file \ No newline at end of file
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