Changeset 13538
- Timestamp:
- 10 Dec 2015, 07:08:50 (9 years ago)
- 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 26 26 from waeup.kofa.utils.helpers import string_from_bytes, file_size 27 27 from waeup.kofa.applicants.browser import ApplicantCheckStatusPage 28 from waeup.kofa.applicants.interfaces import ISpecialApplicant 29 from waeup.kofa.applicants.viewlets import PDFActionButton 28 30 from waeup.aaue.interfaces import MessageFactory as _ 29 31 from kofacustom.nigeria.applicants.browser import ( … … 56 58 FP_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + FP_OMIT_FIELDS 57 59 60 PG_OMIT_FIELDS = ('programme_type',) 61 PG_OMIT_DISPLAY_FIELDS = UG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS 62 PG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS 63 PG_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PG_OMIT_FIELDS 64 PG_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + PG_OMIT_FIELDS 65 58 66 class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage): 59 67 """A display view for applicant data. … … 62 70 @property 63 71 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. 64 76 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'): 66 81 for field in FP_OMIT_DISPLAY_FIELDS: 67 82 form_fields = form_fields.omit(field) … … 81 96 return form_fields 82 97 98 class CustomPDFActionButton(PDFActionButton): 99 100 @property 101 def target_url(self): 102 return 103 104 83 105 class CustomPDFApplicationSlip(NigeriaPDFApplicationSlip): 84 106 … … 107 129 @property 108 130 def form_fields(self): 131 # AAUE is using the same interface for all regular applications. 109 132 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'): 111 137 for field in FP_OMIT_PDF_FIELDS: 112 138 form_fields = form_fields.omit(field) … … 130 156 @property 131 157 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. 132 164 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'): 134 169 for field in FP_OMIT_MANAGE_FIELDS: 135 170 form_fields = form_fields.omit(field) … … 147 182 @property 148 183 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. 149 190 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'): 151 195 for field in FP_OMIT_EDIT_FIELDS: 152 196 form_fields = form_fields.omit(field) -
main/waeup.aaue/trunk/src/waeup/aaue/applicants/utils.py
r13525 r13538 33 33 'pgft': ['Postgraduate Full-Time Programmes', 'PG'], 34 34 'pgpt': ['Postgraduate Part-Time Programmes', 'PG'], 35 'trans': ['Transcript Application', 'TR'], 35 36 } 36 37
Note: See TracChangeset for help on using the changeset viewer.