Commit 446f0dff authored by Ivan Tyagov's avatar Ivan Tyagov

Add portal_type to query if specified.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33287 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec822ab6
...@@ -132,13 +132,13 @@ for category in (\'group\', \'site\', \'function\', \'publication_section\', \'c ...@@ -132,13 +132,13 @@ for category in (\'group\', \'site\', \'function\', \'publication_section\', \'c
if category_value not in MARKER:\n if category_value not in MARKER:\n
search_string += \' %s:%s\' % (category, category_value)\n search_string += \' %s:%s\' % (category, category_value)\n
\n \n
# Category title search\n # contributor title search\n
for category in (\'contributor_title\',):\n for category in (\'contributor_title\',):\n
category_value = kw.get(category, request.get(category, None))\n category_value = kw.get(category, request.get(category, None))\n
if category_value not in MARKER:\n if category_value not in MARKER:\n
search_string += \' %s:%s\' %(category, category_value)\n search_string += \' %s:%s\' %(category, category_value)\n
\n \n
#only my docs\n # only my docs\n
mine = kw.get(\'mine\', request.get(\'mine\', None))\n mine = kw.get(\'mine\', request.get(\'mine\', None))\n
if mine not in MARKER:\n if mine not in MARKER:\n
search_string += \' mine:yes\'\n search_string += \' mine:yes\'\n
......
...@@ -91,6 +91,9 @@ parsed_search_string = context.Base_parseSearchString(searchabletext)\n ...@@ -91,6 +91,9 @@ parsed_search_string = context.Base_parseSearchString(searchabletext)\n
portal_type = parsed_search_string.get(\'portal_type\', None)\n portal_type = parsed_search_string.get(\'portal_type\', None)\n
if portal_type is None or not len(portal_type):\n if portal_type is None or not len(portal_type):\n
query_kw[\'portal_type\'] = portal.getPortalDocumentTypeList()\n query_kw[\'portal_type\'] = portal.getPortalDocumentTypeList()\n
else:\n
# safe to add passed portal_type\n
query_kw[\'portal_type\'] = portal_type\n
\n \n
# ZSQLCatalog wants table.key to avoid ambiguity\n # ZSQLCatalog wants table.key to avoid ambiguity\n
parsed_searchabletext = parsed_search_string.get(\'searchabletext\', None)\n parsed_searchabletext = parsed_search_string.get(\'searchabletext\', None)\n
...@@ -121,6 +124,8 @@ if parsed_search_string.get(\'mine\'):\n ...@@ -121,6 +124,8 @@ if parsed_search_string.get(\'mine\'):\n
# user wants only his documents\n # user wants only his documents\n
query_kw[\'owner\'] = str(portal.portal_membership.getAuthenticatedMember())\n query_kw[\'owner\'] = str(portal.portal_membership.getAuthenticatedMember())\n
\n \n
# XXX: add contributor title\n
\n
if parsed_search_string.get(\'newest\'):\n if parsed_search_string.get(\'newest\'):\n
#...and now we check for only the newest versions\n #...and now we check for only the newest versions\n
# but we need to preserve order\n # but we need to preserve order\n
......
1079 1081
\ 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