Changeset 6339
- Timestamp:
- 10 Jun 2011, 15:41:32 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/applicants.py
r6332 r6339 27 27 from zope.schema.fieldproperty import FieldProperty 28 28 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 29 from waeup.sirp.interfaces import IWAeUPSIRPPluggable 29 from waeup.sirp.interfaces import IWAeUPSIRPPluggable, IObjectHistory 30 30 from waeup.sirp.app import University 31 31 from waeup.sirp.applicants.interfaces import ( … … 54 54 state = IWorkflowState(self).getState() 55 55 return state 56 57 @property 58 def history(self): 59 history = IObjectHistory(self) 60 return history 56 61 57 62 # Set all attributes of Applicant required in IApplicant as field -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_display.pt
r6332 r6339 5 5 <h2> ... <span tal:replace="context/state">Application State</span> ... </h2> 6 6 7 <div class="workflow" tal: content="structure context/msgs">8 Application Workflow7 <div class="workflow" tal:repeat="msg context/history/messages"> 8 <span tal:replace="msg">message</span><br /> 9 9 </div> 10 10 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_edit.pt
r6332 r6339 8 8 <h2> ... <span tal:replace="context/state">Application State</span> ... </h2> 9 9 10 <div class="workflow" tal:content="structure context/msgs">Application Workflow</div> 11 10 <div class="workflow" tal:repeat="msg context/history/messages"> 11 <span tal:replace="msg">message</span><br /> 12 </div> 12 13 13 14 <div class="form-status" -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r6337 r6339 283 283 state, depending on use-case. 284 284 """ 285 msgs = Attribute('Workflow transitions with date of transition.')285 history = Attribute('Object history, a list of messages.') 286 286 state = Attribute('Returns the application state of an applicant') 287 287 … … 402 402 """An applicant. 403 403 404 Here we can repeat the fields from base data and set the `required` and 405 `readonly` attributes to True to further restrict the data access. We cannot 406 omit fields. This has to be done in the respective form page. 404 Here we can repeat the fields from base data and set the 405 `required` and `readonly` attributes to True to further restrict 406 the data access. We cannot omit fields. This has to be done in the 407 respective form page. 407 408 """ 408 409 screening_score = schema.Int( -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py
r6335 r6339 10 10 InvalidTransitionError, IWorkflowTransitionEvent) 11 11 from waeup.sirp.applicants.interfaces import IApplicantBaseData 12 from waeup.sirp.interfaces import IObjectHistory 12 13 13 14 … … 172 173 """ 173 174 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M:%S") 174 # XXX: We should not store HTML code but simple messages.175 175 msg = '%s - %s (new state: %s)' % ( 176 176 timestamp, event.transition.user_data['msg'], event.destination) 177 msgs = getattr(obj, 'msgs', None) 178 if msgs: 179 msgs += '<br />' 180 msgs += msg 181 else: 182 msgs = msg 183 obj.msgs = msgs 177 history = IObjectHistory(obj) 178 history.addMessage(msg) 184 179 return
Note: See TracChangeset for help on using the changeset viewer.