[7853] | 1 | ## $Id: interfaces.py 8979 2012-07-12 08:15:49Z 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 |
---|
[8051] | 22 | from waeup.kofa.applicants.interfaces import ( |
---|
[8053] | 23 | IApplicantBaseData, |
---|
[8051] | 24 | AppCatCertificateSource, CertificateSource) |
---|
| 25 | from waeup.kofa.schoolgrades import ResultEntryField |
---|
[8531] | 26 | from waeup.kofa.interfaces import ( |
---|
| 27 | SimpleKofaVocabulary, academic_sessions_vocab, validate_email) |
---|
| 28 | from waeup.kofa.schema import FormattedDate, TextLineChoice |
---|
| 29 | from waeup.kofa.students.vocabularies import nats_vocab, GenderSource |
---|
| 30 | from waeup.kofa.applicants.interfaces import contextual_reg_num_source |
---|
[8933] | 31 | from kofacustom.nigeria.applicants.interfaces import ( |
---|
| 32 | LGASource, high_qual, high_grade, exam_types, |
---|
| 33 | INigeriaUGApplicant, INigeriaPGApplicant, |
---|
| 34 | INigeriaApplicantOnlinePayment, |
---|
[8979] | 35 | INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, |
---|
| 36 | INigeriaApplicantUpdateByRegNo, |
---|
| 37 | IPUTMEApplicantEdit, |
---|
[8933] | 38 | UG_OMIT_DISPLAY_FIELDS, |
---|
| 39 | UG_OMIT_PDF_FIELDS, |
---|
| 40 | UG_OMIT_MANAGE_FIELDS, |
---|
| 41 | UG_OMIT_EDIT_FIELDS, |
---|
| 42 | PUTME_OMIT_EDIT_FIELDS, |
---|
| 43 | UG_OMIT_RESULT_SLIP_FIELDS, |
---|
| 44 | PG_OMIT_DISPLAY_FIELDS, |
---|
| 45 | PG_OMIT_PDF_FIELDS, |
---|
| 46 | PG_OMIT_MANAGE_FIELDS, |
---|
| 47 | PG_OMIT_EDIT_FIELDS, |
---|
| 48 | ) |
---|
[8460] | 49 | from waeup.fceokene.interfaces import MessageFactory as _ |
---|
| 50 | from waeup.fceokene.payments.interfaces import ICustomOnlinePayment |
---|
[7853] | 51 | |
---|
[8933] | 52 | class ICustomUGApplicant(INigeriaUGApplicant): |
---|
[8012] | 53 | """An undergraduate applicant. |
---|
| 54 | |
---|
[8520] | 55 | This interface defines the least common multiple of all fields |
---|
| 56 | in ug application forms. In customized forms, fields can be excluded by |
---|
| 57 | adding them to the UG_OMIT* tuples. |
---|
[8012] | 58 | """ |
---|
| 59 | |
---|
[8933] | 60 | class ICustomPGApplicant(INigeriaPGApplicant): |
---|
[7853] | 61 | """A postgraduate applicant. |
---|
| 62 | |
---|
[8520] | 63 | This interface defines the least common multiple of all fields |
---|
| 64 | in pg application forms. In customized forms, fields can be excluded by |
---|
| 65 | adding them to the PG_OMIT* tuples. |
---|
[7866] | 66 | """ |
---|
| 67 | |
---|
[8933] | 68 | class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant): |
---|
[8012] | 69 | """An interface for both types of applicants. |
---|
| 70 | |
---|
[8933] | 71 | Attention: The ICustomPGApplicant field seetings will be overwritten |
---|
| 72 | by ICustomPGApplicant field settings. If a field is defined |
---|
[8729] | 73 | in both interfaces zope.schema validates only against the |
---|
[8933] | 74 | constraints in ICustomUGApplicant. This does not affect the forms |
---|
| 75 | since they are build on either ICustomUGApplicant or ICustomPGApplicant. |
---|
[8012] | 76 | """ |
---|
| 77 | |
---|
[8745] | 78 | def writeLogMessage(view, comment): |
---|
[8053] | 79 | """Adds an INFO message to the log file |
---|
| 80 | """ |
---|
| 81 | |
---|
| 82 | def createStudent(): |
---|
| 83 | """Create a student object from applicatnt data |
---|
| 84 | and copy applicant object. |
---|
| 85 | """ |
---|
| 86 | |
---|
[8979] | 87 | class ICustomUGApplicantEdit(INigeriaUGApplicantEdit): |
---|
[8729] | 88 | """An undergraduate applicant interface for edit forms. |
---|
[8012] | 89 | |
---|
| 90 | Here we can repeat the fields from base data and set the |
---|
| 91 | `required` and `readonly` attributes to True to further restrict |
---|
| 92 | the data access. Or we can allow only certain certificates to be |
---|
| 93 | selected by choosing the appropriate source. |
---|
| 94 | |
---|
| 95 | We cannot omit fields here. This has to be done in the |
---|
| 96 | respective form page. |
---|
| 97 | """ |
---|
| 98 | |
---|
[8979] | 99 | class ICustomPGApplicantEdit(INigeriaPGApplicantEdit): |
---|
[7866] | 100 | """A postgraduate applicant interface for editing. |
---|
| 101 | |
---|
| 102 | Here we can repeat the fields from base data and set the |
---|
| 103 | `required` and `readonly` attributes to True to further restrict |
---|
| 104 | the data access. Or we can allow only certain certificates to be |
---|
| 105 | selected by choosing the appropriate source. |
---|
| 106 | |
---|
| 107 | We cannot omit fields here. This has to be done in the |
---|
| 108 | respective form page. |
---|
[8017] | 109 | """ |
---|
[8454] | 110 | |
---|
[8933] | 111 | class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): |
---|
[8247] | 112 | """An applicant payment via payment gateways. |
---|
| 113 | |
---|
| 114 | """ |
---|
[8531] | 115 | |
---|
[8979] | 116 | class IPUTMEApplicantEdit(IPUTMEApplicantEdit): |
---|
[8531] | 117 | """An undergraduate applicant interface for editing. |
---|
| 118 | |
---|
| 119 | Here we can repeat the fields from base data and set the |
---|
| 120 | `required` and `readonly` attributes to True to further restrict |
---|
| 121 | the data access. Or we can allow only certain certificates to be |
---|
| 122 | selected by choosing the appropriate source. |
---|
| 123 | |
---|
| 124 | We cannot omit fields here. This has to be done in the |
---|
| 125 | respective form page. |
---|
| 126 | """ |
---|
| 127 | |
---|
[8979] | 128 | class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo): |
---|
[8584] | 129 | """Representation of an applicant. |
---|
| 130 | |
---|
| 131 | Skip regular reg_number validation if reg_number is used for finding |
---|
| 132 | the applicant object. |
---|
| 133 | """ |
---|
[8979] | 134 | |
---|