equal
deleted
inserted
replaced
254 |
254 |
255 class Transition(BaseTransition): |
255 class Transition(BaseTransition): |
256 """customized class for Transition entities""" |
256 """customized class for Transition entities""" |
257 __regid__ = 'Transition' |
257 __regid__ = 'Transition' |
258 |
258 |
|
259 def dc_long_title(self): |
|
260 return '%s (%s)' % (self.name, self._cw._(self.name)) |
|
261 |
259 def destination(self, entity): |
262 def destination(self, entity): |
260 try: |
263 try: |
261 return self.destination_state[0] |
264 return self.destination_state[0] |
262 except IndexError: |
265 except IndexError: |
263 return entity.cw_adapt_to('IWorkflowable').latest_trinfo().previous_state |
266 return entity.cw_adapt_to('IWorkflowable').latest_trinfo().previous_state |
342 class State(AnyEntity): |
345 class State(AnyEntity): |
343 """customized class for State entities""" |
346 """customized class for State entities""" |
344 __regid__ = 'State' |
347 __regid__ = 'State' |
345 fetch_attrs, cw_fetch_order = fetch_config(['name']) |
348 fetch_attrs, cw_fetch_order = fetch_config(['name']) |
346 rest_attr = 'eid' |
349 rest_attr = 'eid' |
|
350 |
|
351 def dc_long_title(self): |
|
352 return '%s (%s)' % (self.name, self._cw._(self.name)) |
347 |
353 |
348 @property |
354 @property |
349 def workflow(self): |
355 def workflow(self): |
350 # take care, may be missing in multi-sources configuration |
356 # take care, may be missing in multi-sources configuration |
351 return self.state_of and self.state_of[0] or None |
357 return self.state_of and self.state_of[0] or None |