1 | ## $Id: utils.py 13963 2016-06-21 06:30:07Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2012 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 | """Customize general helper utilities for Kofa. |
---|
19 | """ |
---|
20 | |
---|
21 | import string |
---|
22 | from kofacustom.nigeria.utils.utils import NigeriaKofaUtils |
---|
23 | |
---|
24 | class CustomKofaUtils(NigeriaKofaUtils): |
---|
25 | """A collection of methods subject to customization. |
---|
26 | """ |
---|
27 | |
---|
28 | PREFERRED_LANGUAGES_DICT = { |
---|
29 | } |
---|
30 | |
---|
31 | PAYMENT_CATEGORIES = { |
---|
32 | 'schoolfee': 'School Fee', |
---|
33 | 'schoolfee_1': 'School Fee Plus (1st instalment)', |
---|
34 | 'schoolfee_2': 'School Fee (2nd instalment)', |
---|
35 | 'schoolfee_incl': 'School Fee Plus', |
---|
36 | 'clearance': 'Acceptance Fee', |
---|
37 | 'clearance_incl': 'Acceptance Fee Plus', |
---|
38 | 'hostel_maintenance': 'Hostel Accommodation Fee', |
---|
39 | 'application': 'Application Fee', |
---|
40 | 'bed_allocation': 'Bed Allocation Fee', |
---|
41 | 'transfer': 'Transfer Fee', |
---|
42 | 'transcript': 'Transcript Fee', |
---|
43 | 'late_registration': 'Late Course Registration Fee', |
---|
44 | 'welfare': 'Student Welfare Assurance Fee', |
---|
45 | 'union': 'Student Union Dues', |
---|
46 | 'lapel': 'Lapel/File Fee', |
---|
47 | 'matric_gown': 'Matriculation Gown Fee', |
---|
48 | 'concessional': 'Concessional Fee', |
---|
49 | } |
---|
50 | |
---|
51 | SELECTABLE_PAYMENT_CATEGORIES = { |
---|
52 | 'schoolfee': 'School Fee without additional fees', |
---|
53 | 'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee', |
---|
54 | 'schoolfee_2': 'School Fee (2nd instalment)', |
---|
55 | 'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee', |
---|
56 | 'clearance': 'Acceptance Fee without additional fees', |
---|
57 | 'clearance_incl': 'Acceptance Fee + Matric Gown Fee + Lapel/File Fee', |
---|
58 | 'hostel_maintenance': 'Hostel Accommodation Fee', |
---|
59 | 'application': 'Application Fee', |
---|
60 | #'bed_allocation': 'Bed Allocation Fee', |
---|
61 | #'transfer': 'Transfer Fee', |
---|
62 | 'transcript': 'Transcript Fee', |
---|
63 | 'late_registration': 'Late Course Registration Fee', |
---|
64 | 'welfare': 'Student Welfare Assurance Fee', |
---|
65 | 'union': 'Student Union Dues', |
---|
66 | 'lapel': 'Lapel/File Fee', |
---|
67 | 'matric_gown': 'Matriculation Gown Fee', |
---|
68 | 'concessional': 'Concessional Fee', |
---|
69 | } |
---|
70 | |
---|
71 | REPORTABLE_PAYMENT_CATEGORIES = { |
---|
72 | 'schoolfee': 'School Fee', |
---|
73 | 'schoolfee_incl': 'School Fee Plus', |
---|
74 | 'schoolfee_1': 'School Fee 1 Plus', |
---|
75 | 'schoolfee_2': 'School Fee 2', |
---|
76 | 'clearance': 'Acceptance Fee', |
---|
77 | 'clearance_incl': 'Acceptance Fee Plus', |
---|
78 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
79 | } |
---|
80 | |
---|
81 | BALANCE_PAYMENT_CATEGORIES = { |
---|
82 | 'schoolfee': 'School Fee', |
---|
83 | 'clearance': 'Acceptance Fee', |
---|
84 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
85 | 'late_registration': 'Late Course Registration Fee', |
---|
86 | 'welfare': 'Student Welfare Assurance Fee', |
---|
87 | 'union': 'Student Union Dues', |
---|
88 | 'lapel': 'Lapel/File Fee', |
---|
89 | 'matric_gown': 'Matriculation Gown Fee', |
---|
90 | } |
---|
91 | |
---|
92 | APP_CATS_DICT = { |
---|
93 | 'basic': 'PUTME, PUDE, PCE, PRENCE', |
---|
94 | 'no': 'No Application', |
---|
95 | 'pg_ft': 'Postgraduate Full-Time', |
---|
96 | 'pg_pt': 'Postgraduate Part-Time', |
---|
97 | 'cest': 'Part-Time, Diploma, Certificate', |
---|
98 | 'found': 'Foundation', |
---|
99 | 'ptee': 'Part-Time Entrance Examination', |
---|
100 | 'ioe_dp': 'Institute of Education Diploma', |
---|
101 | } |
---|
102 | |
---|
103 | STUDY_MODES_DICT = { |
---|
104 | 'ug_ft': 'Undergraduate Full Time', |
---|
105 | 'ug_pt': 'Undergraduate Part Time', |
---|
106 | 'de_ft': 'Direct Entry Full Time', |
---|
107 | 'de_pt': 'Direct Entry Part Time', |
---|
108 | 'dp_pt': 'Diploma Part Time', |
---|
109 | 'dp_ft': 'Diploma Full Time', |
---|
110 | 'special_pg_ft': 'Postgraduate Full Time', |
---|
111 | 'special_pg_pt': 'Postgraduate Part Time', |
---|
112 | 'found': 'Foundation', |
---|
113 | 'transfer': 'Transfer', |
---|
114 | 'mug_ft': 'Undergraduate Full Time Merit List', |
---|
115 | 'mde_ft': 'Direct Entry Full Time Merit List', |
---|
116 | } |
---|
117 | |
---|
118 | VERDICTS_DICT = { |
---|
119 | '0': 'not yet', |
---|
120 | 'A': 'Successful student', |
---|
121 | 'B': 'Student with carryover courses', |
---|
122 | 'C': 'Student on probation', |
---|
123 | #'D': 'Withdrawn from the faculty', |
---|
124 | #'E': 'Student who were previously on probation', |
---|
125 | #'F': 'Medical case', |
---|
126 | #'G': 'Absent from examination', |
---|
127 | #'H': 'Withheld results', |
---|
128 | #'I': 'Expelled/rusticated/suspended student', |
---|
129 | #'J': 'Temporary withdrawn from the university', |
---|
130 | #'K': 'Unregistered student', |
---|
131 | #'L': 'Referred student', |
---|
132 | #'M': 'Reinstatement', |
---|
133 | #'N': 'Student on transfer', |
---|
134 | #'O': 'NCE-III repeater', |
---|
135 | #'Y': 'No previous verdict', |
---|
136 | #'X': 'New 300 level student', |
---|
137 | 'Z': 'Successful student (provisional)', |
---|
138 | #'A1': 'First Class', |
---|
139 | #'A2': 'Second Class Upper', |
---|
140 | #'A3': 'Second Class Lower', |
---|
141 | #'A4': 'Third Class', |
---|
142 | #'A5': 'Pass', |
---|
143 | #'A6': 'Distinction', |
---|
144 | #'A7': 'Credit', |
---|
145 | #'A8': 'Merit', |
---|
146 | 'NEOR': 'No evidence of registration', |
---|
147 | 'NEOV': 'No evidence of verification', |
---|
148 | 'FRNS': 'Faculty requirements not satisfied', |
---|
149 | } |
---|
150 | |
---|
151 | DISABLE_PAYMENT_GROUP_DICT = { |
---|
152 | 'sf_all': 'School Fee - All Students', |
---|
153 | 'maint_all': 'Accommodation Fee - All Students', |
---|
154 | 'cl_regular': 'Acceptance Fee - Regular Students', |
---|
155 | } |
---|
156 | |
---|
157 | MODE_GROUPS = { |
---|
158 | 'All': ('all',), |
---|
159 | 'Undergraduate Full-Time': ('ug_ft', 'mde_ft', 'mug_ft', 'de_ft'), |
---|
160 | 'Undergraduate Part-Time': ('ug_pt', 'de_pt'), |
---|
161 | 'Postgraduate': ('pg_ft','special_pg_ft', 'special_pg_pt'), |
---|
162 | 'Foundation Programme': ('found',), |
---|
163 | 'Institute of Education': ('dp_ft'), |
---|
164 | } |
---|
165 | |
---|
166 | def fullname(self, firstname, lastname, middlename=None): |
---|
167 | """Construct fullname. |
---|
168 | """ |
---|
169 | try: |
---|
170 | lastname = lastname.upper() |
---|
171 | except AttributeError: |
---|
172 | pass |
---|
173 | # We do not necessarily have the middlename attribute |
---|
174 | if middlename: |
---|
175 | givennames = '%s %s' % (firstname, middlename) |
---|
176 | else: |
---|
177 | givennames = '%s' % firstname |
---|
178 | givennames = string.capwords( |
---|
179 | givennames.replace('-', ' - ')).replace(' - ', '-') |
---|
180 | fullname = '%s, %s' % (lastname, givennames) |
---|
181 | if '<' in fullname: |
---|
182 | return 'XXX' |
---|
183 | return fullname |
---|