Changeset 6322 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 10 Jun 2011, 06:58:09 (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
r6314 r6322 47 47 def __init__(self): 48 48 super(Applicant, self).__init__() 49 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M") 49 50 #Initialize workflow state... 50 51 IWorkflowInfo(self).fireTransition('init') 51 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M")52 self.messages = u'%s - Initialize application' % timestamp53 52 54 53 # Set all attributes of Applicant required in IApplicant as field -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6321 r6322 76 76 TRANSITION_OBJECTS = create_workflow() 77 77 78 TRANSITION_DICT = dict([79 (transition_object.transition_id,transition_object.title)80 for transition_object in TRANSITION_OBJECTS])78 #TRANSITION_DICT = dict([ 79 # (transition_object.transition_id,transition_object.title) 80 # for transition_object in TRANSITION_OBJECTS]) 81 81 82 82 class ApplicantsRootPage(WAeUPPage): … … 419 419 if state == INITIALIZED: 420 420 IWorkflowInfo(self.context[pin]).fireTransition('start') 421 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M")422 transition_title = TRANSITION_DICT['start']423 self.context[pin].messages += '<br />%s - %s' % (424 timestamp,transition_title)425 421 self.redirect(self.url(self.context[pin], 'edit')) 426 422 return … … 496 492 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 497 493 grok.template('form_edit') 494 manage_applications = True 498 495 pnav = 3 499 496 … … 551 548 form_fields['date_of_birth'].custom_widget = FriendlyDateWidget('le-year') 552 549 grok.template('form_edit') 550 manage_applications = False 551 553 552 554 553 def emitLockMessage(self): … … 566 565 567 566 def dataNotComplete(self): 568 if self.context.confirm_passport is not True: 567 #import pdb; pdb.set_trace() 568 if not self.request.form.get('confirm_passport', False): 569 569 return 'Passport confirmation box not ticked.' 570 570 if len(self.errors) > 0: … … 572 572 return False 573 573 574 @property575 def getTransitions(self):576 return None577 578 574 @grok.action('Save') 579 575 def save(self, **data): … … 597 593 return 598 594 state = IWorkflowState(self.context).getState() 599 # Cannot happen but anyway ... 595 # This shouldn't happen, but the application officer 596 # might have forgotten to lock the form after changing the state 600 597 if state != STARTED: 601 self.flash('This form cannot be submitted. ')598 self.flash('This form cannot be submitted. Wrong state!') 602 599 return 603 600 IWorkflowInfo(self.context).fireTransition('submit') -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_edit.pt
r6307 r6322 54 54 </tr> 55 55 </tal:block> 56 <tr tal:condition="view/ getTransitions">56 <tr tal:condition="view/manage_applications"> 57 57 <td class="label"><label>Application Transition:</label></td> 58 58 <td> … … 68 68 </table> 69 69 70 <p tal:condition="not: view/manage_applications"> 71 <input class="checkboxType" id="confirm_passport" name="confirm_passport" type="checkbox" value="True"/> 72 I confirm that the Passport Photograph uploaded on this form is a true picture of me. 73 </p> 74 70 75 <div id="actionsView"> 71 76 <span class="actionButtons" tal:condition="view/availableActions"> -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/interfaces.py
r6313 r6322 347 347 max_size = 20480, 348 348 ) 349 confirm_passport = schema.Bool( 350 title = u"Passport picture confirmed", 351 default = False, 352 required = True, 353 ) 349 354 350 # 355 351 # Process Data … … 408 404 omit fields. This has to be done in the respective form page. 409 405 """ 410 application_state = Attribute("The workflow state of an applicant object.")411 412 406 screening_score = schema.Int( 413 407 title = u'Screening Score', … … 427 421 readonly = True, 428 422 ) 429 entry_session = schema. TextLine(430 # XXX: should be choice423 entry_session = schema.Choice( 424 source = entry_session_vocab, 431 425 title = u'Entry Session', 432 426 required = False, 433 readonly = True ,427 readonly = True 434 428 ) 435 429 notice = schema.Text( … … 437 431 required = False, 438 432 readonly = True, 439 )440 confirm_passport = schema.Bool(441 title = u"I confirm that the Passport Photograph uploaded on this form is a true picture of me.",442 default = False,443 required = True,444 433 ) 445 434 -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py
r6318 r6322 25 25 source = None, 26 26 condition = NullCondition, 27 msg = 'appplication process initialized', 27 28 destination = INITIALIZED) 28 29 … … 30 31 transition_id = 'start', 31 32 title = 'Start application', 33 msg = 'appplication process started', 32 34 source = INITIALIZED, 33 35 destination = STARTED) … … 36 38 transition_id = 'submit', 37 39 title = 'Submit application', 40 msg = 'appplication record submitted', 38 41 source = STARTED, 39 42 destination = SUBMITTED) … … 42 45 transition_id = 'admit', 43 46 title = 'Admit applicant', 47 msg = 'appplicant admitted', 44 48 source = SUBMITTED, 45 49 destination = ADMITTED) … … 48 52 transition_id = 'refuse1', 49 53 title = 'Refuse application', 54 msg = 'appplication refused', 50 55 source = SUBMITTED, 51 56 destination = NOT_ADMITTED) … … 54 59 transition_id = 'refuse2', 55 60 title = 'Refuse application', 61 msg = 'appplication refused', 56 62 source = ADMITTED, 57 63 destination = NOT_ADMITTED) … … 60 66 transition_id = 'create', 61 67 title = 'Create student record', 68 msg = 'student record created', 62 69 source = ADMITTED, 63 70 destination = CREATED) … … 66 73 transition_id = 'reset1', 67 74 title = 'Reset application', 75 msg = 'appplication record reset', 68 76 source = SUBMITTED, 69 77 destination = STARTED) … … 72 80 transition_id = 'reset2', 73 81 title = 'Reset application', 82 msg = 'appplication record reset', 74 83 source = ADMITTED, 75 84 destination = STARTED) … … 78 87 transition_id = 'reset3', 79 88 title = 'Reset application', 89 msg = 'appplication record reset', 80 90 source = NOT_ADMITTED, 81 91 destination = STARTED) … … 84 94 transition_id = 'reset4', 85 95 title = 'Reset application', 96 msg = 'appplication record reset', 86 97 source = CREATED, 87 98 destination = STARTED) … … 161 172 """ 162 173 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M:%S") 163 comment = event.comment or '(no comment)'164 174 # XXX: `messages` is meta data which shouldn't really be part of 165 175 # the Applicant class. Furthermore we should not store HTML … … 169 179 # to finetune transitions instead of doing that manually in 170 180 # UI stuff. 171 msg = '%s - %s to %s: %s: %s' % ( 172 timestamp, event.source, event.destination, event.transition.title, 173 comment) 181 msg = '%s - %s (new state: %s)' % ( 182 timestamp, event.transition.user_data['msg'], event.destination) 174 183 msgs = getattr(obj, 'messages', None) 175 if msgs != '':184 if msgs: 176 185 msgs += '<br />' 177 obj.messages += msg 186 msgs += msg 187 else: 188 msgs = msg 189 obj.messages = msgs 178 190 return
Note: See TracChangeset for help on using the changeset viewer.