source: main/waeup.uniben/trunk/src/waeup/uniben/utils/utils.py @ 8259

Last change on this file since 8259 was 8247, checked in by Henrik Bettermann, 13 years ago

Reorganize payment customizatiom. Tests will follow.

Let also applicants pay via eTranzact. Show transaction code on display view (slip view will follow).

  • Property svn:keywords set to Id
File size: 7.3 KB
Line 
1## $Id: utils.py 8247 2012-04-22 12:56: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"""
20import os
21import pytz
22from waeup.kofa.utils.utils import KofaUtils, sorted_phone_prefixes
23from waeup.uniben.interfaces import MessageFactory as _
24
25INT_PHONE_PREFIXES = [
26    (1, _('Nigeria'), '234'),
27    (99, _('Germany'), '49'),
28    (99, _('United States'), '1'),
29    (99, _('Niger'), '227'),
30    (99, _('Benin'), '229'),
31    (99, _('Cameroon'), '237'),
32    (99, _('United Kingdom'), '44'),
33    (99, _('France'), '33'),
34    ]
35
36class KofaUtils(KofaUtils):
37    """A collection of methods subject to customization.
38    """
39    PORTAL_LANGUAGE = 'en'
40
41    # We do not dosplay the language selector at the moment.
42    PREFERRED_LANGUAGES_DICT = {
43        }
44
45    #: A function to return
46    @classmethod
47    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
48        return sorted_phone_prefixes(data, request)
49
50    EXAM_SUBJECTS_DICT = {
51        'accounts': 'Accounts',
52        'add_general_science': 'Add General Science',
53        'add_maths': 'Add Maths',
54        'adv_elect_install_maint': 'Adv. Electrical Installation and Maintenance',
55        'agricultural_science': 'Agricultural Science',
56        'applied_electricity': 'Applied Electricity',
57        'arabi': 'Arabic',
58        'arithmetics': 'Arithmetics',
59        'art': 'Art',
60        'auto_mechanics': 'Auto Mechanics',
61        'basic_electricity': 'Basic Electricity',
62        'bible_knowledge': 'Bible Knowledge',
63        'biology': 'Biology',
64        'biology_alt_syl': 'Biology (Alt.Syl)',
65        'book_keeping': 'Book Keeping',
66        'building_construction': 'Building Construction',
67        'business_management': 'Business Management',
68        'business_construction_management': 'Business/Construction Management (Adv)',
69        'chemistry': 'Chemistry',
70        'chemistry_alt_syl': 'Chemistry (Alt.Syl)',
71        'christian_religious_studies': 'Christian Religious Studies',
72        'clerical_office_duties': 'Clerical Office Duties',
73        'clothing_and_textiles': 'Clothing and Textiles',
74        'commerce': 'Commerce',
75        'economics': 'Economics',
76        'education': 'Education',
77        'efik': 'Efik',
78        'electronics': 'Electronics',
79        'elementary_surveying': 'Elementary Surveying',
80        'english_language': 'English Language',
81        'engineering_science': 'Engineering Science',
82        'financial_accounting': 'Financial Accounting',
83        'food_and_nutrition': 'Food and Nutrition',
84        'french': 'French',
85        'further_mathematics': 'Further Mathematics',
86        'general_science': 'General Science',
87        'geography': 'Geography',
88        'german': 'German',
89        'government': 'Government',
90        'hausa': 'Hausa',
91        'hausa_literature': 'Hausa Literature',
92        'health_science': 'Health Science',
93        'history': 'History',
94        'home_management': 'Home Management',
95        'industrial_electrical_installation': 'Industrial Elect Installation (Adv)',
96        'intergrated_science': 'Intergrated Science',
97        'islamic_studies': 'Islamic Studies',
98        'literature_in_english': 'Literature in English',
99        'literature_in_nigerian_languages': 'Literature in Nigerian Languages',
100        'igbo': 'Igbo',
101        'igbo_literature': 'Igbo Literature',
102        'yoruba': 'Yoruba',
103        'yoruba_literature': 'Yoruba Literature',
104        'management_in_living': 'Management in Living',
105        'mathematics': 'Mathematics',
106        'metalwork': 'Metalwork',
107        'music': 'Music',
108        'nigerian_language': 'Nigerian Language',
109        'office_practice': 'Office Practice',
110        'physical_education': 'Physical Education',
111        'physical_health_education': 'Physical and Health Education',
112        'physics': 'Physics',
113        'physics_alt_syl': 'Physics (Alt.Syl)',
114        'principles_of_cost_accounting': 'Principles of Cost Accounting',
115        'rural_science': 'Rural Science',
116        'science': 'Science',
117        'secretarial_duties': 'Secretarial Duties',
118        'shorthand': 'Shorthand',
119        'sierra_leone_studies': 'Sierra Leone Studies',
120        'sierra_leone_languages': 'Sierra Leone Languages',
121        'social_studies': 'Social Studies',
122        'statistics': 'Statistics',
123        'teaching_practice': 'Teaching Practice',
124        'technical_drawing': 'Technical Drawing',
125        'typewriting': 'Typewriting',
126        'visual_art': 'Visual Art',
127        'woodwork': 'Woodwork',
128        'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc'
129        }
130
131    EXAM_GRADES = (
132        ('A1', 'Excellent (A1)'),
133        ('A2', 'Very Good (A2)'),
134        ('A3', 'Good (A3)'),
135        ('B2', 'Very Good (B2)'),
136        ('B3', 'Good (B3)'),
137        ('C4', 'Credit (C4)'),
138        ('C5', 'Credit (C5)'),
139        ('C6', 'Credit (C6)'),
140        ('A', 'Pass (A)'),
141        ('B', 'Pass (B)'),
142        ('C', 'Pass (C)'),
143        ('U', 'Pass (U)'),
144        ('D7', 'Pass (D7)'),
145        ('P7', 'Pass (P7)'),
146        ('P8', 'Pass (P8)'),
147        ('E8', 'Pass (E8)'),
148        ('F9', 'Fail (F9)'),
149        ('Aa', 'A (a)'),
150        ('Bb', 'B (b)'),
151        ('Cc', 'C (c)'),
152        ('Dd', 'D (d)'),
153        ('Ee', 'E (e)'),
154        ('Ff', 'F (f)'),
155        ('Gg', 'G (g)')
156        )
157
158    INST_TYPES_DICT = {
159        'none': '',
160        'faculty': 'Faculty of',
161        'department': 'Department of',
162        'school': 'School of',
163        'office': 'Office for',
164        'centre': 'Centre for',
165        'institute': 'Institute of',
166        'school_for': 'School for',
167        'college': 'College of',
168        }
169
170    STUDY_MODES_DICT = {
171        'rmd_ft': 'Remedial with deficiencies',
172        'dp_pt': 'Diploma Part Time',
173        'ct_ft': 'Certificate Full Time',
174        'dp_ft': 'Diploma Full Time',
175        'de_pt': 'Direct Entry Part Time',
176        'pg_ft': 'Postgraduate Full Time',
177        'pg_pt': 'Postgraduate Part Time',
178        'jm_ft': 'Joint Matriculation Full Time',
179        'ume_ft': 'UME Full Time',
180        'de_ft': 'Direct Entry Full Time',
181        'ph_ft': 'Post Higher Education Full Time',
182        'transfer_pt': 'Transfer Part Time',
183        'ug_pt': 'Undergraduate Part Time',
184        'transfer_ft': 'Transfer Full Time',
185        'ct_pt': 'Certificate Part Time',
186        'ug_ft': 'Undergraduate Full Time',
187        'rm_ft': 'Remedial'
188        }
189
190    APP_CATS_DICT = {
191        'basic': 'PUME, PDE, PCE, PRENCE',
192        'no': 'no application',
193        'pg_ft': 'Postgraduate Full-Time',
194        'pg_pt': 'Postgraduate Part-Time',
195        'sandwich': 'Sandwich',
196        'cest': 'Part-Time, Diploma, Certificate'
197        }
198
199    @property
200    def tzinfo(self):
201        return pytz.timezone('Africa/Lagos')
Note: See TracBrowser for help on using the repository browser.