Changeset 14807 for main/kofacustom.dspg/trunk/src/kofacustom/dspg
- Timestamp:
- 18 Aug 2017, 10:26:59 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.dspg/trunk/src/kofacustom/dspg/applicants/browser.py
r14732 r14807 21 21 from zope.component import getUtility 22 22 from zope.i18n import translate 23 from hurry.workflow.interfaces import IWorkflowState 23 24 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 24 25 from zope.formlib.textwidgets import BytesDisplayWidget … … 32 33 PaymentReceiptActionButton, PDFActionButton) 33 34 from waeup.kofa.applicants.pdf import PDFApplicationSlip 35 from waeup.kofa.applicants.workflow import ADMITTED, PAID, STARTED 34 36 from kofacustom.nigeria.applicants.interfaces import ( 35 37 UG_OMIT_DISPLAY_FIELDS, … … 178 180 """ 179 181 180 @property 181 def form_fields(self): 182 182 def unremovable(self, ticket): 183 return True 184 185 @property 186 def form_fields(self): 183 187 if self.context.special: 184 188 form_fields = grok.AutoFields(ISpecialApplicant).omit( … … 200 204 return form_fields 201 205 206 @property 207 def display_actions(self): 208 state = IWorkflowState(self.context).getState() 209 # If the form is unlocked, applicants are allowed to save the form 210 # and remove unused tickets. 211 actions = [[_('Save')], []] 212 # Only in state started they can also add tickets. 213 if state == STARTED: 214 actions = [[_('Save')], 215 [_('Add online payment ticket'),]] 216 # In state paid, they can submit the data and further add tickets 217 # if the application is special. 218 elif self.context.special and state == PAID: 219 actions = [[_('Save'), _('Finally Submit')], 220 [_('Add online payment ticket'),]] 221 elif state == PAID: 222 actions = [[_('Save'), _('Finally Submit')], []] 223 return actions 224 202 225 class CustomApplicationFeePaymentAddPage(ApplicationFeePaymentAddPage): 203 226 """ Page to add an online payment ticket
Note: See TracChangeset for help on using the changeset viewer.