Commit 8e4d953c authored by Yoshinori Okuji's avatar Yoshinori Okuji

Revert r29873, because the filter parameter to contentValues is not working any longer apparently.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29903 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8d76106e
...@@ -35,7 +35,6 @@ import ExtensionClass ...@@ -35,7 +35,6 @@ import ExtensionClass
from Products.CMFCore.utils import _getAuthenticatedUser from Products.CMFCore.utils import _getAuthenticatedUser
from Products.CMFCore.CMFCatalogAware import CMFCatalogAware from Products.CMFCore.CMFCatalogAware import CMFCatalogAware
from Products.CMFCore.PortalFolder import ContentFilter
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
from Products.ERP5Type.CopySupport import CopyContainer from Products.ERP5Type.CopySupport import CopyContainer
...@@ -1434,17 +1433,24 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn, ...@@ -1434,17 +1433,24 @@ class Folder(CopyContainer, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn,
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'contentValues' ) 'contentValues' )
def contentValues(self, *args, **kw): def contentValues(self, spec=None, meta_type=None, portal_type=None,
filter_kw = kw.pop('filter', None) or {} sort_on=None, sort_order=None, checked_permission=None, **kw):
portal_type_id_list = self._getTypesTool().objectIds() # Returns a list of documents contained in this folder.
if 'portal_type' in filter_kw: # ( no docstring to prevent publishing )
kw['portal_type'] = [x for x in filter_kw.pop('portal_type') if meta_type is not None:
if x in portal_type_id_list] spec = meta_type
elif 'portal_type' not in kw: if portal_type is not None:
kw['portal_type'] = portal_type_id_list kw['portal_type'] = portal_type
object_list = self.objectValues(*args, **kw) filter = kw.pop('filter', {}) or {}
if filter_kw: kw.update(filter)
object_list = filter(ContentFilter(**filter_kw), object_list) if self._folder_handler == HBTREE_HANDLER:
object_list = CMFHBTreeFolder.contentValues(self, spec=spec, filter=kw)
else:
object_list = CMFBTreeFolder.contentValues(self, spec=spec, filter=kw)
if checked_permission is not None:
checkPermission = getSecurityManager().checkPermission
object_list = [o for o in object_list if checkPermission(checked_permission, o)]
object_list = sortValueList(object_list, sort_on, sort_order, **kw)
return object_list return object_list
# Override security declaration of CMFCore/PortalFolder (used by CMFBTreeFolder) # Override security declaration of CMFCore/PortalFolder (used by CMFBTreeFolder)
......
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