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): ...@@ -126,7 +126,7 @@ class ActiveObject(ExtensionClass.Base):
security.declareProtected( permissions.ModifyPortalContent, 'flushActivity' ) security.declareProtected( permissions.ModifyPortalContent, 'flushActivity' )
def flushActivity(self, invoke=0, **kw): 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: if activity_tool is None:
return # Do nothing if no portal_activities return # Do nothing if no portal_activities
# flush all activities related to this object # flush all activities related to this object
...@@ -146,7 +146,7 @@ class ActiveObject(ExtensionClass.Base): ...@@ -146,7 +146,7 @@ class ActiveObject(ExtensionClass.Base):
def hasActivity(self, **kw): def hasActivity(self, **kw):
"""Tells if there is pending activities for this object. """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: if activity_tool is None:
return 0 # Do nothing if no portal_activities return 0 # Do nothing if no portal_activities
return activity_tool.hasActivity(self, **kw) return activity_tool.hasActivity(self, **kw)
...@@ -165,7 +165,7 @@ class ActiveObject(ExtensionClass.Base): ...@@ -165,7 +165,7 @@ class ActiveObject(ExtensionClass.Base):
security.declareProtected( permissions.View, 'getActiveProcess' ) security.declareProtected( permissions.View, 'getActiveProcess' )
def getActiveProcess(self): def getActiveProcess(self):
activity_tool = getToolByName(self, 'portal_activities', None) activity_tool = getToolByName(self.getPortalObject(), 'portal_activities', None)
if activity_tool is None: if activity_tool is None:
return None # Do nothing if no portal_activities return None # Do nothing if no portal_activities
return activity_tool.getActiveProcess() return activity_tool.getActiveProcess()
......
...@@ -424,7 +424,7 @@ class Method: ...@@ -424,7 +424,7 @@ class Method:
def __call__(self, *args, **kw): def __call__(self, *args, **kw):
m = Message(self.__passive_self, self.__active_process, self.__kw, self.__method_id, 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: 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_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) 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