Changeset 1838


Ignore:
Timestamp:
Feb 11, 2007 3:31:59 AM (11 years ago)
Author:
hazmat
Message:

get it running

Location:
Products.PloneAdaptedWorkflow/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Products.PloneAdaptedWorkflow/trunk/patches.py

    r1837 r1838  
    1111import workflow 
    1212 
    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.getChainFor 
    16      
    1713 
    1814import 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 
     20for 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), {}) 
    2025 
    2126 
    2227 
     28 
  • Products.PloneAdaptedWorkflow/trunk/workflow.py

    r1837 r1838  
    1919        pt = context 
    2020    elif hasattr( aq_base( context ), 'getPortalTypeName'): 
    21         pt = ob.getPortalTypeName() 
     21        pt = context.getPortalTypeName() 
    2222    else: 
    2323        pt = None 
     
    3737 
    3838def CMFPlacefulWorkflowChain( context, workflow_tool ): 
    39     print "cmfpw", context.portal_type 
     39    print type( context ) 
    4040    from Products.CMFPlacefulWorkflow.patches import workflowtoolPatch as cmfpw 
    4141    return cmfpw.getChainFor( workflow_tool, context ) 
     
    4343def DefaultWorkflowState( context ): 
    4444    if hasattr( aq_base, 'workflow_history'): 
    45         history = ob.workflow_history 
     45        history = context.workflow_history 
    4646    else: 
    4747        history = PersistentMapping() 
    48         setattr( ob, 'workflow_history', history ) 
     48        setattr( context, 'workflow_history', history ) 
    4949    return history 
    5050 
    5151def DefaultWorkflowStateQuery( context ): 
    52     if hasattr( aq_base( ob ), 'workflow_history'): 
    53         wfh = ob.workflow_history 
     52    if hasattr( aq_base( context ), 'workflow_history'): 
     53        wfh = context.workflow_history 
    5454    else: 
    5555        wfh = () 
     
    8686        the portal_type. 
    8787        """ 
    88         return zope.component.getMultiAdapter( (ob, self), interfaces.IWorkflowChain, default=() ) 
     88        return zope.component.getMultiAdapter( (ob, self), interfaces.IWorkflowChain ) 
    8989         
    9090     
Note: See TracChangeset for help on using the changeset viewer.