Commit 5950fd38 authored by Bartek Górny's avatar Bartek Górny

Added multi-category selector to advanced search form, and handling it in the script.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12564 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f3cd0fce
...@@ -76,7 +76,6 @@ method.\n ...@@ -76,7 +76,6 @@ method.\n
"""\n """\n
\n \n
req = context.REQUEST\n req = context.REQUEST\n
\n
# words to search in \'any of the words\' form - left intact\n # words to search in \'any of the words\' form - left intact\n
search_string = req.get(\'SearchableText_any\',\'\')\n search_string = req.get(\'SearchableText_any\',\'\')\n
\n \n
...@@ -128,8 +127,8 @@ if lng and lng != \'0\':\n ...@@ -128,8 +127,8 @@ if lng and lng != \'0\':\n
search_string += \' language:%s\' % lng\n search_string += \' language:%s\' % lng\n
\n \n
# category search\n # category search\n
for category in context.Document_getBaseCategoryList():\n for category in context.portal_preferences.getPreferredDocumentBaseCategoryList():\n
category_value = req.get(\'search_\' + category)\n category_value = req.get(\'subfield_field_your_category_list_\' + category)\n
if category_value:\n if category_value:\n
search_string += \' %s:%s\' % (category, category_value)\n search_string += \' %s:%s\' % (category, category_value)\n
\n \n
......
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
<string>my_search_portal_type</string> <string>my_search_portal_type</string>
<string>creation_from</string> <string>creation_from</string>
<string>creation_to</string> <string>creation_to</string>
<string>your_category_list</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.ProxyField</string>
<string>ProxyField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_category_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>extra_context</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>extra_context</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>extra_context</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_dms_category_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Document_library</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
499 500
\ 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