Ignore:
Timestamp:
10 Dec 2015, 07:08:50 (9 years ago)
Author:
Henrik Bettermann
Message:

Add transcript application type.

Configure PG application pages.

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

Legend:

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

    r13422 r13538  
    2626from waeup.kofa.utils.helpers import string_from_bytes, file_size
    2727from waeup.kofa.applicants.browser import ApplicantCheckStatusPage
     28from waeup.kofa.applicants.interfaces import ISpecialApplicant
     29from waeup.kofa.applicants.viewlets import PDFActionButton
    2830from waeup.aaue.interfaces import MessageFactory as _
    2931from kofacustom.nigeria.applicants.browser import (
     
    5658FP_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + FP_OMIT_FIELDS
    5759
     60PG_OMIT_FIELDS = ('programme_type',)
     61PG_OMIT_DISPLAY_FIELDS = UG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS
     62PG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS
     63PG_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PG_OMIT_FIELDS
     64PG_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + PG_OMIT_FIELDS
     65
    5866class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage):
    5967    """A display view for applicant data.
     
    6270    @property
    6371    def form_fields(self):
     72        if self.target is not None and self.target == 'trans':
     73            return grok.AutoFields(ISpecialApplicant).omit(
     74                'locked', 'suspended', 'special_application')
     75        # AAUE is using the same interface for all regular applications.
    6476        form_fields = grok.AutoFields(ICustomUGApplicant)
    65         if self.target is not None and self.target.startswith('fp'):
     77        if self.target is not None and self.target.startswith('pg'):
     78            for field in PG_OMIT_DISPLAY_FIELDS:
     79                form_fields = form_fields.omit(field)
     80        elif self.target is not None and self.target.startswith('fp'):
    6681            for field in FP_OMIT_DISPLAY_FIELDS:
    6782                form_fields = form_fields.omit(field)
     
    8196        return form_fields
    8297
     98class CustomPDFActionButton(PDFActionButton):
     99
     100    @property
     101    def target_url(self):
     102        return
     103
     104
    83105class CustomPDFApplicationSlip(NigeriaPDFApplicationSlip):
    84106
     
    107129    @property
    108130    def form_fields(self):
     131        # AAUE is using the same interface for all regular applications.
    109132        form_fields = grok.AutoFields(ICustomUGApplicant)
    110         if self.target is not None and self.target.startswith('fp'):
     133        if self.target is not None and self.target.startswith('pg'):
     134            for field in PG_OMIT_PDF_FIELDS:
     135                form_fields = form_fields.omit(field)
     136        elif self.target is not None and self.target.startswith('fp'):
    111137            for field in FP_OMIT_PDF_FIELDS:
    112138                form_fields = form_fields.omit(field)
     
    130156    @property
    131157    def form_fields(self):
     158        if self.target is not None and self.target == 'trans':
     159            form_fields = grok.AutoFields(ISpecialApplicant).omit(
     160                'special_application')
     161            form_fields['applicant_id'].for_display = True
     162            return form_fields
     163        # AAUE is using the same interface for all regular applications.
    132164        form_fields = grok.AutoFields(ICustomUGApplicant)
    133         if self.target is not None and self.target.startswith('fp'):
     165        if self.target is not None and self.target.startswith('pg'):
     166            for field in PG_OMIT_MANAGE_FIELDS:
     167                form_fields = form_fields.omit(field)
     168        elif self.target is not None and self.target.startswith('fp'):
    134169            for field in FP_OMIT_MANAGE_FIELDS:
    135170                form_fields = form_fields.omit(field)
     
    147182    @property
    148183    def form_fields(self):
     184        if self.target is not None and self.target == 'trans':
     185            form_fields = grok.AutoFields(ISpecialApplicant).omit(
     186                'locked', 'suspended', 'special_application')
     187            form_fields['applicant_id'].for_display = True
     188            return form_fields
     189        # AAUE is using the same interface for all regular applications.
    149190        form_fields = grok.AutoFields(ICustomUGApplicantEdit)
    150         if self.target is not None and self.target.startswith('fp'):
     191        if self.target is not None and self.target.startswith('pg'):
     192            for field in PG_OMIT_EDIT_FIELDS:
     193                form_fields = form_fields.omit(field)
     194        elif self.target is not None and self.target.startswith('fp'):
    151195            for field in FP_OMIT_EDIT_FIELDS:
    152196                form_fields = form_fields.omit(field)
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/utils.py

    r13525 r13538  
    3333        'pgft': ['Postgraduate Full-Time Programmes', 'PG'],
    3434        'pgpt': ['Postgraduate Part-Time Programmes', 'PG'],
     35        'trans': ['Transcript Application', 'TR'],
    3536        }
    3637
Note: See TracChangeset for help on using the changeset viewer.