web/views/workflow.py
changeset 6141 b8287e54b528
parent 6103 072f23f6bf83
child 6366 1806148d6ce8
equal deleted inserted replaced
6140:65a619eb31c4 6141:b8287e54b528
    23 
    23 
    24 __docformat__ = "restructuredtext en"
    24 __docformat__ = "restructuredtext en"
    25 _ = unicode
    25 _ = unicode
    26 
    26 
    27 import os
    27 import os
       
    28 from warnings import warn
    28 
    29 
    29 from logilab.mtconverter import xml_escape
    30 from logilab.mtconverter import xml_escape
    30 from logilab.common.graph import escape
    31 from logilab.common.graph import escape
    31 
    32 
    32 from cubicweb import Unauthorized, view
    33 from cubicweb import Unauthorized, view
   158         if rset:
   159         if rset:
   159             self.wview('table', rset, title=_(self.title), displayactions=False,
   160             self.wview('table', rset, title=_(self.title), displayactions=False,
   160                        displaycols=displaycols, headers=headers)
   161                        displaycols=displaycols, headers=headers)
   161 
   162 
   162 
   163 
   163 class WFHistoryVComponent(component.EntityVComponent):
   164 class WFHistoryVComponent(component.CtxComponent):
   164     """display the workflow history for entities supporting it"""
   165     """display the workflow history for entities supporting it"""
   165     __regid__ = 'wfhistory'
   166     __regid__ = 'wfhistory'
   166     __select__ = WFHistoryView.__select__ & component.EntityVComponent.__select__
   167     __select__ = WFHistoryView.__select__ & component.EntityVComponent.__select__
   167     context = 'navcontentbottom'
   168     context = 'navcontentbottom'
   168     title = _('Workflow history')
   169     title = _('Workflow history')
   169 
   170 
   170     def cell_call(self, row, col, view=None):
   171     def render_body(self, w):
   171         self.wview('wfhistory', self.cw_rset, row=row, col=col, view=view)
   172         if hasattr(self, 'cell_call'):
       
   173             warn('[3.10] %s should now implement render_body instead of cell_call',
       
   174                  DeprecationWarning, self.__class__)
       
   175             self.w = w
       
   176             self.cell_call(self.entity.cw_row, self.entity.cw_col)
       
   177         else:
       
   178             self.entity.view('wfhistory', w=w)
   172 
   179 
   173 
   180 
   174 # workflow actions #############################################################
   181 # workflow actions #############################################################
   175 
   182 
   176 class WorkflowActions(action.Action):
   183 class WorkflowActions(action.Action):