- Timestamp:
- 21 Nov 2014, 13:05:56 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12018 r12028 378 378 379 379 class CustomerTriggerTransitionFormPage(IkobaEditFormPage): 380 """ View to manage customer base data380 """ View to trigger customer workflow transitions 381 381 """ 382 382 grok.context(ICustomer) … … 793 793 return 794 794 795 795 796 class DocumentEditFormPage(DocumentManageFormPage): 796 797 """ Page to edit a document 797 798 """ 798 grok.context(ICustomerDocument)799 799 grok.name('edit') 800 800 grok.require('waeup.handleCustomer') 801 form_fields = grok.AutoFields(ICustomerDocument)802 pnav = 4803 801 804 802 def update(self): … … 807 805 return 808 806 return super(DocumentEditFormPage, self).update() 807 808 809 class DocumentTriggerTransitionFormPage(IkobaEditFormPage): 810 """ View to trigger customer document transitions 811 """ 812 grok.context(ICustomerDocument) 813 grok.name('trigtrans') 814 grok.require('waeup.triggerTransition') 815 grok.template('trigtrans') 816 label = _('Trigger document transition') 817 pnav = 4 818 819 def update(self): 820 return super(IkobaEditFormPage, self).update() 821 822 def getTransitions(self): 823 """Return a list of dicts of allowed transition ids and titles. 824 825 Each list entry provides keys ``name`` and ``title`` for 826 internal name and (human readable) title of a single 827 transition. 828 """ 829 wf_info = IWorkflowInfo(self.context) 830 allowed_transitions = [t for t in wf_info.getManualTransitions()] 831 return [dict(name='', title=_('No transition'))] +[ 832 dict(name=x, title=y) for x, y in allowed_transitions] 833 834 @action(_('Save'), style='primary') 835 def save(self, **data): 836 form = self.request.form 837 if 'transition' in form and form['transition']: 838 transition_id = form['transition'] 839 wf_info = IWorkflowInfo(self.context) 840 wf_info.fireTransition(transition_id) 841 return
Note: See TracChangeset for help on using the changeset viewer.