Commit ae6171ef authored by Ivan Tyagov's avatar Ivan Tyagov

Get with higher priority items from REQUEST than selection.

Remove hard coded selection name.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36731 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5892f070
......@@ -56,6 +56,7 @@
<value> <string>"""\n
Get search text from REQUEST or selection.\n
"""\n
request = context.REQUEST\n
# get search words from listbox selection\n
argument_names = (\'advanced_search_text\', \n
\'your_search_text\',\n
......@@ -65,18 +66,16 @@ argument_names = (\'advanced_search_text\', \n
\'searchabletext_any\',\n
\'searchabletext_all\', \n
\'searchabletext_phrase\',)\n
\n
if selection is None:\n
selection_name = context.REQUEST.get("selection_name", None)\n
if selection_name is not None:\n
selection = context.portal_selections.getSelectionFor(selection_name)\n
\n
params = {}\n
if selection is not None:\n
params = selection.getParams()\n
else:\n
params = context.portal_selections.getSelectionParamsFor(\'search_result_selection\')\n
\n
params = [params.get(name, \'\') for name in argument_names]\n
params = [request.get(name, params.get(name, \'\')) for name in argument_names]\n
# flatten value if it is list\n
params = [(hasattr(param, \'sort\') and \' \'.join(param) or param) for param in params]\n
search_string = \' \'.join(params).strip()\n
......@@ -119,10 +118,11 @@ return search_string\n
<value>
<tuple>
<string>selection</string>
<string>argument_names</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>request</string>
<string>argument_names</string>
<string>None</string>
<string>selection_name</string>
<string>params</string>
<string>append</string>
......
1623
\ No newline at end of file
1620
\ 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