[7853] | 1 | ## $Id: interfaces.py 14829 2017-08-31 07:26:25Z henrik $ |
---|
| 2 | ## |
---|
| 3 | ## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann |
---|
| 4 | ## This program is free software; you can redistribute it and/or modify |
---|
| 5 | ## it under the terms of the GNU General Public License as published by |
---|
| 6 | ## the Free Software Foundation; either version 2 of the License, or |
---|
| 7 | ## (at your option) any later version. |
---|
| 8 | ## |
---|
| 9 | ## This program is distributed in the hope that it will be useful, |
---|
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 12 | ## GNU General Public License for more details. |
---|
| 13 | ## |
---|
| 14 | ## You should have received a copy of the GNU General Public License |
---|
| 15 | ## along with this program; if not, write to the Free Software |
---|
| 16 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
| 17 | ## |
---|
| 18 | """Customized interfaces of the university application package. |
---|
| 19 | """ |
---|
| 20 | |
---|
[8012] | 21 | from zope import schema |
---|
[10298] | 22 | from zope.interface import Attribute, invariant, Invalid |
---|
[8051] | 23 | from waeup.kofa.applicants.interfaces import ( |
---|
[8053] | 24 | IApplicantBaseData, |
---|
[8051] | 25 | AppCatCertificateSource, CertificateSource) |
---|
| 26 | from waeup.kofa.schoolgrades import ResultEntryField |
---|
[8532] | 27 | from waeup.kofa.interfaces import ( |
---|
| 28 | SimpleKofaVocabulary, academic_sessions_vocab, validate_email) |
---|
[13544] | 29 | from waeup.kofa.schema import FormattedDate, TextLineChoice, PhoneNumber |
---|
| 30 | from waeup.kofa.interfaces import IKofaObject |
---|
| 31 | from waeup.kofa.students.vocabularies import ( |
---|
| 32 | nats_vocab, GenderSource, StudyLevelSource) |
---|
[10298] | 33 | from waeup.kofa.applicants.interfaces import ( |
---|
| 34 | contextual_reg_num_source, |
---|
| 35 | IApplicantBaseData) |
---|
[13544] | 36 | from waeup.kofa.university.vocabularies import StudyModeSource |
---|
[8931] | 37 | from kofacustom.nigeria.applicants.interfaces import ( |
---|
| 38 | LGASource, high_qual, high_grade, exam_types, |
---|
| 39 | INigeriaUGApplicant, INigeriaPGApplicant, |
---|
| 40 | INigeriaApplicantOnlinePayment, |
---|
[8980] | 41 | INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, |
---|
| 42 | INigeriaApplicantUpdateByRegNo, |
---|
| 43 | IPUTMEApplicantEdit, |
---|
[8931] | 44 | ) |
---|
[8444] | 45 | from waeup.aaue.interfaces import MessageFactory as _ |
---|
| 46 | from waeup.aaue.payments.interfaces import ICustomOnlinePayment |
---|
[7853] | 47 | |
---|
[10924] | 48 | programme_types_vocab = SimpleKofaVocabulary( |
---|
[11542] | 49 | (_('Undergraduate Programme (100 level)'), 'regular'), |
---|
| 50 | (_('Direct Entry (200 level)'), 'direct'), |
---|
[10924] | 51 | (_('not applicable'), 'na'), |
---|
| 52 | ) |
---|
| 53 | |
---|
[10298] | 54 | class ICustomUGApplicant(IApplicantBaseData): |
---|
[8012] | 55 | """An undergraduate applicant. |
---|
| 56 | |
---|
[8521] | 57 | This interface defines the least common multiple of all fields |
---|
| 58 | in ug application forms. In customized forms, fields can be excluded by |
---|
| 59 | adding them to the UG_OMIT* tuples. |
---|
[8012] | 60 | """ |
---|
| 61 | |
---|
[13977] | 62 | #programme_type = schema.Choice( |
---|
| 63 | # title = _(u'Programme Type'), |
---|
| 64 | # vocabulary = programme_types_vocab, |
---|
| 65 | # required = False, |
---|
| 66 | # ) |
---|
[10924] | 67 | |
---|
[10298] | 68 | nationality = schema.Choice( |
---|
| 69 | source = nats_vocab, |
---|
| 70 | title = _(u'Nationality'), |
---|
| 71 | required = True, |
---|
| 72 | ) |
---|
[14829] | 73 | |
---|
[10298] | 74 | lga = schema.Choice( |
---|
| 75 | source = LGASource(), |
---|
| 76 | title = _(u'State/LGA (Nigerians only)'), |
---|
| 77 | required = False, |
---|
| 78 | ) |
---|
[14829] | 79 | |
---|
[10298] | 80 | perm_address = schema.Text( |
---|
| 81 | title = _(u'Permanent Address'), |
---|
| 82 | required = False, |
---|
| 83 | ) |
---|
[14829] | 84 | |
---|
[10308] | 85 | home_town = schema.TextLine( |
---|
[10306] | 86 | title = _(u'Home Town'), |
---|
| 87 | required = False, |
---|
| 88 | ) |
---|
[14829] | 89 | |
---|
[13977] | 90 | #jamb_reg_number = schema.TextLine( |
---|
| 91 | # title = _(u'JAMB Registration Number'), |
---|
| 92 | # required = False, |
---|
| 93 | # ) |
---|
[14829] | 94 | |
---|
[10311] | 95 | jamb_score = schema.Int( |
---|
| 96 | title = _(u'Total JAMB Score'), |
---|
| 97 | required = False, |
---|
| 98 | ) |
---|
[14829] | 99 | |
---|
[13977] | 100 | jamb_subjects = schema.Text( |
---|
| 101 | title = _(u'JAMB Subjects and Scores'), |
---|
| 102 | required = False, |
---|
| 103 | ) |
---|
[14829] | 104 | |
---|
[10298] | 105 | course1 = schema.Choice( |
---|
| 106 | title = _(u'1st Choice Course of Study'), |
---|
| 107 | source = AppCatCertificateSource(), |
---|
[14468] | 108 | required = False, |
---|
[10298] | 109 | ) |
---|
[14829] | 110 | |
---|
[10298] | 111 | course2 = schema.Choice( |
---|
| 112 | title = _(u'2nd Choice Course of Study'), |
---|
| 113 | source = AppCatCertificateSource(), |
---|
| 114 | required = False, |
---|
| 115 | ) |
---|
[14829] | 116 | |
---|
[10298] | 117 | fst_sit_fname = schema.TextLine( |
---|
| 118 | title = _(u'Full Name'), |
---|
| 119 | required = False, |
---|
| 120 | readonly = False, |
---|
| 121 | ) |
---|
[14829] | 122 | |
---|
[10298] | 123 | fst_sit_no = schema.TextLine( |
---|
| 124 | title = _(u'Exam Number'), |
---|
| 125 | required = False, |
---|
| 126 | readonly = False, |
---|
| 127 | ) |
---|
[14829] | 128 | |
---|
| 129 | fst_sit_sc_pin = schema.TextLine( |
---|
| 130 | title = _(u'Scratch Card Pin'), |
---|
| 131 | required = False, |
---|
| 132 | readonly = False, |
---|
| 133 | ) |
---|
| 134 | |
---|
| 135 | fst_sit_sc_serial_number = schema.TextLine( |
---|
| 136 | title = _(u'Scratch Card Serial Number'), |
---|
| 137 | required = False, |
---|
| 138 | readonly = False, |
---|
| 139 | ) |
---|
| 140 | |
---|
[10298] | 141 | fst_sit_date = FormattedDate( |
---|
| 142 | title = _(u'Exam Date'), |
---|
| 143 | required = False, |
---|
| 144 | readonly = False, |
---|
| 145 | show_year = True, |
---|
| 146 | ) |
---|
[14829] | 147 | |
---|
[10298] | 148 | fst_sit_type = schema.Choice( |
---|
| 149 | title = _(u'Exam Type'), |
---|
| 150 | required = False, |
---|
| 151 | readonly = False, |
---|
| 152 | vocabulary = exam_types, |
---|
| 153 | ) |
---|
[14829] | 154 | |
---|
[10298] | 155 | fst_sit_results = schema.List( |
---|
| 156 | title = _(u'Exam Results'), |
---|
| 157 | value_type = ResultEntryField(), |
---|
| 158 | required = False, |
---|
| 159 | readonly = False, |
---|
[14017] | 160 | defaultFactory=list, |
---|
[10298] | 161 | ) |
---|
[14829] | 162 | |
---|
[10298] | 163 | scd_sit_fname = schema.TextLine( |
---|
| 164 | title = _(u'Full Name'), |
---|
| 165 | required = False, |
---|
| 166 | readonly = False, |
---|
| 167 | ) |
---|
[14829] | 168 | |
---|
[10298] | 169 | scd_sit_no = schema.TextLine( |
---|
| 170 | title = _(u'Exam Number'), |
---|
| 171 | required = False, |
---|
| 172 | readonly = False, |
---|
| 173 | ) |
---|
[14829] | 174 | |
---|
| 175 | scd_sit_sc_pin = schema.TextLine( |
---|
| 176 | title = _(u'Scratch Card Pin'), |
---|
| 177 | required = False, |
---|
| 178 | readonly = False, |
---|
| 179 | ) |
---|
| 180 | |
---|
| 181 | scd_sit_sc_serial_number = schema.TextLine( |
---|
| 182 | title = _(u'Scratch Card Serial Number'), |
---|
| 183 | required = False, |
---|
| 184 | readonly = False, |
---|
| 185 | ) |
---|
| 186 | |
---|
[10298] | 187 | scd_sit_date = FormattedDate( |
---|
| 188 | title = _(u'Exam Date'), |
---|
| 189 | required = False, |
---|
| 190 | readonly = False, |
---|
| 191 | show_year = True, |
---|
| 192 | ) |
---|
[14829] | 193 | |
---|
[10298] | 194 | scd_sit_type = schema.Choice( |
---|
| 195 | title = _(u'Exam Type'), |
---|
| 196 | required = False, |
---|
| 197 | readonly = False, |
---|
| 198 | vocabulary = exam_types, |
---|
| 199 | ) |
---|
[14829] | 200 | |
---|
[10298] | 201 | scd_sit_results = schema.List( |
---|
| 202 | title = _(u'Exam Results'), |
---|
| 203 | value_type = ResultEntryField(), |
---|
| 204 | required = False, |
---|
| 205 | readonly = False, |
---|
[14017] | 206 | defaultFactory=list, |
---|
[10298] | 207 | ) |
---|
[14829] | 208 | |
---|
[10298] | 209 | alr_fname = schema.TextLine( |
---|
| 210 | title = _(u'Full Name'), |
---|
| 211 | required = False, |
---|
| 212 | readonly = False, |
---|
| 213 | ) |
---|
[14829] | 214 | |
---|
[10298] | 215 | alr_no = schema.TextLine( |
---|
| 216 | title = _(u'Exam Number'), |
---|
| 217 | required = False, |
---|
| 218 | readonly = False, |
---|
| 219 | ) |
---|
[14829] | 220 | |
---|
[10298] | 221 | alr_date = FormattedDate( |
---|
| 222 | title = _(u'Exam Date'), |
---|
| 223 | required = False, |
---|
| 224 | readonly = False, |
---|
| 225 | show_year = True, |
---|
| 226 | ) |
---|
[14829] | 227 | |
---|
[10298] | 228 | alr_results = schema.List( |
---|
| 229 | title = _(u'Exam Results'), |
---|
| 230 | value_type = ResultEntryField(), |
---|
| 231 | required = False, |
---|
| 232 | readonly = False, |
---|
[14017] | 233 | defaultFactory=list, |
---|
[10298] | 234 | ) |
---|
[14829] | 235 | |
---|
[10998] | 236 | hq_type = schema.Choice( |
---|
| 237 | title = _(u'Qualification Obtained'), |
---|
| 238 | required = False, |
---|
| 239 | readonly = False, |
---|
| 240 | vocabulary = high_qual, |
---|
| 241 | ) |
---|
| 242 | |
---|
| 243 | hq_fname = schema.TextLine( |
---|
| 244 | title = _(u'Full Name'), |
---|
| 245 | required = False, |
---|
| 246 | readonly = False, |
---|
| 247 | ) |
---|
| 248 | |
---|
| 249 | hq_matric_no = schema.TextLine( |
---|
| 250 | title = _(u'Former Matric Number'), |
---|
| 251 | required = False, |
---|
| 252 | readonly = False, |
---|
| 253 | ) |
---|
| 254 | |
---|
| 255 | hq_degree = schema.Choice( |
---|
| 256 | title = _(u'Class of Degree'), |
---|
| 257 | required = False, |
---|
| 258 | readonly = False, |
---|
| 259 | vocabulary = high_grade, |
---|
| 260 | ) |
---|
| 261 | |
---|
| 262 | hq_school = schema.TextLine( |
---|
| 263 | title = _(u'Institution Attended'), |
---|
| 264 | required = False, |
---|
| 265 | readonly = False, |
---|
| 266 | ) |
---|
| 267 | |
---|
| 268 | hq_session = schema.TextLine( |
---|
| 269 | title = _(u'Years Attended'), |
---|
| 270 | required = False, |
---|
| 271 | readonly = False, |
---|
| 272 | ) |
---|
| 273 | |
---|
| 274 | hq_disc = schema.TextLine( |
---|
| 275 | title = _(u'Discipline'), |
---|
| 276 | required = False, |
---|
| 277 | readonly = False, |
---|
| 278 | ) |
---|
[13545] | 279 | |
---|
| 280 | hq_type2 = schema.Choice( |
---|
| 281 | title = _(u'Qualification Obtained'), |
---|
| 282 | required = False, |
---|
| 283 | readonly = False, |
---|
| 284 | vocabulary = high_qual, |
---|
| 285 | ) |
---|
| 286 | |
---|
| 287 | hq_fname2 = schema.TextLine( |
---|
| 288 | title = _(u'Full Name'), |
---|
| 289 | required = False, |
---|
| 290 | readonly = False, |
---|
| 291 | ) |
---|
| 292 | |
---|
| 293 | hq_matric_no2 = schema.TextLine( |
---|
| 294 | title = _(u'Former Matric Number'), |
---|
| 295 | required = False, |
---|
| 296 | readonly = False, |
---|
| 297 | ) |
---|
| 298 | |
---|
| 299 | hq_degree2 = schema.Choice( |
---|
| 300 | title = _(u'Class of Degree'), |
---|
| 301 | required = False, |
---|
| 302 | readonly = False, |
---|
| 303 | vocabulary = high_grade, |
---|
| 304 | ) |
---|
| 305 | |
---|
| 306 | hq_school2 = schema.TextLine( |
---|
| 307 | title = _(u'Institution Attended'), |
---|
| 308 | required = False, |
---|
| 309 | readonly = False, |
---|
| 310 | ) |
---|
| 311 | |
---|
| 312 | hq_session2 = schema.TextLine( |
---|
| 313 | title = _(u'Years Attended'), |
---|
| 314 | required = False, |
---|
| 315 | readonly = False, |
---|
| 316 | ) |
---|
| 317 | |
---|
| 318 | hq_disc2 = schema.TextLine( |
---|
| 319 | title = _(u'Discipline'), |
---|
| 320 | required = False, |
---|
| 321 | readonly = False, |
---|
| 322 | ) |
---|
| 323 | |
---|
| 324 | hq_type3 = schema.Choice( |
---|
| 325 | title = _(u'Qualification Obtained'), |
---|
| 326 | required = False, |
---|
| 327 | readonly = False, |
---|
| 328 | vocabulary = high_qual, |
---|
| 329 | ) |
---|
| 330 | |
---|
| 331 | hq_fname3 = schema.TextLine( |
---|
| 332 | title = _(u'Full Name'), |
---|
| 333 | required = False, |
---|
| 334 | readonly = False, |
---|
| 335 | ) |
---|
| 336 | |
---|
| 337 | hq_matric_no3 = schema.TextLine( |
---|
| 338 | title = _(u'Former Matric Number'), |
---|
| 339 | required = False, |
---|
| 340 | readonly = False, |
---|
| 341 | ) |
---|
| 342 | |
---|
| 343 | hq_degree3 = schema.Choice( |
---|
| 344 | title = _(u'Class of Degree'), |
---|
| 345 | required = False, |
---|
| 346 | readonly = False, |
---|
| 347 | vocabulary = high_grade, |
---|
| 348 | ) |
---|
| 349 | |
---|
| 350 | hq_school3 = schema.TextLine( |
---|
| 351 | title = _(u'Institution Attended'), |
---|
| 352 | required = False, |
---|
| 353 | readonly = False, |
---|
| 354 | ) |
---|
| 355 | |
---|
| 356 | hq_session3 = schema.TextLine( |
---|
| 357 | title = _(u'Years Attended'), |
---|
| 358 | required = False, |
---|
| 359 | readonly = False, |
---|
| 360 | ) |
---|
| 361 | |
---|
| 362 | hq_disc3 = schema.TextLine( |
---|
| 363 | title = _(u'Discipline'), |
---|
| 364 | required = False, |
---|
| 365 | readonly = False, |
---|
| 366 | ) |
---|
[13679] | 367 | |
---|
| 368 | nysc_year = schema.Int( |
---|
| 369 | title = _(u'Nysc Year'), |
---|
| 370 | required = False, |
---|
| 371 | readonly = False, |
---|
| 372 | ) |
---|
| 373 | |
---|
| 374 | nysc_location = schema.TextLine( |
---|
| 375 | title = _(u'Nysc Location'), |
---|
| 376 | required = False, |
---|
| 377 | ) |
---|
| 378 | |
---|
| 379 | nysc_lga = schema.Choice( |
---|
| 380 | source = LGASource(), |
---|
| 381 | title = _(u'Nysc LGA'), |
---|
| 382 | required = False, |
---|
| 383 | ) |
---|
| 384 | |
---|
| 385 | employer = schema.TextLine( |
---|
| 386 | title = _(u'Employer'), |
---|
| 387 | required = False, |
---|
| 388 | readonly = False, |
---|
| 389 | ) |
---|
| 390 | |
---|
| 391 | emp_position = schema.TextLine( |
---|
| 392 | title = _(u'Employer Position'), |
---|
| 393 | required = False, |
---|
| 394 | readonly = False, |
---|
| 395 | ) |
---|
| 396 | |
---|
| 397 | emp_start = FormattedDate( |
---|
| 398 | title = _(u'Start Date'), |
---|
| 399 | required = False, |
---|
| 400 | readonly = False, |
---|
| 401 | show_year = True, |
---|
| 402 | ) |
---|
| 403 | |
---|
| 404 | emp_end = FormattedDate( |
---|
| 405 | title = _(u'End Date'), |
---|
| 406 | required = False, |
---|
| 407 | readonly = False, |
---|
| 408 | show_year = True, |
---|
| 409 | ) |
---|
| 410 | |
---|
| 411 | emp_reason = schema.TextLine( |
---|
| 412 | title = _(u'Reason for Leaving'), |
---|
| 413 | required = False, |
---|
| 414 | readonly = False, |
---|
| 415 | ) |
---|
| 416 | |
---|
| 417 | employer2 = schema.TextLine( |
---|
| 418 | title = _(u'2nd Employer'), |
---|
| 419 | required = False, |
---|
| 420 | readonly = False, |
---|
| 421 | ) |
---|
| 422 | |
---|
| 423 | emp2_position = schema.TextLine( |
---|
| 424 | title = _(u'2nd Employer Position'), |
---|
| 425 | required = False, |
---|
| 426 | readonly = False, |
---|
| 427 | ) |
---|
| 428 | |
---|
| 429 | emp2_start = FormattedDate( |
---|
| 430 | title = _(u'Start Date'), |
---|
| 431 | required = False, |
---|
| 432 | readonly = False, |
---|
| 433 | show_year = True, |
---|
| 434 | ) |
---|
| 435 | |
---|
| 436 | emp2_end = FormattedDate( |
---|
| 437 | title = _(u'End Date'), |
---|
| 438 | required = False, |
---|
| 439 | readonly = False, |
---|
| 440 | show_year = True, |
---|
| 441 | ) |
---|
| 442 | |
---|
| 443 | emp2_reason = schema.TextLine( |
---|
| 444 | title = _(u'Reason for Leaving'), |
---|
| 445 | required = False, |
---|
| 446 | readonly = False, |
---|
| 447 | ) |
---|
| 448 | |
---|
| 449 | former_matric = schema.TextLine( |
---|
| 450 | title = _(u'If yes, matric number'), |
---|
| 451 | required = False, |
---|
| 452 | readonly = False, |
---|
| 453 | ) |
---|
| 454 | |
---|
[10298] | 455 | notice = schema.Text( |
---|
| 456 | title = _(u'Notice'), |
---|
| 457 | required = False, |
---|
| 458 | ) |
---|
[13977] | 459 | |
---|
| 460 | |
---|
| 461 | master_sheet_number = schema.TextLine( |
---|
| 462 | title = _(u'Master Sheet Number'), |
---|
| 463 | required = False, |
---|
| 464 | readonly = False, |
---|
| 465 | ) |
---|
| 466 | |
---|
[13996] | 467 | screening_venue = schema.TextLine( |
---|
| 468 | title = _(u'Screening Venue'), |
---|
| 469 | required = False, |
---|
| 470 | ) |
---|
[14666] | 471 | |
---|
[13996] | 472 | screening_date = schema.TextLine( |
---|
| 473 | title = _(u'Screening Date'), |
---|
| 474 | required = False, |
---|
| 475 | ) |
---|
[14666] | 476 | |
---|
[13996] | 477 | screening_score = schema.Int( |
---|
[14028] | 478 | title = _(u'Screening Points'), |
---|
[13996] | 479 | required = False, |
---|
| 480 | ) |
---|
[14666] | 481 | |
---|
[10298] | 482 | student_id = schema.TextLine( |
---|
| 483 | title = _(u'Student Id'), |
---|
| 484 | required = False, |
---|
| 485 | readonly = False, |
---|
| 486 | ) |
---|
[14666] | 487 | |
---|
[10298] | 488 | course_admitted = schema.Choice( |
---|
| 489 | title = _(u'Admitted Course of Study'), |
---|
| 490 | source = CertificateSource(), |
---|
| 491 | required = False, |
---|
| 492 | ) |
---|
[14666] | 493 | |
---|
[10298] | 494 | locked = schema.Bool( |
---|
| 495 | title = _(u'Form locked'), |
---|
| 496 | default = False, |
---|
| 497 | ) |
---|
| 498 | |
---|
| 499 | @invariant |
---|
| 500 | def second_choice(applicant): |
---|
| 501 | if applicant.course1 == applicant.course2: |
---|
| 502 | raise Invalid(_("2nd choice course must differ from 1st choice course.")) |
---|
| 503 | |
---|
[13977] | 504 | #ICustomUGApplicant['programme_type'].order = IApplicantBaseData[ |
---|
| 505 | # 'reg_number'].order |
---|
[10924] | 506 | |
---|
[8931] | 507 | class ICustomPGApplicant(INigeriaPGApplicant): |
---|
[7853] | 508 | """A postgraduate applicant. |
---|
| 509 | |
---|
[8521] | 510 | This interface defines the least common multiple of all fields |
---|
| 511 | in pg application forms. In customized forms, fields can be excluded by |
---|
| 512 | adding them to the PG_OMIT* tuples. |
---|
[7866] | 513 | """ |
---|
| 514 | |
---|
[13544] | 515 | class ITranscriptApplicant(IKofaObject): |
---|
| 516 | """A transcript applicant. |
---|
| 517 | """ |
---|
[8012] | 518 | |
---|
[13544] | 519 | suspended = schema.Bool( |
---|
| 520 | title = _(u'Account suspended'), |
---|
| 521 | default = False, |
---|
| 522 | required = False, |
---|
| 523 | ) |
---|
| 524 | |
---|
| 525 | locked = schema.Bool( |
---|
| 526 | title = _(u'Form locked'), |
---|
| 527 | default = False, |
---|
| 528 | required = False, |
---|
| 529 | ) |
---|
| 530 | |
---|
| 531 | applicant_id = schema.TextLine( |
---|
| 532 | title = _(u'Applicant Id'), |
---|
| 533 | required = False, |
---|
| 534 | readonly = False, |
---|
| 535 | ) |
---|
| 536 | |
---|
[14472] | 537 | reg_number = TextLineChoice( |
---|
[14486] | 538 | title = _(u'Kofa Registration Number'), |
---|
[14472] | 539 | readonly = False, |
---|
| 540 | required = True, |
---|
| 541 | source = contextual_reg_num_source, |
---|
| 542 | ) |
---|
| 543 | |
---|
[13544] | 544 | firstname = schema.TextLine( |
---|
| 545 | title = _(u'First Name'), |
---|
| 546 | required = True, |
---|
| 547 | ) |
---|
| 548 | |
---|
| 549 | middlename = schema.TextLine( |
---|
| 550 | title = _(u'Middle Name'), |
---|
| 551 | required = False, |
---|
| 552 | ) |
---|
| 553 | |
---|
| 554 | lastname = schema.TextLine( |
---|
| 555 | title = _(u'Last Name (Surname)'), |
---|
| 556 | required = True, |
---|
| 557 | ) |
---|
| 558 | |
---|
[14472] | 559 | matric_number = schema.TextLine( |
---|
| 560 | title = _(u'Matriculation Number'), |
---|
[13544] | 561 | readonly = False, |
---|
[14486] | 562 | required = True, |
---|
[13544] | 563 | ) |
---|
| 564 | |
---|
| 565 | date_of_birth = FormattedDate( |
---|
| 566 | title = _(u'Date of Birth'), |
---|
| 567 | required = False, |
---|
| 568 | #date_format = u'%d/%m/%Y', # Use grok-instance-wide default |
---|
| 569 | show_year = True, |
---|
| 570 | ) |
---|
| 571 | |
---|
| 572 | place_of_birth = schema.TextLine( |
---|
| 573 | title = _(u'Place of Birth'), |
---|
| 574 | readonly = False, |
---|
| 575 | required = False, |
---|
| 576 | ) |
---|
| 577 | |
---|
| 578 | nationality = schema.Choice( |
---|
| 579 | vocabulary = nats_vocab, |
---|
| 580 | title = _(u'Nationality'), |
---|
| 581 | required = False, |
---|
| 582 | ) |
---|
| 583 | |
---|
| 584 | email = schema.ASCIILine( |
---|
| 585 | title = _(u'Email Address'), |
---|
| 586 | required = True, |
---|
| 587 | constraint=validate_email, |
---|
| 588 | ) |
---|
| 589 | |
---|
| 590 | phone = PhoneNumber( |
---|
| 591 | title = _(u'Phone'), |
---|
| 592 | description = u'', |
---|
| 593 | required = False, |
---|
| 594 | ) |
---|
| 595 | |
---|
| 596 | perm_address = schema.Text( |
---|
| 597 | title = _(u'Current Local Address'), |
---|
| 598 | required = False, |
---|
| 599 | readonly = False, |
---|
| 600 | ) |
---|
| 601 | |
---|
| 602 | dispatch_address = schema.Text( |
---|
[14306] | 603 | title = _(u'Dispatch Addresses'), |
---|
| 604 | description = u'Addresses to which transcript should be posted.', |
---|
[13544] | 605 | required = False, |
---|
| 606 | readonly = False, |
---|
| 607 | ) |
---|
| 608 | |
---|
| 609 | entry_mode = schema.Choice( |
---|
| 610 | title = _(u'Entry Mode'), |
---|
| 611 | source = StudyModeSource(), |
---|
| 612 | required = False, |
---|
| 613 | readonly = False, |
---|
| 614 | ) |
---|
| 615 | |
---|
| 616 | entry_session = schema.Choice( |
---|
| 617 | title = _(u'Entry Session'), |
---|
| 618 | source = academic_sessions_vocab, |
---|
| 619 | required = False, |
---|
| 620 | readonly = False, |
---|
| 621 | ) |
---|
| 622 | |
---|
| 623 | end_session = schema.Choice( |
---|
| 624 | title = _(u'End Session'), |
---|
| 625 | source = academic_sessions_vocab, |
---|
| 626 | required = False, |
---|
| 627 | readonly = False, |
---|
| 628 | ) |
---|
| 629 | |
---|
| 630 | course_studied = schema.Choice( |
---|
| 631 | title = _(u'Course of Study / Degree'), |
---|
| 632 | source = CertificateSource(), |
---|
[14666] | 633 | required = False, |
---|
[13544] | 634 | readonly = False, |
---|
| 635 | ) |
---|
| 636 | |
---|
| 637 | purpose = schema.TextLine( |
---|
| 638 | title = _(u'Purpose of this Application'), |
---|
| 639 | readonly = False, |
---|
| 640 | required = False, |
---|
| 641 | ) |
---|
| 642 | |
---|
| 643 | course_changed = schema.Choice( |
---|
| 644 | title = _(u'Change of Study Course'), |
---|
| 645 | description = u'If yes, select previous course of study.', |
---|
| 646 | source = CertificateSource(), |
---|
| 647 | readonly = False, |
---|
| 648 | required = False, |
---|
| 649 | ) |
---|
| 650 | |
---|
| 651 | change_level = schema.Choice( |
---|
| 652 | title = _(u'Change Level'), |
---|
| 653 | description = u'If yes, select level at which you changed course of study.', |
---|
| 654 | source = StudyLevelSource(), |
---|
| 655 | required = False, |
---|
| 656 | readonly = False, |
---|
| 657 | ) |
---|
| 658 | |
---|
[14306] | 659 | no_copies = schema.Choice( |
---|
| 660 | title = _(u'Number of Copies'), |
---|
| 661 | description = u'Must correspond with the number of dispatch addresses above.', |
---|
| 662 | values=[1, 2, 3, 4], |
---|
| 663 | required = False, |
---|
| 664 | readonly = False, |
---|
| 665 | default = 1, |
---|
| 666 | ) |
---|
| 667 | |
---|
[14304] | 668 | class ICertificateRequest(IKofaObject): |
---|
| 669 | """A transcript applicant. |
---|
| 670 | """ |
---|
[13544] | 671 | |
---|
[14304] | 672 | suspended = schema.Bool( |
---|
| 673 | title = _(u'Account suspended'), |
---|
| 674 | default = False, |
---|
| 675 | required = False, |
---|
| 676 | ) |
---|
| 677 | |
---|
| 678 | locked = schema.Bool( |
---|
| 679 | title = _(u'Form locked'), |
---|
| 680 | default = False, |
---|
| 681 | required = False, |
---|
| 682 | ) |
---|
| 683 | |
---|
| 684 | applicant_id = schema.TextLine( |
---|
| 685 | title = _(u'Applicant Id'), |
---|
| 686 | required = False, |
---|
| 687 | readonly = False, |
---|
| 688 | ) |
---|
| 689 | |
---|
[14472] | 690 | reg_number = TextLineChoice( |
---|
[14486] | 691 | title = _(u'Kofa Registration Number'), |
---|
[14472] | 692 | readonly = False, |
---|
| 693 | required = True, |
---|
| 694 | source = contextual_reg_num_source, |
---|
| 695 | ) |
---|
| 696 | |
---|
[14304] | 697 | firstname = schema.TextLine( |
---|
| 698 | title = _(u'First Name'), |
---|
| 699 | required = True, |
---|
| 700 | ) |
---|
| 701 | |
---|
| 702 | middlename = schema.TextLine( |
---|
| 703 | title = _(u'Middle Name'), |
---|
| 704 | required = False, |
---|
| 705 | ) |
---|
| 706 | |
---|
| 707 | lastname = schema.TextLine( |
---|
| 708 | title = _(u'Last Name (Surname)'), |
---|
| 709 | required = True, |
---|
| 710 | ) |
---|
| 711 | |
---|
[14472] | 712 | matric_number = schema.TextLine( |
---|
| 713 | title = _(u'Matriculation Number'), |
---|
[14304] | 714 | readonly = False, |
---|
[14486] | 715 | required = True, |
---|
[14304] | 716 | ) |
---|
| 717 | |
---|
| 718 | date_of_birth = FormattedDate( |
---|
| 719 | title = _(u'Date of Birth'), |
---|
| 720 | required = False, |
---|
| 721 | #date_format = u'%d/%m/%Y', # Use grok-instance-wide default |
---|
| 722 | show_year = True, |
---|
| 723 | ) |
---|
| 724 | |
---|
| 725 | place_of_birth = schema.TextLine( |
---|
| 726 | title = _(u'Place of Birth'), |
---|
| 727 | readonly = False, |
---|
| 728 | required = False, |
---|
| 729 | ) |
---|
| 730 | |
---|
| 731 | nationality = schema.Choice( |
---|
| 732 | vocabulary = nats_vocab, |
---|
| 733 | title = _(u'Nationality'), |
---|
| 734 | required = False, |
---|
| 735 | ) |
---|
| 736 | |
---|
| 737 | email = schema.ASCIILine( |
---|
| 738 | title = _(u'Email Address'), |
---|
| 739 | required = True, |
---|
| 740 | constraint=validate_email, |
---|
| 741 | ) |
---|
| 742 | |
---|
| 743 | phone = PhoneNumber( |
---|
| 744 | title = _(u'Phone'), |
---|
| 745 | description = u'', |
---|
| 746 | required = False, |
---|
| 747 | ) |
---|
| 748 | |
---|
| 749 | perm_address = schema.Text( |
---|
| 750 | title = _(u'Current Local Address'), |
---|
| 751 | required = False, |
---|
| 752 | readonly = False, |
---|
| 753 | ) |
---|
| 754 | |
---|
| 755 | dispatch_address = schema.Text( |
---|
[14306] | 756 | title = _(u'Dispatch Addresses'), |
---|
| 757 | description = u'Addresses to which certificate should be posted.', |
---|
[14304] | 758 | required = False, |
---|
| 759 | readonly = False, |
---|
| 760 | ) |
---|
| 761 | |
---|
| 762 | entry_session = schema.Choice( |
---|
| 763 | title = _(u'Entry Session'), |
---|
| 764 | source = academic_sessions_vocab, |
---|
| 765 | required = False, |
---|
| 766 | readonly = False, |
---|
| 767 | ) |
---|
| 768 | |
---|
| 769 | end_session = schema.Choice( |
---|
| 770 | title = _(u'End Session'), |
---|
| 771 | source = academic_sessions_vocab, |
---|
| 772 | required = False, |
---|
| 773 | readonly = False, |
---|
| 774 | ) |
---|
| 775 | |
---|
| 776 | course_studied = schema.Choice( |
---|
| 777 | title = _(u'Course of Study / Degree'), |
---|
| 778 | source = CertificateSource(), |
---|
[14486] | 779 | required = True, |
---|
[14304] | 780 | readonly = False, |
---|
| 781 | ) |
---|
| 782 | |
---|
[14306] | 783 | no_copies = schema.Choice( |
---|
| 784 | title = _(u'Number of Copies'), |
---|
| 785 | description = u'Must correspond with the number of dispatch addresses above.', |
---|
| 786 | values=[1, 2, 3, 4], |
---|
| 787 | required = False, |
---|
| 788 | readonly = False, |
---|
| 789 | default = 1, |
---|
| 790 | ) |
---|
| 791 | |
---|
[13544] | 792 | class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant, |
---|
[14304] | 793 | ITranscriptApplicant, ICertificateRequest): |
---|
[14471] | 794 | """An interface for all types of applicants. |
---|
[13544] | 795 | |
---|
[8931] | 796 | Attention: The ICustomPGApplicant field seetings will be overwritten |
---|
| 797 | by ICustomPGApplicant field settings. If a field is defined |
---|
[8728] | 798 | in both interfaces zope.schema validates only against the |
---|
[8931] | 799 | constraints in ICustomUGApplicant. This does not affect the forms |
---|
| 800 | since they are build on either ICustomUGApplicant or ICustomPGApplicant. |
---|
[8012] | 801 | """ |
---|
| 802 | |
---|
[8746] | 803 | def writeLogMessage(view, comment): |
---|
[8053] | 804 | """Adds an INFO message to the log file |
---|
| 805 | """ |
---|
| 806 | |
---|
| 807 | def createStudent(): |
---|
| 808 | """Create a student object from applicatnt data |
---|
| 809 | and copy applicant object. |
---|
| 810 | """ |
---|
| 811 | |
---|
[10298] | 812 | class ICustomUGApplicantEdit(ICustomUGApplicant): |
---|
[8728] | 813 | """An undergraduate applicant interface for edit forms. |
---|
[8012] | 814 | |
---|
| 815 | Here we can repeat the fields from base data and set the |
---|
| 816 | `required` and `readonly` attributes to True to further restrict |
---|
| 817 | the data access. Or we can allow only certain certificates to be |
---|
| 818 | selected by choosing the appropriate source. |
---|
| 819 | |
---|
| 820 | We cannot omit fields here. This has to be done in the |
---|
| 821 | respective form page. |
---|
| 822 | """ |
---|
| 823 | |
---|
[13977] | 824 | #programme_type = schema.Choice( |
---|
| 825 | # title = _(u'Programme Type'), |
---|
| 826 | # vocabulary = programme_types_vocab, |
---|
| 827 | # required = True, |
---|
| 828 | # ) |
---|
[13548] | 829 | |
---|
[10924] | 830 | date_of_birth = FormattedDate( |
---|
| 831 | title = _(u'Date of Birth'), |
---|
| 832 | required = True, |
---|
| 833 | show_year = True, |
---|
| 834 | ) |
---|
| 835 | |
---|
[14829] | 836 | fst_sit_fname = schema.TextLine( |
---|
| 837 | title = _(u'Full Name'), |
---|
| 838 | required = True, |
---|
| 839 | readonly = False, |
---|
| 840 | ) |
---|
| 841 | |
---|
| 842 | fst_sit_no = schema.TextLine( |
---|
| 843 | title = _(u'Exam Number'), |
---|
| 844 | required = True, |
---|
| 845 | readonly = False, |
---|
| 846 | ) |
---|
| 847 | |
---|
| 848 | fst_sit_sc_pin = schema.TextLine( |
---|
| 849 | title = _(u'Scratch Card Pin'), |
---|
| 850 | required = True, |
---|
| 851 | readonly = False, |
---|
| 852 | ) |
---|
| 853 | |
---|
| 854 | fst_sit_sc_serial_number = schema.TextLine( |
---|
| 855 | title = _(u'Scratch Card Serial Number'), |
---|
| 856 | required = True, |
---|
| 857 | readonly = False, |
---|
| 858 | ) |
---|
| 859 | |
---|
| 860 | fst_sit_date = FormattedDate( |
---|
| 861 | title = _(u'Exam Date'), |
---|
| 862 | required = True, |
---|
| 863 | readonly = False, |
---|
| 864 | show_year = True, |
---|
| 865 | ) |
---|
| 866 | |
---|
| 867 | fst_sit_type = schema.Choice( |
---|
| 868 | title = _(u'Exam Type'), |
---|
| 869 | required = True, |
---|
| 870 | readonly = False, |
---|
| 871 | vocabulary = exam_types, |
---|
| 872 | ) |
---|
| 873 | |
---|
[13977] | 874 | #ICustomUGApplicantEdit['programme_type'].order = ICustomUGApplicant[ |
---|
| 875 | # 'programme_type'].order |
---|
[10924] | 876 | ICustomUGApplicantEdit['date_of_birth'].order = ICustomUGApplicant[ |
---|
| 877 | 'date_of_birth'].order |
---|
[14829] | 878 | ICustomUGApplicantEdit['fst_sit_fname'].order = ICustomUGApplicant[ |
---|
| 879 | 'fst_sit_fname'].order |
---|
| 880 | ICustomUGApplicantEdit['fst_sit_no'].order = ICustomUGApplicant[ |
---|
| 881 | 'fst_sit_no'].order |
---|
| 882 | ICustomUGApplicantEdit['fst_sit_sc_pin'].order = ICustomUGApplicant[ |
---|
| 883 | 'fst_sit_sc_pin'].order |
---|
| 884 | ICustomUGApplicantEdit['fst_sit_sc_serial_number'].order = ICustomUGApplicant[ |
---|
| 885 | 'fst_sit_sc_serial_number'].order |
---|
| 886 | ICustomUGApplicantEdit['fst_sit_date'].order = ICustomUGApplicant[ |
---|
| 887 | 'fst_sit_date'].order |
---|
| 888 | ICustomUGApplicantEdit['fst_sit_type'].order = ICustomUGApplicant[ |
---|
| 889 | 'fst_sit_type'].order |
---|
[10924] | 890 | |
---|
[8980] | 891 | class ICustomPGApplicantEdit(INigeriaPGApplicantEdit): |
---|
[7866] | 892 | """A postgraduate applicant interface for editing. |
---|
| 893 | |
---|
| 894 | Here we can repeat the fields from base data and set the |
---|
| 895 | `required` and `readonly` attributes to True to further restrict |
---|
| 896 | the data access. Or we can allow only certain certificates to be |
---|
| 897 | selected by choosing the appropriate source. |
---|
| 898 | |
---|
| 899 | We cannot omit fields here. This has to be done in the |
---|
| 900 | respective form page. |
---|
[8017] | 901 | """ |
---|
[8455] | 902 | |
---|
[8931] | 903 | class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): |
---|
[8247] | 904 | """An applicant payment via payment gateways. |
---|
| 905 | |
---|
| 906 | """ |
---|
[8532] | 907 | |
---|
[8980] | 908 | class IPUTMEApplicantEdit(IPUTMEApplicantEdit): |
---|
[8532] | 909 | """An undergraduate applicant interface for editing. |
---|
| 910 | |
---|
| 911 | Here we can repeat the fields from base data and set the |
---|
| 912 | `required` and `readonly` attributes to True to further restrict |
---|
| 913 | the data access. Or we can allow only certain certificates to be |
---|
| 914 | selected by choosing the appropriate source. |
---|
| 915 | |
---|
| 916 | We cannot omit fields here. This has to be done in the |
---|
| 917 | respective form page. |
---|
| 918 | """ |
---|
| 919 | |
---|
[14471] | 920 | class ICustomApplicantUpdateByRegNo(ICustomApplicant): |
---|
[8583] | 921 | """Representation of an applicant. |
---|
| 922 | |
---|
| 923 | Skip regular reg_number validation if reg_number is used for finding |
---|
| 924 | the applicant object. |
---|
| 925 | """ |
---|
[8980] | 926 | |
---|
[14471] | 927 | reg_number = schema.TextLine( |
---|
| 928 | title = u'Registration Number', |
---|
| 929 | required = False, |
---|
| 930 | ) |
---|
[13544] | 931 | |
---|
| 932 | |
---|
[14471] | 933 | |
---|
| 934 | |
---|