web/views/boxes.py
branch3.5
changeset 2920 64322aa83a1d
parent 2650 18aec79ec3a3
child 2993 2d06451013ac
equal deleted inserted replaced
2919:662f35236d1c 2920:64322aa83a1d
   140                     if teschema.has_local_role('add') or teschema.has_perm(req, 'add'):
   140                     if teschema.has_local_role('add') or teschema.has_perm(req, 'add'):
   141                         yield rschema, teschema, role
   141                         yield rschema, teschema, role
   142 
   142 
   143 
   143 
   144     def workflow_actions(self, entity, box):
   144     def workflow_actions(self, entity, box):
   145         if 'in_state' in entity.e_schema.subject_relations() and entity.in_state:
   145         if entity.e_schema.has_subject_relation('in_state') and entity.in_state:
   146             _ = self.req._
   146             _ = self.req._
   147             state = entity.in_state[0]
   147             menu_title = u'%s: %s' % (_('state'), entity.printable_state)
   148             menu_title = u'%s: %s' % (_('state'), state.view('text'))
       
   149             menu_items = []
   148             menu_items = []
   150             for tr in state.transitions(entity):
   149             for tr in entity.possible_transitions():
   151                 url = entity.absolute_url(vid='statuschange', treid=tr.eid)
   150                 url = entity.absolute_url(vid='statuschange', treid=tr.eid)
   152                 menu_items.append(self.mk_action(_(tr.name), url))
   151                 menu_items.append(self.mk_action(_(tr.name), url))
   153             wfurl = self.build_url('cwetype/%s'%entity.e_schema, vid='workflow')
   152             wfurl = self.build_url('cwetype/%s'%entity.e_schema, vid='workflow')
   154             menu_items.append(self.mk_action(_('view workflow'), wfurl))
   153             menu_items.append(self.mk_action(_('view workflow'), wfurl))
   155             wfurl = entity.absolute_url(vid='wfhistory')
   154             wfurl = entity.absolute_url(vid='wfhistory')