web/views/workflow.py
changeset 6473 2b09a410ff8e
parent 6456 150246e77cda
child 6690 7d68948015ba
equal deleted inserted replaced
6472:6e058f937126 6473:2b09a410ff8e
   132     __select__ = relation_possible('wf_info_for', role='object') & \
   132     __select__ = relation_possible('wf_info_for', role='object') & \
   133                  score_entity(lambda x: x.cw_adapt_to('IWorkflowable').workflow_history)
   133                  score_entity(lambda x: x.cw_adapt_to('IWorkflowable').workflow_history)
   134 
   134 
   135     title = _('Workflow history')
   135     title = _('Workflow history')
   136 
   136 
   137     def cell_call(self, row, col, view=None):
   137     def cell_call(self, row, col, view=None, title=title):
   138         _ = self._cw._
   138         _ = self._cw._
   139         eid = self.cw_rset[row][col]
   139         eid = self.cw_rset[row][col]
   140         sel = 'Any FS,TS,WF,D'
   140         sel = 'Any FS,TS,WF,D'
   141         rql = ' ORDERBY D DESC WHERE WF wf_info_for X,'\
   141         rql = ' ORDERBY D DESC WHERE WF wf_info_for X,'\
   142               'WF from_state FS, WF to_state TS, WF comment C,'\
   142               'WF from_state FS, WF to_state TS, WF comment C,'\
   155         try:
   155         try:
   156             rset = self._cw.execute(rql, {'x': eid})
   156             rset = self._cw.execute(rql, {'x': eid})
   157         except Unauthorized:
   157         except Unauthorized:
   158             return
   158             return
   159         if rset:
   159         if rset:
   160             self.wview('table', rset, title=_(self.title), displayactions=False,
   160             if title:
       
   161                 title = _(title)
       
   162             self.wview('table', rset, title=title, displayactions=False,
   161                        displaycols=displaycols, headers=headers)
   163                        displaycols=displaycols, headers=headers)
   162 
   164 
   163 
   165 
   164 class WFHistoryVComponent(component.EntityCtxComponent):
   166 class WFHistoryVComponent(component.EntityCtxComponent):
   165     """display the workflow history for entities supporting it"""
   167     """display the workflow history for entities supporting it"""
   173             warn('[3.10] %s should now implement render_body instead of cell_call'
   175             warn('[3.10] %s should now implement render_body instead of cell_call'
   174                  % self.__class__, DeprecationWarning)
   176                  % self.__class__, DeprecationWarning)
   175             self.w = w
   177             self.w = w
   176             self.cell_call(self.entity.cw_row, self.entity.cw_col)
   178             self.cell_call(self.entity.cw_row, self.entity.cw_col)
   177         else:
   179         else:
   178             self.entity.view('wfhistory', w=w)
   180             self.entity.view('wfhistory', w=w, title=None)
   179 
   181 
   180 
   182 
   181 # workflow actions #############################################################
   183 # workflow actions #############################################################
   182 
   184 
   183 class WorkflowActions(action.Action):
   185 class WorkflowActions(action.Action):