Commit 6bdffe38 authored by Sebastien Robin's avatar Sebastien Robin

Add a parameter in order to display only title lines instead of description.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23473 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0056151a
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
<value> <string>translateString = context.Base_translateString\n <value> <string>translateString = context.Base_translateString\n
request = context.REQUEST\n request = context.REQUEST\n
\n \n
# display only title line instead of description\n
use_line_title = request.get(\'use_line_title\', 0)\n
\n
def getFieldAsString(field):\n def getFieldAsString(field):\n
return \', \'.join(getFieldAsLineList(field))\n return \', \'.join(getFieldAsLineList(field))\n
\n \n
...@@ -145,7 +148,10 @@ def unicodeDict(d):\n ...@@ -145,7 +148,10 @@ def unicodeDict(d):\n
for line in getSubLineList(context):\n for line in getSubLineList(context):\n
prod_desc = line.getResource() is not None and \\\n prod_desc = line.getResource() is not None and \\\n
line.getResourceValue().getDescription() or line.getResourceTitle()\n line.getResourceValue().getDescription() or line.getResourceTitle()\n
desc = getProductAndLineDesc(prod_desc, line.getDescription())\n if use_line_title:\n
desc = (line.getTitle(), )\n
else:\n
desc = getProductAndLineDesc(prod_desc, line.getDescription())\n
if getattr(line, \'hasLineContent\', None) is not None\\\n if getattr(line, \'hasLineContent\', None) is not None\\\n
and line.hasLineContent()\\\n and line.hasLineContent()\\\n
or getattr(line, \'hasCellContent\', None) is not None\\\n or getattr(line, \'hasCellContent\', None) is not None\\\n
...@@ -429,6 +435,7 @@ return unicodeDict(data_dict)\n ...@@ -429,6 +435,7 @@ return unicodeDict(data_dict)\n
<string>context</string> <string>context</string>
<string>translateString</string> <string>translateString</string>
<string>request</string> <string>request</string>
<string>use_line_title</string>
<string>getFieldAsLineList</string> <string>getFieldAsLineList</string>
<string>getFieldAsString</string> <string>getFieldAsString</string>
<string>getProductAndLineDesc</string> <string>getProductAndLineDesc</string>
......
417 418
\ 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