Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
plone.app.layout.viewlets.content.WorkflowHistoryViewlet Class Reference
Inheritance diagram for plone.app.layout.viewlets.content.WorkflowHistoryViewlet:
Inheritance graph
[legend]
Collaboration diagram for plone.app.layout.viewlets.content.WorkflowHistoryViewlet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def update
def workflowHistory

Public Attributes

 tools

Static Public Attributes

tuple index = ViewPageTemplateFile("review_history.pt")

Detailed Description

Definition at line 101 of file content.py.


Member Function Documentation

Definition at line 102 of file content.py.

00102 
00103     def update(self):
00104         super(WorkflowHistoryViewlet, self).update()
00105         self.tools = getMultiAdapter((self.context, self.request),
                                     name='plone_tools')

Here is the caller graph for this function:

Return workflow history of this context.

Taken from plone_scripts/getWorkflowHistory.py

Definition at line 107 of file content.py.

00107 
00108     def workflowHistory(self):
00109         """Return workflow history of this context.
00110 
00111         Taken from plone_scripts/getWorkflowHistory.py
00112         """
00113         workflow = self.tools.workflow()
00114         membership = self.tools.membership()
00115 
00116         history = []
00117 
00118         # check if the current user has the proper permissions
00119         if (membership.checkPermission('Request review', self.context) or
00120             membership.checkPermission('Review portal content', self.context)):
00121             try:
00122                 # get total history
00123                 review_history = workflow.getInfoFor(self.context, 'review_history')
00124 
00125                 # filter out the irrelevant stuff
00126                 review_history = [r for r in review_history if r['action']]
00127                 for r in review_history:
00128                     r['transition_title'] = workflow.getTitleForTransitionOnType(r['action'],
00129                                                                                  self.context.portal_type)
00130                     actorid = r['actor']
00131                     r['actorid'] = actorid
00132                     if actorid is None:
00133                         # action performed by an anonymous user
00134                         r['actor'] = {'username': _(u'label_anonymous_user', default=u'Anonymous User')}
00135                         r['actor_home'] = ''
00136                     else:
00137                         r['actor'] = membership.getMemberInfo(actorid)
00138                         if r['actor'] is not None:
00139                             r['actor_home'] = self.site_url + '/author/' + actorid
00140                         else:
00141                             # member info is not available
00142                             # the user was probably deleted
00143                             r['actor_home'] = ''
00144                 history = review_history
00145                 history.reverse()
00146 
00147             except WorkflowException:
00148                 log( 'plone.app.layout.viewlets.content: '
00149                      '%s has no associated workflow' % self.context.absolute_url(), severity=logging.DEBUG)
00150 
00151         return history

Here is the call graph for this function:


Member Data Documentation

tuple plone.app.layout.viewlets.content.WorkflowHistoryViewlet.index = ViewPageTemplateFile("review_history.pt") [static]

Definition at line 152 of file content.py.

Definition at line 104 of file content.py.


The documentation for this class was generated from the following file: