Commit feeb36a5 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Get portal_activities from a portal.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30617 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5eeddc5d
......@@ -126,7 +126,7 @@ class ActiveObject(ExtensionClass.Base):
security.declareProtected( permissions.ModifyPortalContent, 'flushActivity' )
def flushActivity(self, invoke=0, **kw):
activity_tool = getToolByName(self, 'portal_activities', None)
activity_tool = getToolByName(self.getPortalObject(), 'portal_activities', None)
if activity_tool is None:
return # Do nothing if no portal_activities
# flush all activities related to this object
......@@ -146,7 +146,7 @@ class ActiveObject(ExtensionClass.Base):
def hasActivity(self, **kw):
"""Tells if there is pending activities for this object.
"""
activity_tool = getToolByName(self, 'portal_activities', None)
activity_tool = getToolByName(self.getPortalObject(), 'portal_activities', None)
if activity_tool is None:
return 0 # Do nothing if no portal_activities
return activity_tool.hasActivity(self, **kw)
......@@ -165,7 +165,7 @@ class ActiveObject(ExtensionClass.Base):
security.declareProtected( permissions.View, 'getActiveProcess' )
def getActiveProcess(self):
activity_tool = getToolByName(self, 'portal_activities', None)
activity_tool = getToolByName(self.getPortalObject(), 'portal_activities', None)
if activity_tool is None:
return None # Do nothing if no portal_activities
return activity_tool.getActiveProcess()
......
......@@ -424,7 +424,7 @@ class Method:
def __call__(self, *args, **kw):
m = Message(self.__passive_self, self.__active_process, self.__kw, self.__method_id, args, kw)
portal_activities = self.__passive_self.portal_activities
portal_activities = self.__passive_self.getPortalObject().portal_activities
if portal_activities.activity_tracking:
activity_tracking_logger.info('queuing message: activity=%s, object_path=%s, method_id=%s, args=%s, kw=%s, activity_kw=%s, user_name=%s' % (self.__activity, '/'.join(m.object_path), m.method_id, m.args, m.kw, m.activity_kw, m.user_name))
activity_dict[self.__activity].queueMessage(portal_activities, m)
......
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