Commit 9b08e1d6 authored by Bartek Górny's avatar Bartek Górny

* fix reading of 'mine' parameter

* if searchstring is empty and there is no 'mine' param we return empty list (not everything)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10678 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f12d99af
...@@ -70,7 +70,10 @@ ...@@ -70,7 +70,10 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
context.log(kw)\n mine=context.REQUEST.get(\'mine\',\'\')\n
# if no args we return emtpy list\n
if kw.get(\'SearchableText\',\'\')==\'\' and mine==\'\':return []\n
\n
args=context.parseSearchString(kw.get(\'SearchableText\',\'\'))\n args=context.parseSearchString(kw.get(\'SearchableText\',\'\'))\n
if not args.has_key(\'portal_type\') or args[\'portal_type\']==():\n if not args.has_key(\'portal_type\') or args[\'portal_type\']==():\n
args[\'portal_type\']=context.getPortalDocumentTypeList()\n args[\'portal_type\']=context.getPortalDocumentTypeList()\n
...@@ -108,7 +111,7 @@ if wheres!=[]:\n ...@@ -108,7 +111,7 @@ if wheres!=[]:\n
\n \n
res=context.portal_catalog(**kw)\n res=context.portal_catalog(**kw)\n
\n \n
if kw.get(\'mine\')==1: # user wants only his documents\n if mine!=\'\': # user wants only his documents\n
from AccessControl import getSecurityManager\n from AccessControl import getSecurityManager\n
sm=getSecurityManager()\n sm=getSecurityManager()\n
u=sm.getUser()\n u=sm.getUser()\n
...@@ -164,6 +167,7 @@ return res\n ...@@ -164,6 +167,7 @@ return res\n
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>mine</string>
<string>args</string> <string>args</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>_write_</string> <string>_write_</string>
......
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