[7569] | 1 | ## $Id: utils.py 14296 2016-11-28 12:10:49Z 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 | ## |
---|
[7822] | 18 | """Customize general helper utilities for Kofa. |
---|
[7569] | 19 | """ |
---|
[13963] | 20 | |
---|
| 21 | import string |
---|
[8823] | 22 | from kofacustom.nigeria.utils.utils import NigeriaKofaUtils |
---|
[7569] | 23 | |
---|
[8823] | 24 | class CustomKofaUtils(NigeriaKofaUtils): |
---|
[7569] | 25 | """A collection of methods subject to customization. |
---|
| 26 | """ |
---|
[7845] | 27 | |
---|
| 28 | PREFERRED_LANGUAGES_DICT = { |
---|
[9755] | 29 | } |
---|
| 30 | |
---|
| 31 | PAYMENT_CATEGORIES = { |
---|
| 32 | 'schoolfee': 'School Fee', |
---|
[13512] | 33 | 'schoolfee_1': 'School Fee Plus (1st instalment)', |
---|
| 34 | 'schoolfee_2': 'School Fee (2nd instalment)', |
---|
[13410] | 35 | 'schoolfee_incl': 'School Fee Plus', |
---|
[9755] | 36 | 'clearance': 'Acceptance Fee', |
---|
[13410] | 37 | 'clearance_incl': 'Acceptance Fee Plus', |
---|
[13424] | 38 | 'hostel_maintenance': 'Hostel Accommodation Fee', |
---|
[9755] | 39 | 'application': 'Application Fee', |
---|
| 40 | 'bed_allocation': 'Bed Allocation Fee', |
---|
| 41 | 'transfer': 'Transfer Fee', |
---|
[14296] | 42 | 'transcript_local': 'Local Transcript Fee', |
---|
| 43 | 'transcript_inter': 'International Transcript Fee', |
---|
[13035] | 44 | 'late_registration': 'Late Course Registration Fee', |
---|
[13402] | 45 | 'welfare': 'Student Welfare Assurance Fee', |
---|
[13463] | 46 | 'union': 'Student Union Dues', |
---|
[13402] | 47 | 'lapel': 'Lapel/File Fee', |
---|
[13374] | 48 | 'matric_gown': 'Matriculation Gown Fee', |
---|
| 49 | 'concessional': 'Concessional Fee', |
---|
[14234] | 50 | 'id_card': 'Student ID Card', |
---|
[14258] | 51 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
| 52 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
| 53 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
| 54 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
| 55 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
| 56 | 'gst_registration_2': 'Registration Fee GST222', |
---|
| 57 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
[14248] | 58 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
[9755] | 59 | } |
---|
| 60 | |
---|
| 61 | SELECTABLE_PAYMENT_CATEGORIES = { |
---|
[13435] | 62 | 'schoolfee': 'School Fee without additional fees', |
---|
[13512] | 63 | 'schoolfee_1': 'School Fee (1st instalment) + Student Union Dues + Welfare Assurance Fee', |
---|
| 64 | 'schoolfee_2': 'School Fee (2nd instalment)', |
---|
[13463] | 65 | 'schoolfee_incl': 'School Fee + Student Union Dues + Welfare Assurance Fee', |
---|
[13435] | 66 | 'clearance': 'Acceptance Fee without additional fees', |
---|
[14239] | 67 | 'clearance_incl': 'Acceptance Fee + Matric Gown Fee + Lapel/File Fee', |
---|
[13454] | 68 | 'hostel_maintenance': 'Hostel Accommodation Fee', |
---|
[14243] | 69 | #'application': 'Application Fee', |
---|
[11621] | 70 | #'bed_allocation': 'Bed Allocation Fee', |
---|
| 71 | #'transfer': 'Transfer Fee', |
---|
[14296] | 72 | 'transcript_local': 'Local Transcript Fee', |
---|
| 73 | 'transcript_inter': 'International Transcript Fee', |
---|
[13035] | 74 | 'late_registration': 'Late Course Registration Fee', |
---|
[14243] | 75 | #'welfare': 'Student Welfare Assurance Fee', |
---|
| 76 | #'union': 'Student Union Dues', |
---|
| 77 | #'lapel': 'Lapel/File Fee', |
---|
| 78 | #'matric_gown': 'Matriculation Gown Fee', |
---|
[13374] | 79 | 'concessional': 'Concessional Fee', |
---|
[14243] | 80 | #'id_card': 'Student ID Card', |
---|
[14258] | 81 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
| 82 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
| 83 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
| 84 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
| 85 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
| 86 | 'gst_registration_2': 'Registration Fee GST222', |
---|
| 87 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
[14248] | 88 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
[9755] | 89 | } |
---|
| 90 | |
---|
[13451] | 91 | REPORTABLE_PAYMENT_CATEGORIES = { |
---|
| 92 | 'schoolfee': 'School Fee', |
---|
[13452] | 93 | 'schoolfee_incl': 'School Fee Plus', |
---|
[13635] | 94 | 'schoolfee_1': 'School Fee 1 Plus', |
---|
| 95 | 'schoolfee_2': 'School Fee 2', |
---|
[13451] | 96 | 'clearance': 'Acceptance Fee', |
---|
[13452] | 97 | 'clearance_incl': 'Acceptance Fee Plus', |
---|
[13451] | 98 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
| 99 | } |
---|
| 100 | |
---|
[13638] | 101 | BALANCE_PAYMENT_CATEGORIES = { |
---|
| 102 | 'schoolfee': 'School Fee', |
---|
| 103 | 'clearance': 'Acceptance Fee', |
---|
| 104 | 'hostel_maintenance': 'Hostel Maintenance Fee', |
---|
[13750] | 105 | 'late_registration': 'Late Course Registration Fee', |
---|
| 106 | 'welfare': 'Student Welfare Assurance Fee', |
---|
| 107 | 'union': 'Student Union Dues', |
---|
| 108 | 'lapel': 'Lapel/File Fee', |
---|
| 109 | 'matric_gown': 'Matriculation Gown Fee', |
---|
[14234] | 110 | 'id_card': 'Student ID Card', |
---|
[14258] | 111 | 'gst_text_book_1': 'Text Book Fee GST101 GST102', |
---|
| 112 | 'gst_text_book_2': 'Text Book Fee GST111 GST112', |
---|
| 113 | 'gst_text_book_3': 'Text Book Fee GST222', |
---|
| 114 | 'ent_text_book_4': 'Text Book Fee ENT201', |
---|
| 115 | 'gst_registration_1': 'Registration Fee GST101 GST102 GST111 GST112', |
---|
| 116 | 'gst_registration_2': 'Registration Fee GST222', |
---|
| 117 | 'ent_registration_3': 'Registration Fee ENT201', |
---|
[14248] | 118 | 'fac_dep': 'Faculty and Departmental Dues', |
---|
[13638] | 119 | } |
---|
| 120 | |
---|
[10304] | 121 | APP_CATS_DICT = { |
---|
| 122 | 'basic': 'PUTME, PUDE, PCE, PRENCE', |
---|
| 123 | 'no': 'No Application', |
---|
| 124 | 'pg_ft': 'Postgraduate Full-Time', |
---|
| 125 | 'pg_pt': 'Postgraduate Part-Time', |
---|
| 126 | 'cest': 'Part-Time, Diploma, Certificate', |
---|
| 127 | 'found': 'Foundation', |
---|
[10893] | 128 | 'ptee': 'Part-Time Entrance Examination', |
---|
[13568] | 129 | 'ioe_dp': 'Institute of Education Diploma', |
---|
[10304] | 130 | } |
---|
| 131 | |
---|
[11591] | 132 | STUDY_MODES_DICT = { |
---|
| 133 | 'ug_ft': 'Undergraduate Full Time', |
---|
| 134 | 'ug_pt': 'Undergraduate Part Time', |
---|
[11593] | 135 | 'de_ft': 'Direct Entry Full Time', |
---|
| 136 | 'de_pt': 'Direct Entry Part Time', |
---|
[11591] | 137 | 'dp_pt': 'Diploma Part Time', |
---|
| 138 | 'dp_ft': 'Diploma Full Time', |
---|
[13524] | 139 | 'special_pg_ft': 'Postgraduate Full Time', |
---|
| 140 | 'special_pg_pt': 'Postgraduate Part Time', |
---|
[11591] | 141 | 'found': 'Foundation', |
---|
[13498] | 142 | 'transfer': 'Transfer', |
---|
[13749] | 143 | 'mug_ft': 'Undergraduate Full Time Merit List', |
---|
| 144 | 'mde_ft': 'Direct Entry Full Time Merit List', |
---|
[11591] | 145 | } |
---|
| 146 | |
---|
[13127] | 147 | VERDICTS_DICT = { |
---|
| 148 | '0': 'not yet', |
---|
| 149 | 'A': 'Successful student', |
---|
| 150 | 'B': 'Student with carryover courses', |
---|
| 151 | 'C': 'Student on probation', |
---|
| 152 | #'D': 'Withdrawn from the faculty', |
---|
| 153 | #'E': 'Student who were previously on probation', |
---|
| 154 | #'F': 'Medical case', |
---|
| 155 | #'G': 'Absent from examination', |
---|
| 156 | #'H': 'Withheld results', |
---|
| 157 | #'I': 'Expelled/rusticated/suspended student', |
---|
| 158 | #'J': 'Temporary withdrawn from the university', |
---|
| 159 | #'K': 'Unregistered student', |
---|
| 160 | #'L': 'Referred student', |
---|
| 161 | #'M': 'Reinstatement', |
---|
| 162 | #'N': 'Student on transfer', |
---|
| 163 | #'O': 'NCE-III repeater', |
---|
| 164 | #'Y': 'No previous verdict', |
---|
| 165 | #'X': 'New 300 level student', |
---|
| 166 | 'Z': 'Successful student (provisional)', |
---|
| 167 | #'A1': 'First Class', |
---|
| 168 | #'A2': 'Second Class Upper', |
---|
| 169 | #'A3': 'Second Class Lower', |
---|
| 170 | #'A4': 'Third Class', |
---|
| 171 | #'A5': 'Pass', |
---|
| 172 | #'A6': 'Distinction', |
---|
| 173 | #'A7': 'Credit', |
---|
| 174 | #'A8': 'Merit', |
---|
| 175 | 'NEOR': 'No evidence of registration', |
---|
| 176 | 'NEOV': 'No evidence of verification', |
---|
| 177 | 'FRNS': 'Faculty requirements not satisfied', |
---|
| 178 | } |
---|
[13454] | 179 | |
---|
| 180 | DISABLE_PAYMENT_GROUP_DICT = { |
---|
| 181 | 'sf_all': 'School Fee - All Students', |
---|
[14246] | 182 | 'sf_pg': 'School Fee - Postgraduate Students', |
---|
| 183 | 'sf_pt': 'School Fee - Part-Time Students', |
---|
| 184 | 'sf_found': 'School Fee - Foundation Students', |
---|
[13454] | 185 | 'maint_all': 'Accommodation Fee - All Students', |
---|
[13794] | 186 | 'cl_regular': 'Acceptance Fee - Regular Students', |
---|
[13454] | 187 | } |
---|
[13870] | 188 | |
---|
| 189 | MODE_GROUPS = { |
---|
| 190 | 'All': ('all',), |
---|
| 191 | 'Undergraduate Full-Time': ('ug_ft', 'mde_ft', 'mug_ft', 'de_ft'), |
---|
| 192 | 'Undergraduate Part-Time': ('ug_pt', 'de_pt'), |
---|
| 193 | 'Postgraduate': ('pg_ft','special_pg_ft', 'special_pg_pt'), |
---|
| 194 | 'Foundation Programme': ('found',), |
---|
| 195 | 'Institute of Education': ('dp_ft'), |
---|
| 196 | } |
---|
[13963] | 197 | |
---|
| 198 | def fullname(self, firstname, lastname, middlename=None): |
---|
| 199 | """Construct fullname. |
---|
| 200 | """ |
---|
| 201 | try: |
---|
| 202 | lastname = lastname.upper() |
---|
| 203 | except AttributeError: |
---|
| 204 | pass |
---|
| 205 | # We do not necessarily have the middlename attribute |
---|
| 206 | if middlename: |
---|
| 207 | givennames = '%s %s' % (firstname, middlename) |
---|
| 208 | else: |
---|
| 209 | givennames = '%s' % firstname |
---|
| 210 | givennames = string.capwords( |
---|
| 211 | givennames.replace('-', ' - ')).replace(' - ', '-') |
---|
| 212 | fullname = '%s, %s' % (lastname, givennames) |
---|
| 213 | if '<' in fullname: |
---|
| 214 | return 'XXX' |
---|
| 215 | return fullname |
---|