311 |
311 |
312 def cell_call(self, row, col): |
312 def cell_call(self, row, col): |
313 entity = self.cw_rset.get_entity(row, col) |
313 entity = self.cw_rset.get_entity(row, col) |
314 if entity.default_workflow: |
314 if entity.default_workflow: |
315 wf = entity.default_workflow[0] |
315 wf = entity.default_workflow[0] |
316 self.w(u'<h1>%s (%s)</h1>' % (wf.name, self._cw._('default'))) |
316 if len(entity.reverse_workflow_of) > 1: |
317 self.wf_image(wf) |
317 self.w(u'<h1>%s (%s)</h1>' |
|
318 % (wf.name, self._cw._('default_workflow'))) |
|
319 self.display_workflow(wf) |
|
320 defaultwfeid = wf.eid |
|
321 else: |
|
322 self.w(u'<div class="error">%s</div>' |
|
323 % self._cw._('There is no default workflow')) |
|
324 defaultwfeid = None |
318 for altwf in entity.reverse_workflow_of: |
325 for altwf in entity.reverse_workflow_of: |
319 if altwf.eid == wf.eid: |
326 if altwf.eid == defaultwfeid: |
320 continue |
327 continue |
321 self.w(u'<h1>%s</h1>' % altwf.name) |
328 self.w(u'<h1>%s</h1>' % altwf.name) |
322 self.wf_image(altwf) |
329 self.display_workflow(altwf) |
323 |
330 |
324 def wf_image(self, wf): |
331 def display_workflow(self, wf): |
325 self.w(u'<img src="%s" alt="%s"/>' % ( |
332 self.w(wf.view('wfgraph')) |
326 xml_escape(wf.absolute_url(vid='wfgraph')), |
333 self.w('<a href="%s">%s</a>' % ( |
327 xml_escape(self._cw._('graphical representation of %s') % wf.name))) |
334 wf.absolute_url(), self._cw._('more info about this workflow'))) |
328 |
335 |
329 |
336 |
330 # CWRType ###################################################################### |
337 # CWRType ###################################################################### |
331 |
338 |
332 class CWRTypeSchemaView(primary.PrimaryView): |
339 class CWRTypeSchemaView(primary.PrimaryView): |