Changeset 1838
- Timestamp:
- Feb 11, 2007 3:31:59 AM (11 years ago)
- Location:
- Products.PloneAdaptedWorkflow/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Products.PloneAdaptedWorkflow/trunk/patches.py
r1837 r1838 11 11 import workflow 12 12 13 # if plone is using cmfplacefulworkflow, get rid of it and let normal inheritance flows work.14 if 'CMFPlacefulWorkflow' in inspect.getmodule( WorkflowTool.getChainFor).__name__:15 del WorkflowTool.getChainFor16 17 13 18 14 import Products.CMFPlone.WorkflowTool 19 Products.CMFPlone.WorkflowTool.WorkflowTool = type( WorkflowTool.__name__, (workflow.WorkflowTool,), {}) 15 16 # if plone is using cmfplacefulworkflow, get rid of it and let normal inheritance flows work. 17 #if 'CMFPlacefulWorkflow' in inspect.getmodule( WorkflowTool.getChainFor).__name__: 18 # del WorkflowTool.getChainFor 19 20 for method_name in ('getChainFor', 'getHistoryOf', 'setStatusOf'): 21 method = getattr( workflow.WorkflowTool, method_name ) 22 setattr( WorkflowTool, method_name, method.im_func ) 23 24 #Products.CMFPlone.WorkflowTool.WorkflowTool = type( WorkflowTool.__name__, (workflow.WorkflowTool,WorkflowTool), {}) 20 25 21 26 22 27 28 -
Products.PloneAdaptedWorkflow/trunk/workflow.py
r1837 r1838 19 19 pt = context 20 20 elif hasattr( aq_base( context ), 'getPortalTypeName'): 21 pt = ob.getPortalTypeName()21 pt = context.getPortalTypeName() 22 22 else: 23 23 pt = None … … 37 37 38 38 def CMFPlacefulWorkflowChain( context, workflow_tool ): 39 print "cmfpw", context.portal_type39 print type( context ) 40 40 from Products.CMFPlacefulWorkflow.patches import workflowtoolPatch as cmfpw 41 41 return cmfpw.getChainFor( workflow_tool, context ) … … 43 43 def DefaultWorkflowState( context ): 44 44 if hasattr( aq_base, 'workflow_history'): 45 history = ob.workflow_history45 history = context.workflow_history 46 46 else: 47 47 history = PersistentMapping() 48 setattr( ob, 'workflow_history', history )48 setattr( context, 'workflow_history', history ) 49 49 return history 50 50 51 51 def DefaultWorkflowStateQuery( context ): 52 if hasattr( aq_base( ob), 'workflow_history'):53 wfh = ob.workflow_history52 if hasattr( aq_base( context ), 'workflow_history'): 53 wfh = context.workflow_history 54 54 else: 55 55 wfh = () … … 86 86 the portal_type. 87 87 """ 88 return zope.component.getMultiAdapter( (ob, self), interfaces.IWorkflowChain , default=())88 return zope.component.getMultiAdapter( (ob, self), interfaces.IWorkflowChain ) 89 89 90 90
Note: See TracChangeset
for help on using the changeset viewer.