Commit abc2c63a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

cleanup quick search.

* remove duplicate codes.
* use normal listbox for non-web mode.
* mostly revert listbox columns and add reference.
* remove list_action in listbox.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26695 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7aa64880
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if getattr(context, \'getDocumentValueList\', None) is not None:\n <value> <string>search_method = getattr(context, \'getDocumentValueList\',\n
return context.getDocumentValueList(**kw)\n context.getPortalObject().portal_catalog)\n
return context.portal_catalog(**kw)\n return search_method(**kw)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -95,9 +95,9 @@ return context.portal_catalog(**kw)\n ...@@ -95,9 +95,9 @@ return context.portal_catalog(**kw)\n
<string>kw</string> <string>kw</string>
<string>getattr</string> <string>getattr</string>
<string>context</string> <string>context</string>
<string>None</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>search_method</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -53,26 +53,10 @@ ...@@ -53,26 +53,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>translateString = context.Base_translateString\n <value> <string>return context.ERP5Site_viewQuickSearchResultList(\n
translated_type = \'\'\n field_your_search_text = top_your_search_text,\n
\n field_your_search_portal_type = top_your_search_portal_type,\n
if top_your_search_portal_type:\n all_languages=all_languages)\n
if top_your_search_portal_type == \'all\':\n
return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
keep_items=dict(SearchableText=top_your_search_text, reset=1,\n
your_search_text=top_your_search_text,\n
portal_type=list(context.getPortalDocumentTypeList()),\n
list_style = \'search\',\n
all_languages=all_languages))\n
\n
translated_type = translateString(top_your_search_portal_type)\n
\n
return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
keep_items=dict(SearchableText=top_your_search_text, reset=1,\n
your_search_text=top_your_search_text,\n
translated_portal_type=translated_type,\n
list_style = \'search\',\n
all_languages=all_languages))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -83,7 +67,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -83,7 +67,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>your_search_text=None, top_your_search_text=None, top_your_search_portal_type, all_languages=False</string> </value> <value> <string>top_your_search_text=\'\', top_your_search_portal_type, all_languages=False</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -103,22 +87,17 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -103,22 +87,17 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>4</int> </value> <value> <int>3</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>your_search_text</string>
<string>top_your_search_text</string> <string>top_your_search_text</string>
<string>top_your_search_portal_type</string> <string>top_your_search_portal_type</string>
<string>all_languages</string> <string>all_languages</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>translateString</string>
<string>translated_type</string>
<string>dict</string>
<string>list</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -131,8 +110,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -131,8 +110,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <tuple>
<none/> <string></string>
<none/>
<none/> <none/>
<int>0</int> <int>0</int>
</tuple> </tuple>
......
...@@ -53,13 +53,9 @@ ...@@ -53,13 +53,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>if bottom_your_search_text is not None:\n <value> <string>return context.ERP5Site_viewQuickSearchResultList(\n
your_search_text = bottom_your_search_text\n field_your_search_text=bottom_your_search_text,\n
return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n all_languages=all_languages)\n
keep_items=dict(SearchableText=your_search_text, reset=1,\n
your_search_text=your_search_text,\n
list_style = \'search\',\n
all_languages=all_languages))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -70,7 +66,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -70,7 +66,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>your_search_text=None, bottom_your_search_text=None, all_languages=False</string> </value> <value> <string>bottom_your_search_text=\'\', all_languages=False</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -90,19 +86,16 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -90,19 +86,16 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>3</int> </value> <value> <int>2</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>your_search_text</string>
<string>bottom_your_search_text</string> <string>bottom_your_search_text</string>
<string>all_languages</string> <string>all_languages</string>
<string>None</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>dict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -115,8 +108,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -115,8 +108,7 @@ return context.Base_redirect(\'ERP5Site_viewSearchResult\',\n
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <tuple>
<none/> <string></string>
<none/>
<int>0</int> <int>0</int>
</tuple> </tuple>
</value> </value>
......
...@@ -53,31 +53,24 @@ ...@@ -53,31 +53,24 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>translateString = context.Base_translateString\n <value> <string>kw = {\'reset\':1,\n
translated_type = \'\'\n \'SearchableText\':field_your_search_text,\n
\n \'your_search_text\':field_your_search_text,\n
if getattr(context, \'getWebSectionValue\', None) is not None:\n \'all_languages\':all_languages}\n
context_search = context.getWebSectionValue()\n
else:\n
context_search = context.getPortalObject()\n
\n \n
if field_your_search_portal_type:\n if field_your_search_portal_type:\n
if field_your_search_portal_type == \'all\':\n if field_your_search_portal_type == \'all\':\n
return context_search.Base_redirect(\'ERP5Site_viewSearchResult\',\n kw.update({\'portal_type\':list(context.getPortalDocumentTypeList())})\n
keep_items=dict(SearchableText=field_your_search_text, reset=1,\n else:\n
your_search_text=field_your_search_text,\n kw.update({\'portal_type\':context.Base_translateString(field_your_search_portal_type)})\n
portal_type=list(context.getPortalDocumentTypeList()),\n
list_style = \'search\',\n
all_languages=all_languages))\n
\n \n
translated_type = translateString(field_your_search_portal_type)\n # use non-web quick search if ignore_layout is explicitly set.\n
if bool(context.REQUEST.get(\'ignore_layout\', False)):\n
search_context = context.getPortalObject()\n
else:\n
search_context = getattr(context, \'getWebSectionValue\', context.getPortalObject)() \n
\n \n
return context_search.Base_redirect(\'ERP5Site_viewSearchResult\',\n return search_context.Base_redirect(\'ERP5Site_viewSearchResult\', keep_items=kw)\n
keep_items=dict(SearchableText=field_your_search_text, reset=1,\n
your_search_text=field_your_search_text,\n
translated_portal_type=translated_type,\n
list_style = \'search\',\n
all_languages=all_languages))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -88,7 +81,7 @@ return context_search.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -88,7 +81,7 @@ return context_search.Base_redirect(\'ERP5Site_viewSearchResult\',\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>field_your_search_text=\'\', field_your_search_portal_type=\'\', all_languages=False, **kw</string> </value> <value> <string>field_your_search_text=\'\', field_your_search_portal_type=\'\', all_languages=False</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -119,14 +112,12 @@ return context_search.Base_redirect(\'ERP5Site_viewSearchResult\',\n ...@@ -119,14 +112,12 @@ return context_search.Base_redirect(\'ERP5Site_viewSearchResult\',\n
<string>all_languages</string> <string>all_languages</string>
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>list</string>
<string>context</string> <string>context</string>
<string>translateString</string> <string>bool</string>
<string>translated_type</string> <string>False</string>
<string>search_context</string>
<string>getattr</string> <string>getattr</string>
<string>None</string>
<string>context_search</string>
<string>dict</string>
<string>list</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<string>default_params</string> <string>default_params</string>
<string>search</string> <string>search</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>list_action</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -86,37 +87,29 @@ ...@@ -86,37 +87,29 @@
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<list> <list>
<tuple>
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple> <tuple>
<string>translated_portal_type</string> <string>translated_portal_type</string>
<string>Type</string> <string>Type</string>
</tuple> </tuple>
<tuple> <tuple>
<string>modification_date</string> <string>title</string>
<string>Modification Date</string> <string>Title</string>
</tuple> </tuple>
<tuple> <tuple>
<string>version</string> <string>reference</string>
<string>Version</string> <string>Reference</string>
</tuple> </tuple>
<tuple> <tuple>
<string>language</string> <string>description</string>
<string>Language</string> <string>Description</string>
</tuple> </tuple>
<tuple> <tuple>
<string>translated_validation_state_title</string> <string>translated_validation_state_title</string>
<string>Validation State</string> <string>State</string>
</tuple> </tuple>
<tuple> <tuple>
<string>thumbnail</string> <string>modification_date</string>
<string>Thumbnail</string> <string>Modification Date</string>
</tuple> </tuple>
</list> </list>
</value> </value>
...@@ -135,10 +128,6 @@ ...@@ -135,10 +128,6 @@
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list> <list>
<tuple>
<string>thumbnail</string>
<string>Thumbnail</string>
</tuple>
<tuple> <tuple>
<string>modification_date</string> <string>modification_date</string>
<string>Modification Date</string> <string>Modification Date</string>
...@@ -154,6 +143,10 @@ ...@@ -154,6 +143,10 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string>BankAccount_viewFieldLibrary</string> </value> <value> <string>BankAccount_viewFieldLibrary</string> </value>
</item> </item>
<item>
<key> <string>list_action</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
......
1173 1174
\ 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