source: main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py @ 15540

Last change on this file since 15540 was 15531, checked in by Henrik Bettermann, 5 years ago

Implement "Scanned Result/Certificate? via email" application form.

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