Changeset 6305 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 9 Jun 2011, 16:59:04 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6303 r6305 25 25 import grok 26 26 27 from datetime import datetime 27 28 from zope.component import getUtility 28 29 from zope.formlib.widget import CustomWidgetFactory … … 77 78 MultiListDisplayWidget, subwidget=results_display_widget) 78 79 80 TRANSITION_OBJECTS = create_workflow() 81 82 TRANSITION_DICT = dict([ 83 (transition_object.transition_id,transition_object.title) 84 for transition_object in TRANSITION_OBJECTS]) 85 79 86 class ApplicantsRootPage(WAeUPPage): 80 87 grok.context(IApplicantsRoot) … … 416 423 if state == INITIALIZED: 417 424 IWorkflowInfo(self.context[pin]).fireTransition('start') 425 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M") 426 transition_title = TRANSITION_DICT['start'] 427 self.context[pin].messages += '<br />%s - %s' % (timestamp,transition_title) 418 428 self.redirect(self.url(self.context[pin], 'edit')) 419 429 return … … 507 517 def getTransitions(self): 508 518 allowed_transitions_ids = IWorkflowInfo(self.context).getManualTransitionIds() 509 transition_objects = create_workflow()510 519 null_transition = [{'name': '', 'title':'No transition'}] 511 520 transitions = null_transition + [dict( 512 521 name=transition_object.transition_id, 513 522 title=transition_object.title) 514 for transition_object in transition_objects523 for transition_object in TRANSITION_OBJECTS 515 524 if transition_object.transition_id in allowed_transitions_ids] 516 525 #import pdb; pdb.set_trace() … … 528 537 form = self.request.form 529 538 if form.has_key('transition') and form['transition']: 530 transition = form['transition'] 531 IWorkflowInfo(self.context).fireTransition(transition) 539 transition_id = form['transition'] 540 IWorkflowInfo(self.context).fireTransition(transition_id) 541 #import pdb; pdb.set_trace() 542 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M") 543 transition_title = TRANSITION_DICT[transition_id] 544 self.context.messages += '<br />%s - %s' % (timestamp,transition_title) 532 545 self.flash('Form has been saved.') 533 546 return … … 594 607 return 595 608 IWorkflowInfo(self.context).fireTransition('submit') 609 timestamp = datetime.now().strftime("%d/%m/%Y %H:%M") 610 transition_title = TRANSITION_DICT['submit'] 611 self.context.messages += '<br />%s - %s' % (timestamp,transition_title) 596 612 self.context.locked = True 597 613 self.flash('Form has been submitted.') -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_display.pt
r6303 r6305 5 5 <h3>Application Status: 6 6 <span tal:replace="view/getApplicationState">Application State</span></h3> 7 <div class="workflow" tal:content="structure context/messages">Application Workflow</div> 7 8 8 9 <table class="zebra"> -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/form_edit.pt
r6303 r6305 8 8 <h3>Application Status: 9 9 <span tal:replace="view/getApplicationState">Application State</span></h3> 10 <div class="workflow" tal:content="structure context/messages">Application Workflow</div> 10 11 11 12 <div class="form-status"
Note: See TracChangeset for help on using the changeset viewer.