Changeset 17190


Ignore:
Timestamp:
1 Dec 2022, 08:51:54 (2 years ago)
Author:
Henrik Bettermann
Message:

Add USSD payment infos.

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  
    2626    FriendlyDatetimeDisplayWidget)
    2727from waeup.kofa.applicants.pdf import PDFApplicationSlip
    28 from waeup.kofa.browser.layout import KofaEditFormPage, action
     28from waeup.kofa.browser.layout import KofaEditFormPage, KofaPage, action
    2929from waeup.kofa.applicants.browser import (
    3030    ApplicantRegistrationPage, ApplicantsContainerPage,
     
    147147        applicants_utils = getUtility(IApplicantsUtils)
    148148        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'))
    150151        return actions
    151152
     
    160161        form_fields['reg_number'].for_display = True
    161162        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
    162187       
    163188class CustomBalancePaymentAddFormPage(BalancePaymentAddFormPage):
     
    232257            self.redirect(self.url(self.context))
    233258        return
     259
     260class 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  
    2121from waeup.kofa.applicants.viewlets import ApplicantsAuthTab
    2222from kofacustom.lpng.applicants.interfaces import ICustomApplicant
    23 from kofacustom.lpng.applicants.browser import ApplicantDisplayFormPage
     23from kofacustom.lpng.applicants.browser import (ApplicantDisplayFormPage,
     24    ApplicantEditFormPage)
    2425
    2526from kofacustom.lpng.interfaces import MessageFactory as _
     
    4041
    4142class SelectPunitActionButton(ManageActionButton):
    42     grok.order(1)
     43    grok.order(2)
    4344    grok.context(ICustomApplicant)
    4445    grok.require('waeup.handleApplication')
     
    4748    text = _('Locate Polling Unit')
    4849    target ='punitformpage'
     50
     51class 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
     60class MakeUSSDDonationActionButton2(MakeUSSDDonationActionButton):
     61    grok.view(ApplicantEditFormPage)
Note: See TracChangeset for help on using the changeset viewer.