add links to "search for all related items" (#986)
This commit is contained in:
parent
0f14b21a28
commit
53c8b05c4b
|
@ -60,6 +60,7 @@
|
||||||
<td class="docdate"><span tal:replace="python: item.getObject().date_str"></span></td>
|
<td class="docdate"><span tal:replace="python: item.getObject().date_str"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<a tal:attributes="href view/related_search_url">Rechercher tous les documents proches</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div tal:replace="structure provider:plone.belowcontentbody" />
|
<div tal:replace="structure provider:plone.belowcontentbody" />
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
|
from Products.CMFCore.utils import getToolByName
|
||||||
from Products.Five import BrowserView
|
from Products.Five import BrowserView
|
||||||
|
|
||||||
class View(BrowserView):
|
class View(BrowserView):
|
||||||
pass
|
def related_search_url(self):
|
||||||
|
catalog = getToolByName(self.context, 'portal_catalog')
|
||||||
|
try:
|
||||||
|
form_url = catalog(
|
||||||
|
portal_type='Folder',
|
||||||
|
object_provides=('tabellio.searchform.form.IFolderWithPfbDocuments',
|
||||||
|
'tabellio.searchform.form.IFolderWithDocuments'),
|
||||||
|
limit=1)[0].getObject().absolute_url()
|
||||||
|
except IndexError:
|
||||||
|
return None
|
||||||
|
return '%s/?document.widgets.sort_on:list=Session&document.widgets.search_type_is_document=1&document.widgets.topics=%s' % (form_url, ' '.join(self.context.topics))
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
<td class="docdate"><span tal:replace="python: item.getObject().date_str"></span></td>
|
<td class="docdate"><span tal:replace="python: item.getObject().date_str"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<a tal:attributes="href view/related_search_url">Rechercher tous les dossiers proches</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="reflex" tal:condition="python: context.dostype in ('PJD', 'PPD')">
|
<div id="reflex" tal:condition="python: context.dostype in ('PJD', 'PPD')">
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
|
from Products.CMFCore.utils import getToolByName
|
||||||
from Products.Five import BrowserView
|
from Products.Five import BrowserView
|
||||||
|
|
||||||
class View(BrowserView):
|
class View(BrowserView):
|
||||||
pass
|
def related_search_url(self):
|
||||||
|
catalog = getToolByName(self.context, 'portal_catalog')
|
||||||
|
try:
|
||||||
|
form_url = catalog(
|
||||||
|
portal_type='Folder',
|
||||||
|
object_provides=('tabellio.searchform.form.IFolderWithPfbDocuments',
|
||||||
|
'tabellio.searchform.form.IFolderWithDocuments'),
|
||||||
|
limit=1)[0].getObject().absolute_url()
|
||||||
|
except IndexError:
|
||||||
|
return None
|
||||||
|
return '%s/?dossier.widgets.sort_on:list=Session&dossier.widgets.search_type_is_dossier=1&dossier.widgets.topics=%s' % (form_url, ' '.join(self.context.topics))
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
<td class="docdate"><span tal:replace="python: item.getObject().date_str"></span></td>
|
<td class="docdate"><span tal:replace="python: item.getObject().date_str"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<a tal:attributes="href view/related_search_url">Rechercher toutes les questions proches</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
from Products.Five import BrowserView
|
from Products.Five import BrowserView
|
||||||
|
|
||||||
class View(BrowserView):
|
class View(BrowserView):
|
||||||
pass
|
def related_search_url(self):
|
||||||
|
catalog = getToolByName(self.context, 'portal_catalog')
|
||||||
|
try:
|
||||||
|
form_url = catalog(
|
||||||
|
portal_type='Folder',
|
||||||
|
object_provides=('tabellio.searchform.form.IFolderWithPfbDocuments',
|
||||||
|
'tabellio.searchform.form.IFolderWithDocuments'),
|
||||||
|
limit=1)[0].getObject().absolute_url()
|
||||||
|
except IndexError:
|
||||||
|
return None
|
||||||
|
return '%s/?question.widgets.sort_on:list=Session&question.widgets.search_type_is_question=1&question.widgets.topics=%s' % (form_url, ' '.join(self.context.topics))
|
||||||
|
|
||||||
|
|
Reference in New Issue