Exemple #1
0
def get_wf_state(context, wf_state_id=None):
    """Get the human readable title for the context's workflow state
    """
    # !+ rename to: workflow_state_title
    wf = interfaces.IWorkflow(context)
    if wf_state_id is None:
        wf_state_id = interfaces.IWorkflowState(context).getState()
    return wf.workflow.states[wf_state_id].title
Exemple #2
0
 def update(self):
     self.setupActions()
     super(BungeniAttributeDisplay, self).update()
     self.setupActions()  # after we transition we have different actions
     try:
         wf_state = interfaces.IWorkflowState(
             removeSecurityProxy(self.context)).getState()
         self.wf_status = wf_state
     except:
         pass
Exemple #3
0
 def update(self):
     has_wfstate = False
     try:
         wf_state = interfaces.IWorkflowState( removeSecurityProxy(self.context) ).getState()
         has_wfstate = True
     except:
         wf_state = u'undefined'
     if wf_state is None:
        wf_state =u'undefined'
        has_wfstate = False
     self.wf_status = wf_state
     self.has_status = has_wfstate
     self.entries = self.getFeedEntries()
Exemple #4
0
 def update(self):
     has_wfstate = False
     try:
         wf_state = interfaces.IWorkflowState(
             removeSecurityProxy(self.context)).getState()
         has_wfstate = True
     except:
         wf_state = u"undefined"
     if wf_state is None:
         wf_state = u"undefined"
         has_wfstate = False
     self.wf_status = wf_state
     self.has_status = has_wfstate
     self.entries = self.getFeedEntries()
     # min_date_active
     if len(self.entries):
         # then use the "date_active" of the most recent entry
         min_date_active = self.entries[0]["date_active"]
     else:
         # then use the current parliament's atart_date
         min_date_active = globalsettings.get_current_parliament(
         ).start_date
     # remember "min_date_active" on the request
     IAnnotations(self.request)["min_date_active"] = min_date_active
Exemple #5
0
def get_wf_state(context):
    # return human readable workflow title
    wf = interfaces.IWorkflow(context)
    wf_state = interfaces.IWorkflowState(context).getState()
    return wf.workflow.states[wf_state].title