Commit d6b051d3 authored by Sebastien Robin's avatar Sebastien Robin

now we do not need to subclass CPS Classes with ERP5 classes


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@262 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 23442e9d
......@@ -16,11 +16,12 @@
# 02111-1307, USA.
#
from Products.CPSCore.ProxyBase import ProxyBase
from Products.CPSCore.ProxyBase import ProxyBase, ProxyFolder
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Globals import InitializeClass
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Document.Folder import Folder
from Products.CMFCore.CMFCorePermissions import View
from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
from Products.CMFCore.CMFCorePermissions import ViewManagementScreens
......@@ -36,17 +37,29 @@ class PatchedProxyBase(ProxyBase):
security = ClassSecurityInfo()
# Object attributes update method
security.declarePrivate( '_edit' )
def _edit(self, REQUEST=None, force_update = 0, **kw):
# security.declarePrivate( '_edit' )
# def _edit(self, REQUEST=None, force_update = 0, **kw):
# """
# call also the proxytool
# """
# Base._edit(self, REQUEST=REQUEST,force_update=force_update, **kw)
# px_tool= getToolByName(self,'portal_proxies')
# utool = getToolByName(self, 'portal_url')
# rpath = utool.getRelativeUrl(self)
# px_tool._modifyProxy(self,rpath)
def manage_afterEdit(self):
"""
call also the proxytool
We have to notify the proxy tool we have modified
this object
"""
Base._edit(self, REQUEST=REQUEST,force_update=force_update, **kw)
px_tool= getToolByName(self,'portal_proxies')
utool = getToolByName(self, 'portal_url')
rpath = utool.getRelativeUrl(self)
px_tool._modifyProxy(self,rpath)
def _propertyMap(self):
"""
Returns fake property sheet
......@@ -101,9 +114,13 @@ class PatchedProxyBase(ProxyBase):
ProxyBase.getPath = Base.getPath
ProxyBase.getProperty = Base.getProperty
ProxyBase._edit = PatchedProxyBase._edit
ProxyBase._edit = Base._edit
ProxyBase.asXML = Base.asXML
ProxyBase._propertyMap = PatchedProxyBase._propertyMap
ProxyBase.manage_afterEdit = PatchedProxyBase.manage_afterEdit
ProxyBase.getSyncLanguageRevisions = PatchedProxyBase.getSyncLanguageRevisions
ProxyBase.setSyncLanguageRevisions = PatchedProxyBase.setSyncLanguageRevisions
ProxyBase.getSyncRepoHistory = PatchedProxyBase.getSyncRepoHistory
ProxyBase.setSyncRepoHistory = PatchedProxyBase.setSyncRepoHistory
ProxyFolder.asXML = Folder.asXML
\ No newline at end of file
......@@ -64,3 +64,4 @@ class PatchedCPSDocument(CPSDocument):
CPSDocument._propertyMap = PatchedCPSDocument._propertyMap
CPSDocument.getProperty = Base.getProperty
CPSDocument.setProperty = Base.setProperty
CPSDocument.asXML = Base.asXML
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