Ignore:
Timestamp:
31 Jul 2019, 11:55:46 (5 years ago)
Author:
Henrik Bettermann
Message:

Implement "Scanned Result/Certificate? via email" application form.

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

Legend:

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

    r15530 r15531  
    5252    ICertificateRequest,
    5353    ICustomApplicant,
    54     IVerificationRequest
     54    IVerificationRequest,
     55    ISendByEmailRequest
    5556    )
    5657
     
    280281            form_fields['body_address'].custom_widget = BytesDisplayWidget
    281282            return form_fields
     283        if self.target is not None and self.target == 'send':
     284            form_fields = grok.AutoFields(ISendByEmailRequest).omit(
     285                'locked', 'suspended')
     286            form_fields['body_address'].custom_widget = BytesDisplayWidget
     287            return form_fields
    282288        if self.target is not None and self.target == 'cert':
    283289            form_fields = grok.AutoFields(ICertificateRequest).omit(
     
    419425        if self.target is not None and self.target == 'ver':
    420426            form_fields = grok.AutoFields(IVerificationRequest)
     427            form_fields['applicant_id'].for_display = True
     428            return form_fields
     429        if self.target is not None and self.target == 'send':
     430            form_fields = grok.AutoFields(ISendByEmailRequest)
    421431            form_fields['applicant_id'].for_display = True
    422432            return form_fields
     
    482492            not store.getFileByContext(self.context, attr=u'stateresult.pdf'):
    483493            return _('No statement of result pdf file uploaded.')
     494        if self.target in ('ver',) and \
     495            not store.getFileByContext(self.context, attr=u'verificationdoc.pdf'):
     496            return _('No pdf file uploaded.')
    484497
    485498        return False
     
    544557        if self.target is not None and self.target == 'ver':
    545558            form_fields = grok.AutoFields(IVerificationRequest).omit(
     559                'locked', 'suspended')
     560            form_fields['applicant_id'].for_display = True
     561            return form_fields
     562        if self.target is not None and self.target == 'send':
     563            form_fields = grok.AutoFields(ISendByEmailRequest).omit(
    546564                'locked', 'suspended')
    547565            form_fields['applicant_id'].for_display = True
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py

    r15530 r15531  
    867867        )
    868868
     869class ISendByEmailRequest(IKofaObject):
     870    """A applicant asking for sending an email.
     871    """
     872
     873    suspended = schema.Bool(
     874        title = _(u'Account suspended'),
     875        default = False,
     876        required = False,
     877        )
     878
     879    locked = schema.Bool(
     880        title = _(u'Form locked'),
     881        default = False,
     882        required = False,
     883        )
     884
     885    applicant_id = schema.TextLine(
     886        title = _(u'Applicant Id'),
     887        required = False,
     888        readonly = False,
     889        )
     890
     891    firstname = schema.TextLine(
     892        title = _(u'First Name'),
     893        required = True,
     894        )
     895
     896    middlename = schema.TextLine(
     897        title = _(u'Middle Name'),
     898        required = False,
     899        )
     900
     901    lastname = schema.TextLine(
     902        title = _(u'Last Name (Surname)'),
     903        required = True,
     904        )
     905
     906    email = schema.ASCIILine(
     907        title = _(u"Applicant's Email Address"),
     908        required = True,
     909        constraint=validate_email,
     910        )
     911
     912    body_address = schema.Text(
     913        title = _(u'Address of Requesting Organization'),
     914        required = True,
     915        )
     916
     917    body_email = schema.ASCIILine(
     918        title = _(u"Email Address of Requesting Organization"),
     919        required = True,
     920        constraint=validate_email,
     921        )
    869922
    870923class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant,
    871924                       ITranscriptApplicant, ICertificateRequest,
    872                        IVerificationRequest):
     925                       IVerificationRequest, ISendByEmailRequest):
    873926    """An interface for all types of applicants.
    874927
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/utils.py

    r15530 r15531  
    4343        'dsh': ['Science and Humanities Programme', 'DSH'],
    4444        'ver': ['Verification Request', 'VR'],
     45        'send': ['Send-By-Email Request', 'SE'],
    4546        }
    4647
Note: See TracChangeset for help on using the changeset viewer.