Ignore:
Timestamp:
23 Jul 2022, 08:08:45 (2 years ago)
Author:
Henrik Bettermann
Message:

Implement transcript application (fee calculation not yet configured).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/applicants/browser.py

    r16853 r17029  
    5454    ICustomPGApplicant, ICustomUGApplicant, ICustomApplicant,
    5555    ICustomPGApplicantEdit, ICustomUGApplicantEdit,
    56     ICustomApplicantOnlinePayment,
     56    ICustomApplicantOnlinePayment, ITranscriptApplicant,
    5757    )
    5858from kofacustom.nigeria.interfaces import MessageFactory as _
     
    9494    'aggregate')
    9595
     96TSC_OMIT_FIELDS = ('locked', 'suspended',
     97    )
     98   
     99
     100TSC_OMIT_EDIT_FIELDS = TSC_OMIT_FIELDS + (
     101    'applicant_id',
     102    'proc_date',
     103    )
     104
     105TSC_OMIT_MANAGE_FIELDS = TSC_OMIT_FIELDS + (
     106    'applicant_id',)     
     107
    96108class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage):
    97109    """A display view for applicant data.
     
    104116            for field in PG_OMIT_DISPLAY_FIELDS:
    105117                form_fields = form_fields.omit(field)
     118        elif self.target is not None and self.target.startswith('tsc'):
     119            form_fields = grok.AutoFields(ITranscriptApplicant)
     120            for field in TSC_OMIT_FIELDS:
     121                form_fields = form_fields.omit(field)           
     122            return form_fields
    106123        else:
    107124            form_fields = grok.AutoFields(ICustomUGApplicant)
    108125            for field in UG_OMIT_DISPLAY_FIELDS:
    109126                form_fields = form_fields.omit(field)
     127            form_fields['notice'].custom_widget = BytesDisplayWidget
    110128        #form_fields['perm_address'].custom_widget = BytesDisplayWidget
    111         form_fields['notice'].custom_widget = BytesDisplayWidget
    112129        if not getattr(self.context, 'student_id'):
    113130            form_fields = form_fields.omit('student_id')
     
    134151            for field in PG_OMIT_PDF_FIELDS:
    135152                form_fields = form_fields.omit(field)
     153        elif self.target is not None and self.target.startswith('tsc'):
     154            form_fields = grok.AutoFields(ITranscriptApplicant)
     155            for field in TSC_OMIT_FIELDS:
     156                form_fields = form_fields.omit(field)             
     157            return form_fields
    136158        else:
    137159            form_fields = grok.AutoFields(ICustomUGApplicant)
     
    164186            for field in PG_OMIT_MANAGE_FIELDS:
    165187                form_fields = form_fields.omit(field)
     188        elif self.target is not None and self.target.startswith('tsc'):
     189            form_fields = grok.AutoFields(ITranscriptApplicant)
     190            for field in TSC_OMIT_MANAGE_FIELDS:
     191                form_fields = form_fields.omit(field)             
     192            return form_fields
    166193        else:
    167194            form_fields = grok.AutoFields(ICustomUGApplicant)
     
    185212            for field in PG_OMIT_EDIT_FIELDS:
    186213                form_fields = form_fields.omit(field)
     214        elif self.target is not None and self.target.startswith('tsc'):
     215            form_fields = grok.AutoFields(ITranscriptApplicant)
     216            for field in TSC_OMIT_EDIT_FIELDS:
     217                form_fields = form_fields.omit(field)           
     218            return form_fields
    187219        else:
    188220            form_fields = grok.AutoFields(ICustomUGApplicantEdit)
Note: See TracChangeset for help on using the changeset viewer.