Changeset 17023
- Timestamp:
- 13 Jul 2022, 06:17:23 (2 years ago)
- Location:
- main/kofacustom.lpng/trunk/src/kofacustom/lpng
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py
r17020 r17023 21 21 from zope.formlib.textwidgets import BytesDisplayWidget 22 22 from zope.component import getUtility 23 from hurry.workflow.interfaces import IWorkflowState 23 24 from waeup.kofa.widgets.datewidget import ( 24 25 FriendlyDateDisplayWidget, … … 33 34 ExportPDFPaymentSlipPage, 34 35 ApplicantBaseDisplayFormPage) 36 from waeup.kofa.applicants.workflow import ( 37 INITIALIZED, STARTED, PAID, SUBMITTED, 38 ADMITTED, NOT_ADMITTED, CREATED, PROCESSED) 35 39 from waeup.kofa.students.interfaces import IStudentsUtils 36 from waeup.kofa.applicants.interfaces import IApplicantOnlinePayment 40 from waeup.kofa.applicants.interfaces import ( 41 IApplicantOnlinePayment, IApplicantsUtils) 37 42 from kofacustom.nigeria.applicants.interfaces import INigeriaApplicantOnlinePayment 38 43 from kofacustom.nigeria.applicants.browser import NigeriaExportPDFPaymentSlipPage … … 72 77 73 78 @property 79 def display_actions(self): 80 actions = [[_('Save'), _('Finally Submit')], 81 [ 82 #_('Add online payment ticket'), 83 _('Add balance payment ticket'), 84 _('Remove selected tickets') 85 ]] 86 applicants_utils = getUtility(IApplicantsUtils) 87 if self.context.state not in applicants_utils.BALANCE_PAYMENT_STATES: 88 actions[1].pop(1) 89 return actions 90 91 @property 74 92 def form_fields(self): 75 93 form_fields = grok.AutoFields(ICustomApplicant) … … 85 103 def unremovable(self, ticket): 86 104 return True 105 106 @property 107 def display_actions(self): 108 state = IWorkflowState(self.context).getState() 109 actions = [[_('Save')], 110 [ 111 #_('Remove selected tickets') 112 ]] 113 if state == STARTED: 114 actions = [[_('Save')], 115 [ 116 #_('Add online payment ticket'), 117 #_('Remove selected tickets') 118 ]] 119 elif self.context.special and state == PAID: 120 actions = [[_('Save'), _('Finally Submit')], 121 [ 122 #_('Add online payment ticket'), 123 #_('Remove selected tickets') 124 ]] 125 elif state == PAID: 126 actions = [[_('Save'), _('Finally Submit')], 127 [ 128 #_('Remove selected tickets') 129 ]] 130 applicants_utils = getUtility(IApplicantsUtils) 131 if self.context.state in applicants_utils.BALANCE_PAYMENT_STATES: 132 actions[1].append(_('Add balance payment ticket')) 133 return actions 87 134 88 135 @property -
main/kofacustom.lpng/trunk/src/kofacustom/lpng/interswitch/tests.py
r17013 r17023 235 235 236 236 237 def test_interswitch_form(self):237 def disabled_test_interswitch_form(self): 238 238 # Manager can access InterswitchForm 239 239 self.browser.getLink("Pay via Interswitch", index=0).click()
Note: See TracChangeset for help on using the changeset viewer.