- Timestamp:
- 7 Apr 2016, 14:21:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r13796 r13814 40 40 NigeriaPDFApplicationSlip) 41 41 from waeup.uniben.applicants.interfaces import ( 42 ICustomApplicant )42 ICustomApplicant, IUnibenRegistration) 43 43 from waeup.kofa.applicants.workflow import ADMITTED, PAID 44 44 … … 61 61 PASTQ_MSS = ['ACC','BNK','BUS','ECO','GEO','POL','SAA','SWK'] + PASTQ_ALL 62 62 63 ICT_WEEK_FIELDS = ( 64 'course1', 65 'course2', 66 'aggregate', 67 'screening_score', 68 'screening_venue', 69 'screening_date', 70 'jamb_subjects', 71 'jamb_score', 72 'jamb_reg_number', 73 'hq_type', 74 'hq_matric_no', 75 'hq_degree', 76 'hq_school', 77 'hq_session', 78 'hq_disc', 79 'student_id', 80 'course_admitted', 63 REGISTRATION_OMIT_DISPLAY_FIELDS = ( 64 'locked', 65 'suspended', 81 66 ) 82 67 68 REGISTRATION_OMIT_EDIT_FIELDS = ( 69 'locked', 70 'suspended', 71 'applicant_id', 72 ) 73 74 REGISTRATION_OMIT_MANAGE_FIELDS = ( 75 'applicant_id', 76 ) 77 78 79 REGISTRATION_OMIT_PDF_FIELDS = ( 80 'locked', 81 'suspended', 82 ) 83 83 class CustomApplicantsContainerPage(ApplicantsContainerPage): 84 84 """The standard view for regular applicant containers. … … 140 140 and self.context.state in ('paid', 'submitted') 141 141 142 # Customizations for admission checking payments 143 144 @property 145 def form_fields(self): 146 form_fields = super(CustomApplicantDisplayFormPage, self).form_fields 147 if self.target == 'ictwk': 148 for field in ICT_WEEK_FIELDS: 142 @property 143 def label(self): 144 if self.target == 'ictwk': 145 container_title = self.context.__parent__.title 146 return _('${a} <br /> Registration Record ${b}', mapping = { 147 'a':container_title, 'b':self.context.application_number}) 148 return super(CustomApplicantDisplayFormPage, self).label 149 150 @property 151 def form_fields(self): 152 if self.target == 'ictwk': 153 form_fields = grok.AutoFields(IUnibenRegistration) 154 for field in REGISTRATION_OMIT_DISPLAY_FIELDS: 149 155 form_fields = form_fields.omit(field) 150 156 return form_fields 157 form_fields = super(CustomApplicantDisplayFormPage, self).form_fields 151 158 if not self.context.admchecking_fee_paid(): 152 159 form_fields = form_fields.omit( … … 256 263 257 264 @property 258 def form_fields(self): 265 def label(self): 266 if self.target == 'ictwk': 267 container_title = self.context.__parent__.title 268 return _('${a} <br /> Registration Record ${b}', mapping = { 269 'a':container_title, 'b':self.context.application_number}) 270 return super(CustomApplicantManageFormPage, self).label 271 272 @property 273 def form_fields(self): 274 if self.target == 'ictwk': 275 form_fields = grok.AutoFields(IUnibenRegistration) 276 for field in REGISTRATION_OMIT_MANAGE_FIELDS: 277 form_fields = form_fields.omit(field) 278 return form_fields 259 279 form_fields = super(CustomApplicantManageFormPage, self).form_fields 260 if self.target == 'ictwk':261 for field in ICT_WEEK_FIELDS:262 form_fields = form_fields.omit(field)263 280 return form_fields 264 281 … … 270 287 @property 271 288 def form_fields(self): 289 if self.target == 'ictwk': 290 form_fields = grok.AutoFields(IUnibenRegistration) 291 for field in REGISTRATION_OMIT_EDIT_FIELDS: 292 form_fields = form_fields.omit(field) 293 return form_fields 272 294 form_fields = super(CustomApplicantEditFormPage, self).form_fields 273 if self.target == 'ictwk': 274 for field in ICT_WEEK_FIELDS: 275 form_fields = form_fields.omit(field) 276 return form_fields 295 return form_fields 296 297 @property 298 def label(self): 299 if self.target == 'ictwk': 300 container_title = self.context.__parent__.title 301 return _('${a} <br /> Registration Record ${b}', mapping = { 302 'a':container_title, 'b':self.context.application_number}) 303 return super(CustomApplicantEditFormPage, self).label 277 304 278 305 class CustomOnlinePaymentApprovePage(OnlinePaymentApprovePage): … … 328 355 329 356 @property 357 def form_fields(self): 358 if self.target == 'ictwk': 359 form_fields = grok.AutoFields(IUnibenRegistration) 360 for field in REGISTRATION_OMIT_PDF_FIELDS: 361 form_fields = form_fields.omit(field) 362 return form_fields 363 form_fields = super(CustomPDFApplicationSlip, self).form_fields 364 return form_fields 365 366 @property 330 367 def title(self): 331 368 container_title = self.context.__parent__.title … … 333 370 ar_translation = translate(_('Application Record'), 334 371 'waeup.kofa', target_language=portal_language) 335 if 'afas' in self.target: 372 if self.target == 'ictwk': 373 return '%s - Registration Record %s' % (container_title, 374 self.context.application_number) 375 elif 'afas' in self.target: 336 376 return 'Federal College of Education (Technical) Asaba - %s %s %s' % ( 337 377 container_title, ar_translation,
Note: See TracChangeset for help on using the changeset viewer.