- Timestamp:
- 9 Jun 2011, 16:59:04 (13 years ago)
- File:
-
- 1 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.')
Note: See TracChangeset for help on using the changeset viewer.