Changeset 16804


Ignore:
Timestamp:
14 Feb 2022, 07:13:51 (3 years ago)
Author:
Henrik Bettermann
Message:

Implement French language application.

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

Legend:

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

    r16766 r16804  
    5353    ICustomUGApplicantEdit,
    5454    IPUTMEApplicantEdit,
    55     ITranscriptApplicant)
     55    ITranscriptApplicant,
     56    IFrenchApplicant)
    5657from waeup.kofa.applicants.workflow import ADMITTED, PAID, STARTED
    5758from kofacustom.nigeria.applicants.interfaces import (
     
    257258            #form_fields['perm_address'].custom_widget = BytesDisplayWidget
    258259            return form_fields
     260        if self.target is not None and self.target == 'french':
     261            form_fields = grok.AutoFields(IFrenchApplicant)
     262            for field in REGISTRATION_OMIT_DISPLAY_FIELDS:
     263                form_fields = form_fields.omit(field)
     264            return form_fields
    259265        if self.target == 'ictwk':
    260266            form_fields = grok.AutoFields(IUnibenRegistration)
     
    452458                form_fields['registration_cats'].for_display = True
    453459            return form_fields
     460        if self.target is not None and self.target == 'french':
     461            form_fields = grok.AutoFields(IFrenchApplicant)
     462            for field in REGISTRATION_OMIT_MANAGE_FIELDS:
     463                form_fields = form_fields.omit(field)
     464            return form_fields
    454465        if self.target is not None and self.target.startswith('pg'):
    455466            form_fields = grok.AutoFields(ICustomPGApplicant)
     
    511522            for field in TRANS_OMIT_EDIT_FIELDS:
    512523                form_fields = form_fields.omit(field)
    513                 form_fields = form_fields.omit('locked')
    514524            if state == PAID:
    515525                form_fields['order'].for_display = True
     526            form_fields = form_fields.omit('locked')
    516527            return form_fields
    517528        if self.target is not None and self.target == 'tscs':
     
    521532            for field in TRANS_SHORT_OMIT_EDIT_FIELDS:
    522533                form_fields = form_fields.omit(field)
    523                 form_fields = form_fields.omit('locked')
     534            form_fields = form_fields.omit('locked')
    524535            if state == PAID:
    525536                form_fields['order'].for_display = True
     
    531542            if state != STARTED:
    532543                form_fields['registration_cats'].for_display = True
     544            return form_fields
     545        if self.target is not None and self.target == 'french':
     546            form_fields = grok.AutoFields(IFrenchApplicant)
     547            for field in REGISTRATION_OMIT_EDIT_FIELDS:
     548                form_fields = form_fields.omit(field)
    533549            return form_fields
    534550        if self.target is not None and self.target.startswith('pg'):
     
    705721                for field in PUDE_OMIT_PDF_FIELDS:
    706722                    form_fields = form_fields.omit(field)
     723        elif self.target is not None and self.target == 'french':
     724            form_fields = grok.AutoFields(IFrenchApplicant)
     725            for field in REGISTRATION_OMIT_PDF_FIELDS:
     726                form_fields = form_fields.omit(field)
    707727        else:
    708728            form_fields = grok.AutoFields(ICustomUGApplicant)
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py

    r16775 r16804  
    142142            return _('Certified True Copy')
    143143
     144class ProficiencySource(BasicSourceFactory):
     145    """
     146    """
     147    def getValues(self):
     148        return ['n', 'c', 'p']
     149
     150    def getToken(self, value):
     151        return value
     152
     153    def getTitle(self, value):
     154        if value == 'n':
     155            return _('none')
     156        if value == 'c':
     157            return _('conversational')
     158        if value == 'c':
     159            return _('professional')
     160
    144161class IUnibenRegistration(IKofaObject):
    145162    """A Uniben registrant.
     
    444461            raise Invalid(_("You've selected the wrong transcript charge."))
    445462
     463class IFrenchApplicant(IKofaObject):
     464    """A transcript applicant.
     465    """
     466
     467    suspended = schema.Bool(
     468        title = _(u'Account suspended'),
     469        default = False,
     470        required = False,
     471        )
     472
     473    locked = schema.Bool(
     474        title = _(u'Form locked'),
     475        default = False,
     476        required = False,
     477        )
     478
     479    applicant_id = schema.TextLine(
     480        title = _(u'Applicant Id'),
     481        required = False,
     482        readonly = False,
     483        )
     484
     485    firstname = schema.TextLine(
     486        title = _(u'First Name'),
     487        required = True,
     488        )
     489
     490    middlename = schema.TextLine(
     491        title = _(u'Middle Name'),
     492        required = False,
     493        )
     494
     495    lastname = schema.TextLine(
     496        title = _(u'Surname'),
     497        required = True,
     498        )
     499
     500    date_of_birth = FormattedDate(
     501        title = _(u'Date of Birth'),
     502        required = False,
     503        #date_format = u'%d/%m/%Y', # Use grok-instance-wide default
     504        show_year = True,
     505        )
     506
     507    sex = schema.Choice(
     508        title = _(u'Gender'),
     509        source = GenderSource(),
     510        required = True,
     511        )
     512
     513    nationality = schema.Choice(
     514        vocabulary = nats_vocab,
     515        title = _(u'Nationality'),
     516        required = False,
     517        )
     518
     519    email = schema.ASCIILine(
     520        title = _(u'Email Address'),
     521        required = True,
     522        constraint=validate_email,
     523        )
     524
     525    phone = PhoneNumber(
     526        title = _(u'Phone'),
     527        description = u'',
     528        required = False,
     529        )
     530
     531    work = schema.TextLine(
     532        title = _(u'Place of Work'),
     533        required = False,
     534        )
     535
     536    hq_obtained = schema.Choice(
     537        title = _(u'Highest Qualification Obtained'),
     538        required = False,
     539        readonly = False,
     540        vocabulary = high_qual,
     541        )
     542
     543    hq_date = FormattedDate(
     544        title = _(u'Highest Qualification Date'),
     545        required = False,
     546        readonly = False,
     547        show_year = True,
     548        )
     549    proficiency = schema.Choice(
     550        source = ProficiencySource(),
     551        title = _(u'Level of Proficiency'),
     552        required = False,
     553        )
     554
     555    guarantor = schema.TextLine(
     556        title = _(u'Name of Guarantor'),
     557        required = False,
     558        )
    446559
    447560class ICustomUGApplicant(IApplicantBaseData, IBankAccount):
     
    670783
    671784class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant,
    672     IUnibenRegistration, ITranscriptApplicant):
     785    IUnibenRegistration, ITranscriptApplicant, IFrenchApplicant):
    673786    """An interface for both types of applicants.
    674787
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py

    r16547 r16804  
    6868        'tscf': ['Transcript (without student record)', 'TRF'],
    6969        'tscs': ['Transcript (with student record)', 'TRS'],
     70        'french': ['French Language Centre', 'FR'],
    7071        }
    7172
Note: See TracChangeset for help on using the changeset viewer.