Changeset 6722 for main/waeup.sirp/trunk
- Timestamp:
- 12 Sep 2011, 13:31:51 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r6720 r6722 72 72 from waeup.sirp.accesscodes import invalidate_accesscode, get_access_code 73 73 from waeup.sirp.accesscodes.workflow import USED 74 from waeup.sirp.students.workflow import CLEARANCE 74 75 75 76 class StudentsTab(PrimaryNavTab): … … 598 599 grok.view(StudentClearanceDisplayFormPage) 599 600 grok.require('waeup.handleStudent') 600 text = 'Edit and submit'601 text = 'Edit' 601 602 target = 'cedit' 602 603 … … 615 616 form_fields = grok.AutoFields(IStudentClearanceEdit).omit('clearance_locked') 616 617 #grok.template('clearanceeditpage') 617 label = 'Edit cle rance data'618 label = 'Edit clearance data' 618 619 title = 'Clearance Data' 619 620 pnav = 4 … … 631 632 datepicker.need() 632 633 return super(StudentClearanceEditFormPage, self).update() 634 635 @grok.action('Save') 636 def save(self, **data): 637 self.applyData(self.context, **data) 638 self.flash('Form has been saved.') 639 return 640 641 @grok.action('Save and request clearance') 642 def requestclearance(self, **data): 643 self.applyData(self.context, **data) 644 self.context._p_changed = True 645 #if self.dataNotComplete(): 646 # self.flash(self.dataNotComplete()) 647 # return 648 state = IWorkflowState(self.context).getState() 649 # This shouldn't happen, but the application officer 650 # might have forgotten to lock the form after changing the state 651 if state != CLEARANCE: 652 self.flash('This form cannot be submitted. Wrong state!') 653 return 654 IWorkflowInfo(self.context).fireTransition('request_clearance') 655 self.flash('Clearance has been requested.') 656 self.redirect(self.url(self.context)) 657 return 633 658 634 659 class StartClearance(WAeUPPage): … … 668 693 invalidate_accesscode(pin,comment) 669 694 IWorkflowInfo(self.context).fireTransition('start_clearance') 670 self.context.application_date = datetime.now()671 self.context.clearance_locked = False672 695 self.flash('Clearance process is started.') 673 696 self.redirect(self.url(self.context)) -
main/waeup.sirp/trunk/src/waeup/sirp/students/workflow.py
r6720 r6722 82 82 ) 83 83 84 LOCK_CLEARANCE_TRANS = ('reset2', 'request_clearance') 85 UNLOCK_CLEARANCE_TRANS = ('reset3', 'reset4', 'start_clearance') 84 86 85 87 registration_workflow = WAeUPWorkflow(REGISTRATION_TRANSITIONS) … … 111 113 history = IObjectHistory(obj) 112 114 history.addMessage(msg) 115 if event.transition.transition_id in LOCK_CLEARANCE_TRANS: 116 obj.clearance_locked = True 117 if event.transition.transition_id in UNLOCK_CLEARANCE_TRANS: 118 obj.clearance_locked = False 113 119 # In some tests we don't have a students container or a user 114 120 try:
Note: See TracChangeset for help on using the changeset viewer.