- Timestamp:
- 26 Jun 2020, 07:11:51 (4 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r16119 r16131 129 129 'fst_sit_results', 'scd_sit_results') 130 130 131 TRANS_OMIT_FIELDS = ('locked', 'suspended', 'applicant_id',) 132 133 TRANS_SHORT_OMIT_FIELDS = TRANS_OMIT_FIELDS + ( 134 'date_of_birth', 135 'sex', 136 'place_of_birth', 137 'nationality', 138 'entry_mode', 139 'entry_session', 140 'end_session', 141 'course_studied', 142 'course_changed', 143 'change_level', 144 ) 145 131 146 class CustomApplicantsContainerPage(ApplicantsContainerPage): 132 147 """The standard view for regular applicant containers. … … 209 224 @property 210 225 def form_fields(self): 211 if self.target is not None and self.target == 'trans': 212 form_fields = grok.AutoFields(ITranscriptApplicant).omit( 213 'locked', 'suspended') 226 if self.target is not None and self.target == 'transfull': 227 form_fields = grok.AutoFields(ITranscriptApplicant) 228 for field in TRANS_OMIT_FIELDS: 229 form_fields = form_fields.omit(field) 230 form_fields['dispatch_address'].custom_widget = BytesDisplayWidget 231 form_fields['perm_address'].custom_widget = BytesDisplayWidget 232 return form_fields 233 if self.target is not None and self.target == 'transshort': 234 form_fields = grok.AutoFields(ITranscriptApplicant) 235 for field in TRANS_SHORT_OMIT_FIELDS: 236 form_fields = form_fields.omit(field) 214 237 form_fields['dispatch_address'].custom_widget = BytesDisplayWidget 215 238 form_fields['perm_address'].custom_widget = BytesDisplayWidget … … 380 403 @property 381 404 def form_fields(self): 382 if self.target is not None and self.target == 'trans ':405 if self.target is not None and self.target == 'transfull': 383 406 form_fields = grok.AutoFields(ITranscriptApplicant) 384 form_fields['applicant_id'].for_display = True 407 for field in TRANS_OMIT_FIELDS: 408 form_fields = form_fields.omit(field) 409 return form_fields 410 if self.target is not None and self.target == 'transshort': 411 form_fields = grok.AutoFields(ITranscriptApplicant) 412 for field in TRANS_SHORT_OMIT_FIELDS: 413 form_fields = form_fields.omit(field) 385 414 return form_fields 386 415 if self.target == 'ictwk': … … 444 473 @property 445 474 def form_fields(self): 446 if self.target is not None and self.target == 'trans': 447 form_fields = grok.AutoFields(ITranscriptApplicant).omit( 448 'locked', 'suspended') 449 form_fields['applicant_id'].for_display = True 450 form_fields['reg_number'].for_display = True 451 form_fields['place_of_birth'].field.required = True 452 form_fields['date_of_birth'].field.required = True 453 form_fields['nationality'].field.required = True 454 form_fields['email'].field.required = True 455 form_fields['phone'].field.required = True 456 form_fields['perm_address'].field.required = True 457 form_fields['dispatch_address'].field.required = True 458 form_fields['entry_mode'].field.required = True 459 form_fields['entry_session'].field.required = True 460 form_fields['end_session'].field.required = True 461 form_fields['course_studied'].field.required = True 475 if self.target is not None and self.target == 'transfull': 476 form_fields = grok.AutoFields(ITranscriptApplicant) 477 for field in TRANS_OMIT_FIELDS: 478 form_fields = form_fields.omit(field) 479 return form_fields 480 if self.target is not None and self.target == 'transshort': 481 form_fields = grok.AutoFields(ITranscriptApplicant) 482 for field in TRANS_SHORT_OMIT_FIELDS: 483 form_fields = form_fields.omit(field) 462 484 return form_fields 463 485 if self.target == 'ictwk': … … 701 723 websites = (('Uniben Alumni Portal', 'https://uniben-alumni.waeup.org/'), 702 724 ('Uniben Student Portal', 'https://uniben.waeup.org/'),) 703 appl_url1 = 'https://uniben-alumni.waeup.org/ documents/transcript/display'704 appl_url2 = 'https://uniben-alumni.waeup.org/ documents/transcript/display'725 appl_url1 = 'https://uniben-alumni.waeup.org/applicants/transfull1/register' 726 appl_url2 = 'https://uniben-alumni.waeup.org/applicants/transshort1/register' -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r16078 r16131 35 35 from waeup.kofa.interfaces import ( 36 36 SimpleKofaVocabulary, academic_sessions_vocab, validate_email, 37 IKofaObject )37 IKofaObject, ContextualDictSourceFactoryBase) 38 38 from waeup.kofa.schema import FormattedDate, TextLineChoice, PhoneNumber 39 39 from waeup.kofa.students.vocabularies import ( … … 79 79 REGISTRATION_CATS[value][1]) 80 80 81 DESTINATION_COST = { 82 'none': ('To the moon', 1000000000.0, 1), 83 #'nigeria': ('Nigeria', 2000.0, 1), 84 #'africa': ('Africa ', 3000.0, 2), 85 #'eurasia': ('Europe/Asia ', 3000.0, 3), 86 } 87 88 class DestinationCostSource(BasicSourceFactory): 89 """A source that delivers continents and shipment costs. 90 """ 91 def getValues(self): 92 sorted_items = sorted(DESTINATION_COST.items(), 93 key=lambda element: element[1][2]) 94 return [item[0] for item in sorted_items] 95 96 def getTitle(self, value): 97 return u"%s (₦ %s)" % ( 98 DESTINATION_COST[value][0], 99 DESTINATION_COST[value][1]) 100 81 101 class IUnibenRegistration(IKofaObject): 82 102 """A Uniben registrant. … … 204 224 205 225 applicant_id = schema.TextLine( 206 title = _(u'Application Id'), 207 required = False, 208 readonly = False, 209 ) 210 211 reg_number = TextLineChoice( 212 title = _(u'Kofa Registration Number'), 213 readonly = False, 214 required = True, 215 source = contextual_reg_num_source, 226 title = _(u'Transcript Application Id'), 227 required = False, 228 readonly = False, 229 ) 230 231 student_id = schema.TextLine( 232 title = _(u'Kofa Student Id'), 233 required = False, 234 readonly = False, 235 ) 236 237 #reg_number = schema.TextLine( 238 # title = _(u'Registration Number'), 239 # readonly = False, 240 # required = False, 241 # ) 242 243 matric_number = schema.TextLine( 244 title = _(u'Matriculation Number'), 245 readonly = False, 246 required = True, 216 247 ) 217 248 … … 228 259 lastname = schema.TextLine( 229 260 title = _(u'Last Name (Surname)'), 230 required = True,231 )232 233 matric_number = schema.TextLine(234 title = _(u'Matriculation Number'),235 readonly = False,236 261 required = True, 237 262 ) … … 282 307 dispatch_address = schema.Text( 283 308 title = _(u'Dispatch Addresses'), 284 description = u'Addresses to which transcript should be posted.', 285 required = False, 286 readonly = False, 309 description = u'Addresses to which transcripts should be posted. ' 310 'Addresses must involve same courier charges.', 311 required = False, 312 readonly = False, 313 ) 314 315 charge = schema.Choice( 316 title = _(u'Courier Charge'), 317 source = DestinationCostSource(), 318 required = True, 287 319 ) 288 320 … … 313 345 required = False, 314 346 readonly = False, 315 )316 317 purpose = schema.TextLine(318 title = _(u'Purpose of this Application'),319 readonly = False,320 required = False,321 347 ) 322 348 -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py
r16078 r16131 24 24 from waeup.kofa.applicants.workflow import (INITIALIZED, 25 25 STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED) 26 from waeup.uniben.applicants.interfaces import REGISTRATION_CATS 26 from waeup.uniben.applicants.interfaces import REGISTRATION_CATS, DESTINATION_COST 27 27 from waeup.uniben.interfaces import MessageFactory as _ 28 28 … … 60 60 '(2nd supplementary advert)', 'ASE'], 61 61 'spft': ['Special Full-Time Programmes', 'SP'], 62 'trans': ['Transcript Application', 'TR'], 62 'transfull': ['Transcript Application (without student record)', 'TRF'], 63 'transshort': ['Transcript Application (with student record)', 'TRS'], 63 64 } 64 65 … … 122 123 for cat in applicant.registration_cats: 123 124 payment.amount_auth += REGISTRATION_CATS[cat][1] 125 elif applicant.container_code.startswith('trans'): 126 cost = DESTINATION_COST[applicant.charge][1] 127 payment.amount_auth = applicant.no_copies * cost 128 payment.p_category = 'transcript' 124 129 else: 125 130 payment.p_category = 'application' -
main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py
r16025 r16131 57 57 'special_ft': 'Special Full-Time', 58 58 'cdl': 'Center For Distance Learning', 59 } 60 61 DESTINATION_COST_DICT = { 62 'nigeria_2000': 'Nigeria (N2000)', 63 'africa_2000': 'Africa (N3000)', 59 64 } 60 65
Note: See TracChangeset for help on using the changeset viewer.