Esempio n. 1
0
def get_wf_state(context, wf_status=None):
    """Get the human readable title for the context's workflow state
    """
    # !+RENAME(mr, mar-2011) to get_workflow_state_title
    workflow = interfaces.IWorkflow(context)
    if wf_status is None:
        wf_status = interfaces.IStateController(context).get_status()
    return workflow.get_state(wf_status).title
Esempio n. 2
0
 def update(self):
     self.setupActions()
     #super(BungeniAttributeDisplay, self).update()
     DynamicFields.update(self)
     self.setupActions()  # after we transition we have different actions
     try:
         self.wf_status = interfaces.IStateController(
             removeSecurityProxy(self.context)).get_status()
     except:
         pass
Esempio n. 3
0
def get_wf_state(context, wf_status=None):
    """Get the human readable title for the context's workflow state
    """
    workflow = interfaces.IWorkflow(context, None)
    if workflow is None:
        log.warn("No workflow exists for %s", context)
        return ""  # !+ !!
    if wf_status is None:
        # retrieve and use current status
        wf_status = interfaces.IStateController(context).get_status()
    # ok, pick off the current state's title
    return workflow.get_state(wf_status).title
Esempio n. 4
0
 def update(self):
     has_wfstate = False
     try:
         sc = interfaces.IStateController(removeSecurityProxy(
             self.context)).get_status()
         has_wfstate = True
     except:
         sc = "undefined"
     if sc is None:
         sc = "undefined"
         has_wfstate = False
     self.wf_status = sc
     self.has_status = has_wfstate
     self.entries = self.get_feed_entries()
Esempio n. 5
0
 def state_controller(self):
     if self._state_controller is None:
         self._state_controller = interfaces.IStateController(self.context)
     return self._state_controller