Changeset 15950


Ignore:
Timestamp:
24 Jan 2020, 08:36:46 (5 years ago)
Author:
Henrik Bettermann
Message:

Add Fedex payment application.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/applicants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/applicant.py

    r15530 r15950  
    2626from waeup.aaue.applicants.interfaces import(
    2727    ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit,
    28     IPUTMEApplicantEdit, ITranscriptApplicant, ICertificateRequest)
     28    IPUTMEApplicantEdit, ITranscriptApplicant, ICertificateRequest,
     29    IFedexRequest)
    2930
    3031@grok.subscribe(ICustomApplicant, grok.IObjectRemovedEvent)
     
    4142    grok.implements(ICustomApplicant, ICustomUGApplicantEdit,
    4243        ICustomPGApplicantEdit, IPUTMEApplicantEdit,
    43         ITranscriptApplicant, ICertificateRequest)
     44        ITranscriptApplicant, ICertificateRequest,
     45        IFedexRequest)
    4446    grok.provides(ICustomApplicant)
    4547
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py

    r15948 r15950  
    5454    ICustomApplicant,
    5555    IVerificationRequest,
    56     ISendByEmailRequest
     56    ISendByEmailRequest,
     57    IFedexRequest
    5758    )
    5859
     
    246247            form_fields['body_address'].custom_widget = BytesDisplayWidget
    247248            return form_fields
     249        if self.target is not None and self.target == 'fedex':
     250            form_fields = grok.AutoFields(IFedexRequest).omit(
     251                'locked', 'suspended')
     252            form_fields['dispatch_address'].custom_widget = BytesDisplayWidget
     253            return form_fields
    248254        if self.target is not None and self.target == 'send':
    249255            form_fields = grok.AutoFields(ISendByEmailRequest).omit(
     
    415421            form_fields['applicant_id'].for_display = True
    416422            return form_fields
     423        if self.target is not None and self.target == 'fedex':
     424            form_fields = grok.AutoFields(IFedexRequest)
     425            form_fields['applicant_id'].for_display = True
     426            return form_fields
    417427        # AAUE is using the same interface for all regular applications.
    418428        form_fields = grok.AutoFields(ICustomUGApplicant)
     
    532542        if self.target is not None and self.target == 'send':
    533543            form_fields = grok.AutoFields(ISendByEmailRequest).omit(
     544                'locked', 'suspended')
     545            form_fields['applicant_id'].for_display = True
     546            return form_fields
     547        if self.target is not None and self.target == 'fedex':
     548            form_fields = grok.AutoFields(IFedexRequest).omit(
    534549                'locked', 'suspended')
    535550            form_fields['applicant_id'].for_display = True
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py

    r15861 r15950  
    899899        )
    900900
     901class IFedexRequest(IKofaObject):
     902    """A applicant requests payment for courier.
     903    """
     904
     905    suspended = schema.Bool(
     906        title = _(u'Account suspended'),
     907        default = False,
     908        required = False,
     909        )
     910
     911    locked = schema.Bool(
     912        title = _(u'Form locked'),
     913        default = False,
     914        required = False,
     915        )
     916
     917    applicant_id = schema.TextLine(
     918        title = _(u'Applicant Id'),
     919        required = False,
     920        readonly = False,
     921        )
     922
     923    #reg_number = TextLineChoice(
     924    #    title = _(u'Kofa Registration Number'),
     925    #    readonly = False,
     926    #    required = True,
     927    #    source = contextual_reg_num_source,
     928    #    )
     929
     930    firstname = schema.TextLine(
     931        title = _(u'First Name'),
     932        required = True,
     933        )
     934
     935    middlename = schema.TextLine(
     936        title = _(u'Middle Name'),
     937        required = False,
     938        )
     939
     940    lastname = schema.TextLine(
     941        title = _(u'Last Name (Surname)'),
     942        required = True,
     943        )
     944
     945    sex = schema.Choice(
     946        title = _(u'Gender'),
     947        source = GenderSource(),
     948        required = True,
     949        )
     950
     951    email = schema.ASCIILine(
     952        title = _(u'Email Address'),
     953        required = True,
     954        constraint=validate_email,
     955        )
     956
     957    phone = PhoneNumber(
     958        title = _(u'Phone'),
     959        description = u'',
     960        required = False,
     961        )
     962
     963    matric_number = schema.TextLine(
     964        title = _(u'WES Reference Number (where applicable)'),
     965        readonly = False,
     966        required = False,
     967        )
     968
     969    dispatch_address = schema.Text(
     970        title = _(u'Dispatch Address'),
     971        required = True,
     972        )
     973
    901974class ISendByEmailRequest(IKofaObject):
    902975    """A applicant asking for sending an email.
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/utils.py

    r15948 r15950  
    4747        'ver': ['Verification Request', 'VR'],
    4848        'send': ['Send-By-Email Request', 'SE'],
     49        'fedex': ['Payment for Courier (Fedex)', 'FED'],
    4950        }
    5051
Note: See TracChangeset for help on using the changeset viewer.