- Timestamp:
- 1 Dec 2022, 08:51:54 (2 years ago)
- Location:
- main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/browser.py
r17175 r17190 26 26 FriendlyDatetimeDisplayWidget) 27 27 from waeup.kofa.applicants.pdf import PDFApplicationSlip 28 from waeup.kofa.browser.layout import KofaEditFormPage, action28 from waeup.kofa.browser.layout import KofaEditFormPage, KofaPage, action 29 29 from waeup.kofa.applicants.browser import ( 30 30 ApplicantRegistrationPage, ApplicantsContainerPage, … … 147 147 applicants_utils = getUtility(IApplicantsUtils) 148 148 if self.context.state in applicants_utils.BALANCE_PAYMENT_STATES: 149 actions[1].append(_('Add balance payment ticket')) 149 actions[1].append(_('Make Donation')) 150 #actions[1].append(_('Make Donation via USSD')) 150 151 return actions 151 152 … … 160 161 form_fields['reg_number'].for_display = True 161 162 return form_fields 163 164 @action(_('Save'), style='primary') 165 def save(self, **data): 166 if self.upload_success is False: # False is not None! 167 # Error during image upload. Ignore other values. 168 return 169 self.applyData(self.context, **data) 170 self.flash(_('Form has been saved.')) 171 return 172 173 @action(_('Add online payment ticket'), style='primary') 174 def addPaymentTicket(self, **data): 175 self.redirect(self.url(self.context, '@@addafp')) 176 return 177 178 @action(_('Make Donation'), style='primary') 179 def addBalancePaymentTicket(self, **data): 180 self.redirect(self.url(self.context, '@@addbp')) 181 return 182 183 @action(_('Make Donation via USSD Money Transfer'), style='primary') 184 def makeUSSDonation(self, **data): 185 self.redirect(self.url(self.context, '@USSSD')) 186 return 162 187 163 188 class CustomBalancePaymentAddFormPage(BalancePaymentAddFormPage): … … 232 257 self.redirect(self.url(self.context)) 233 258 return 259 260 class USSDInfoPage(KofaPage): 261 """ 262 """ 263 grok.context(ICustomApplicant) 264 grok.require('waeup.handleApplication') 265 grok.name('ussdinfo') 266 label = _('Donate via USSD') 267 grok.template('ussdinfo') 268 pnav = 3 -
main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/viewlets.py
r17091 r17190 21 21 from waeup.kofa.applicants.viewlets import ApplicantsAuthTab 22 22 from kofacustom.lpng.applicants.interfaces import ICustomApplicant 23 from kofacustom.lpng.applicants.browser import ApplicantDisplayFormPage 23 from kofacustom.lpng.applicants.browser import (ApplicantDisplayFormPage, 24 ApplicantEditFormPage) 24 25 25 26 from kofacustom.lpng.interfaces import MessageFactory as _ … … 40 41 41 42 class SelectPunitActionButton(ManageActionButton): 42 grok.order( 1)43 grok.order(2) 43 44 grok.context(ICustomApplicant) 44 45 grok.require('waeup.handleApplication') … … 47 48 text = _('Locate Polling Unit') 48 49 target ='punitformpage' 50 51 class MakeUSSDDonationActionButton(ManageActionButton): 52 grok.order(1) 53 grok.context(ICustomApplicant) 54 grok.require('waeup.handleApplication') 55 grok.view(ApplicantDisplayFormPage) 56 icon = 'actionicon_donate.png' 57 text = _('Make Donation via USSD') 58 target ='ussdinfo' 59 60 class MakeUSSDDonationActionButton2(MakeUSSDDonationActionButton): 61 grok.view(ApplicantEditFormPage)
Note: See TracChangeset for help on using the changeset viewer.