Changeset 7689 for main/waeup.sirp/trunk/src/waeup/sirp/accesscodes
- Timestamp:
- 23 Feb 2012, 12:43:11 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/accesscodes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscode.py
r7649 r7689 35 35 IAccessCode, IAccessCodeBatch, IAccessCodeBatchContainer 36 36 ) 37 from waeup.sirp.accesscodes.workflow import DISABLED, USED 37 from waeup.sirp.accesscodes.workflow import DISABLED, USED, ac_states_dict 38 38 39 39 class AccessCode(grok.Model): … … 129 129 """ 130 130 return IWorkflowState(self).getState() 131 132 @property 133 def translated_state(self): 134 """The translated workflow state. A read-only attribute. 135 """ 136 return ac_states_dict[self.state] 131 137 132 138 @property -
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/workflow.py
r7321 r7689 25 25 from waeup.sirp.accesscodes.interfaces import IAccessCode 26 26 from waeup.sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo 27 from waeup.sirp.interfaces import MessageFactory as _ 27 28 from waeup.sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo 28 29 … … 30 31 USED = 'used' 31 32 DISABLED = 'disabled' 33 34 ac_states_dict = { 35 INITIALIZED: _('initialized'), 36 USED: _('used'), 37 DISABLED: _('disabled'), 38 } 32 39 33 40 def invalidate_action(wf, context): … … 70 77 Transition( 71 78 transition_id = 'init', 72 title = 'Initialize PIN',79 title = _('Initialize PIN'), 73 80 source = None, 74 81 condition = NullCondition, … … 77 84 Transition( 78 85 transition_id = 'use', 79 title = 'Use PIN',86 title = _('Use PIN'), 80 87 source = INITIALIZED, 81 88 destination = USED, … … 84 91 Transition( 85 92 transition_id = 'disable_unused', 86 title = 'Disable unused PIN',93 title = _('Disable unused PIN'), 87 94 source = INITIALIZED, 88 95 destination = DISABLED, … … 91 98 Transition( 92 99 transition_id = 'disable_used', 93 title = 'Disable used PIN',100 title = _('Disable used PIN'), 94 101 source = USED, 95 102 destination = DISABLED, … … 98 105 Transition( 99 106 transition_id = 'reenable', 100 title = 'Reenable disabled PIN',107 title = _('Reenable disabled PIN'), 101 108 source = DISABLED, 102 109 destination = INITIALIZED,
Note: See TracChangeset for help on using the changeset viewer.