Commit fb94b34f authored by Ivan Tyagov's avatar Ivan Tyagov

Revert part of r33150. (Using selections it is possible to have different list modes).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33188 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4407076f
......@@ -74,6 +74,13 @@ date_format = \'%Y-%m-%d\'\n
if searchabletext is None:\n
# searchabletext can be supplied in request (fallback)\n
searchabletext = context.REQUEST.get(\'searchabletext\')\n
\n
if searchabletext is None:\n
# or in selection\n
selection_id = \'search_advanced_dialog_selection\'\n
selection_object = portal.portal_selections.getSelectionParamsFor(selection_id)\n
if selection_object:\n
searchabletext = selection_object.get(\'searchabletext\')\n
\n
if searchabletext is None:\n
raise ValueError, "No search string specified."\n
......@@ -170,6 +177,8 @@ return result\n
<string>query_kw</string>
<string>date_format</string>
<string>None</string>
<string>selection_id</string>
<string>selection_object</string>
<string>ValueError</string>
<string>parsed_search_string</string>
<string>portal_type</string>
......
......@@ -55,11 +55,23 @@
<key> <string>_body</string> </key>
<value> <string>"""\n
Puts all the arguments from advanced search dialog form together as \n
a parseable search string. Set it in the request to pass it \n
on to search form.\n
a parseable search string. Set it in the selection so it can be used\n
in search form.\n
"""\n
portal = context.getPortalObject()\n
searchabletext = context.Base_assembleSearchString()\n
context.REQUEST.set(\'searchabletext\', searchabletext)\n
\n
selection_id = \'search_advanced_dialog_selection\'\n
selection_object = portal.portal_selections.getSelectionParamsFor(selection_id, {})\n
if selection_object:\n
# update\n
selection_object[\'searchabletext\'] = searchabletext\n
else:\n
selection_object = {\'searchabletext\': searchabletext}\n
\n
selection_object[\'list_style\'] = \'search\'\n
portal.portal_selections.setSelectionParamsFor(selection_id, \\\n
selection_object)\n
return context.Base_viewAdvancedSearchResultList()\n
</string> </value>
</item>
......@@ -101,7 +113,11 @@ return context.Base_viewAdvancedSearchResultList()\n
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>searchabletext</string>
<string>selection_id</string>
<string>selection_object</string>
<string>_write_</string>
</tuple>
</value>
</item>
......
1075
\ No newline at end of file
1077
\ 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