web/views/boxes.py
branch3.5
changeset 3084 096d680c9da2
parent 2993 2d06451013ac
parent 3082 99ab33abf414
child 3219 be8cfc00ae04
equal deleted inserted replaced
3080:32c2b6a34ab2 3084:096d680c9da2
   138             menu_title = u'%s: %s' % (_('state'), entity.printable_state)
   138             menu_title = u'%s: %s' % (_('state'), entity.printable_state)
   139             menu_items = []
   139             menu_items = []
   140             for tr in entity.possible_transitions():
   140             for tr in entity.possible_transitions():
   141                 url = entity.absolute_url(vid='statuschange', treid=tr.eid)
   141                 url = entity.absolute_url(vid='statuschange', treid=tr.eid)
   142                 menu_items.append(self.mk_action(_(tr.name), url))
   142                 menu_items.append(self.mk_action(_(tr.name), url))
   143             wfurl = self.build_url('cwetype/%s'%entity.e_schema, vid='workflow')
   143             # don't propose to see wf if user can't pass any transition
   144             menu_items.append(self.mk_action(_('view workflow'), wfurl))
   144             if menu_items:
   145             wfurl = entity.absolute_url(vid='wfhistory')
   145                 wfurl = self.build_url('cwetype/%s'%entity.e_schema, vid='workflow')
   146             menu_items.append(self.mk_action(_('view history'), wfurl))
   146                 menu_items.append(self.mk_action(_('view workflow'), wfurl))
       
   147             if entity.workflow_history:
       
   148                 wfurl = entity.absolute_url(vid='wfhistory')
       
   149                 menu_items.append(self.mk_action(_('view history'), wfurl))
   147             box.append(BoxMenu(menu_title, menu_items))
   150             box.append(BoxMenu(menu_title, menu_items))
   148         return None
   151         return None
   149 
   152 
   150     def linkto_url(self, entity, rtype, etype, target):
   153     def linkto_url(self, entity, rtype, etype, target):
   151         return self.build_url(vid='creation', etype=etype,
   154         return self.build_url(vid='creation', etype=etype,