web/views/boxes.py
branch3.5
changeset 2920 64322aa83a1d
parent 2650 18aec79ec3a3
child 2993 2d06451013ac
--- a/web/views/boxes.py	Thu Aug 20 17:33:05 2009 +0200
+++ b/web/views/boxes.py	Thu Aug 20 17:44:27 2009 +0200
@@ -142,12 +142,11 @@
 
 
     def workflow_actions(self, entity, box):
-        if 'in_state' in entity.e_schema.subject_relations() and entity.in_state:
+        if entity.e_schema.has_subject_relation('in_state') and entity.in_state:
             _ = self.req._
-            state = entity.in_state[0]
-            menu_title = u'%s: %s' % (_('state'), state.view('text'))
+            menu_title = u'%s: %s' % (_('state'), entity.printable_state)
             menu_items = []
-            for tr in state.transitions(entity):
+            for tr in entity.possible_transitions():
                 url = entity.absolute_url(vid='statuschange', treid=tr.eid)
                 menu_items.append(self.mk_action(_(tr.name), url))
             wfurl = self.build_url('cwetype/%s'%entity.e_schema, vid='workflow')