From 90d92f4ef7bcef0a2730de9bd480d97e3c3dd05c Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Mon, 26 Apr 2004 14:27:21 +0000 Subject: [PATCH] New method, getEventState. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@739 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Event.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/product/ERP5/Document/Event.py b/product/ERP5/Document/Event.py index 89712c19cb..4e08ba5e43 100755 --- a/product/ERP5/Document/Event.py +++ b/product/ERP5/Document/Event.py @@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5.Document.Document import Document +from Products.CMFCore.utils import getToolByName class Event(Document): """ @@ -104,3 +105,11 @@ an event.""" ) } + security.declareProtected(Permissions.AccessContentsInformation, 'getSimulationState') + def getEventState(self, id_only=1): + """ + Returns the current state in simulation + """ + portal_workflow = getToolByName(self, 'portal_workflow') + wf = portal_workflow.getWorkflowById('event_workflow') + return wf._getWorkflowStateOf(self, id_only=id_only ) -- 2.30.9