Commit 7ef756fc authored by Jérome Perrin's avatar Jérome Perrin

fix Documents tab, it was showing all documents when context had no follow up...

fix Documents tab, it was showing all documents when context had no follow up related documents, and it was generating invalid HTML links

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36305 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e0776ec0
......@@ -60,10 +60,14 @@ portal_catalog=context.getPortalObject().portal_catalog\n
follow_up_related_document_list = portal_catalog(\n
portal_type=portal_type,\n
follow_up_uid=context.getUid(), **kw)\n
kw[\'query\'] = ComplexQuery(\n
Query(relative_url=\'%s/%%\' % context.getRelativeUrl()),\n
Query(uid=[x.getUid() for x in follow_up_related_document_list]),\n
operator=\'or\')\n
\n
kw[\'query\'] = Query(relative_url=\'%s/%%\' % context.getRelativeUrl())\n
if follow_up_related_document_list:\n
kw[\'query\'] = ComplexQuery(\n
kw[\'query\'],\n
Query(uid=[x.getUid() for x in follow_up_related_document_list]),\n
operator=\'or\')\n
\n
return portal_catalog(portal_type=portal_type, **kw)\n
</string> </value>
</item>
......@@ -112,11 +116,12 @@ return portal_catalog(portal_type=portal_type, **kw)\n
<string>portal_catalog</string>
<string>_apply_</string>
<string>follow_up_related_document_list</string>
<string>_write_</string>
<string>_getitem_</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>_write_</string>
</tuple>
</value>
</item>
......
......@@ -53,21 +53,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from ZTUtils import make_query\n
\n
index = context.portal_selections.getSelectionIndexFor(selection_name)\n
object = brain.getObject()\n
if object is None:\n
return None\n
\n
url = object.absolute_url()\n
method = \'Base_download\'\n
kw = { \n
\'selection_name\' : selection_name,\n
\'selection_index\' : index,\n
}\n
\n
return url + \'/\' + method + \'?\' + make_query(kw)\n
<value> <string>if brain is None:\n
brain = context\n
return \'%s/Base_download\' % brain.absolute_url()\n
</string> </value>
</item>
<item>
......@@ -107,16 +95,9 @@ return url + \'/\' + method + \'?\' + make_query(kw)\n
<string>brain</string>
<string>selection</string>
<string>selection_name</string>
<string>ZTUtils</string>
<string>make_query</string>
<string>_getattr_</string>
<string>context</string>
<string>index</string>
<string>object</string>
<string>None</string>
<string>url</string>
<string>method</string>
<string>kw</string>
<string>context</string>
<string>_getattr_</string>
</tuple>
</value>
</item>
......
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