Commit 6520a3f0 authored by Romain Courteaud's avatar Romain Courteaud

DeliveryTool can now content DeliveryBuilder.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2896 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d3ef2563
...@@ -30,6 +30,8 @@ from Products.CMFCore.utils import UniqueObject ...@@ -30,6 +30,8 @@ from Products.CMFCore.utils import UniqueObject
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.CMFCore.PortalFolder import PortalFolder
from Products.ERP5Type.Document.Folder import Folder from Products.ERP5Type.Document.Folder import Folder
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
...@@ -37,7 +39,7 @@ from Products.ERP5 import _dtmldir ...@@ -37,7 +39,7 @@ from Products.ERP5 import _dtmldir
from zLOG import LOG from zLOG import LOG
class DeliveryTool(UniqueObject, Folder): class DeliveryTool(UniqueObject, Folder, BaseTool):
""" """
The DeliveryTool implements portal object The DeliveryTool implements portal object
deliveries building policies. deliveries building policies.
...@@ -48,11 +50,32 @@ class DeliveryTool(UniqueObject, Folder): ...@@ -48,11 +50,32 @@ class DeliveryTool(UniqueObject, Folder):
id = 'portal_deliveries' id = 'portal_deliveries'
meta_type = 'ERP5 Delivery Tool' meta_type = 'ERP5 Delivery Tool'
portal_type = 'Delivery Tool' portal_type = 'Delivery Tool'
allowed_types = () allowed_types = ('ERP5 Delivery Buider',)
# Declarative Security # Declarative Security
security = ClassSecurityInfo() security = ClassSecurityInfo()
# Filter content (ZMI))
def filtered_meta_types(self, user=None):
# Filters the list of available meta types.
#all = CMFCategoryTool.inheritedAttribute('filtered_meta_types')(self)
meta_types = []
for meta_type in self.all_meta_types():
if meta_type['name'] in self.allowed_types:
meta_types.append(meta_type)
return meta_types
# patch, so that we are able to add the BaseCategory
allowedContentTypes = BaseTool.allowedContentTypes
# patch, so that we are able to rename base categories
_verifyObjectPaste = PortalFolder._verifyObjectPaste
all_meta_types = BaseTool.all_meta_types
security.declareProtected(Permissions.View, 'hasContent')
def hasContent(self,id):
return id in self.objectIds()
# #
# ZMI methods # ZMI methods
# #
...@@ -81,5 +104,11 @@ class DeliveryTool(UniqueObject, Folder): ...@@ -81,5 +104,11 @@ class DeliveryTool(UniqueObject, Folder):
meta_types.append(meta_type) meta_types.append(meta_type)
return meta_types return meta_types
security.declareProtected(Permissions.ModifyPortalContent, 'tic')
def tic(self):
"""
We will look at all delivery builder and activate them.
"""
pass
InitializeClass(DeliveryTool) InitializeClass(DeliveryTool)
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