source: main/waeup.uniben/trunk/src/waeup/uniben/interfaces.py @ 8253

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

ICustomStudentOnlinePayment defines the context.

  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1## $Id: interfaces.py 8253 2012-04-22 20:06:50Z 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
19import zope.i18nmessageid
20from zope import schema
21from waeup.kofa.interfaces import (SimpleKofaVocabulary,
22    ISessionConfiguration, academic_sessions_vocab)
23from waeup.uniben.utils.lgas import LGAS
24
25_ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.uniben')
26
27high_qual = SimpleKofaVocabulary(
28    ('National Certificate of Education','nce'),
29    ('Pre Degree Programme','pre'),
30    ('Diploma Programme','dip'),
31    ('Ordinary National Diploma','ond'),
32    ('Bachelors Degree','bd'),
33    ('Masters Degree','md'),
34    ('Professional Qualification','pq'),
35    ('Other Certification','oc'),
36    ('Higher National Diploma','hnd'),
37    ('NCE AL OTH','nce_al_oth'),
38    ('National Defence Academy','nda'),
39    ('Awaiting Results','a_rslt'),
40    ('RMC','rmc'),
41    )
42
43high_grade = SimpleKofaVocabulary(
44    ('Upper Credit','upper_credit'),
45    ('Distinction','distinction'),
46    ('Credit','credit'),
47    ('Merit','merit'),
48    ('Lower Credit','lower_credit'),
49    ('First Class','first_class'),
50    ('Second Class Upper','second_class_upper'),
51    ('Second Class Lower','second_class_lower'),
52    ('Third Class','third_class'),
53    ('Pass','pass'),
54    ('Awaiting Results','a_rslt'),
55    ('A Levels','al'),
56    )
57
58exam_types = SimpleKofaVocabulary(
59    ('SSCE','ssce'),
60    ('WAEC','waec'),
61    ('GCE O\' LEVEL','gce_o_level'),
62    ('TC II','tc_ii'),
63    ('RSA','rsa'),
64    ('NABTEB','nabteb'),
65    ('NECO','neco'),
66    ('ACE','ace'),
67    ('GCE A\' LEVEL','gce_a_level'),
68    ('IGCSE','igcse'),
69    )
70
71
72lgas_vocab = SimpleKofaVocabulary(
73    *sorted([(x[1],x[0]) for x in LGAS]))
74
75# It's recommended to replicate all fields from the base package here.
76class ICustomSessionConfiguration(ISessionConfiguration):
77    """A session configuration object.
78    """
79
80    # Base fees, do not remove.
81
82    school_fee_base = schema.Float(
83        title = _(u'School Fee (ignored)'),
84        default = 0.0,
85        required = False,
86        )
87
88    surcharge_1 = schema.Float(
89        title = _(u'Surcharge Portal Provider'),
90        default = 0.0,
91        required = False,
92        )
93
94    surcharge_2 = schema.Float(
95        title = _(u'Surcharge Interswitch'),
96        default = 0.0,
97        required = False,
98        )
99
100    surcharge_3 = schema.Float(
101        title = _(u'Surcharge 3'),
102        default = 0.0,
103        required = False,
104        )
105
106    clearance_fee = schema.Float(
107        title = _(u'Clearance Fee'),
108        default = 0.0,
109        required = False,
110        )
111
112    booking_fee = schema.Float(
113        title = _(u'Booking Fee'),
114        default = 0.0,
115        required = False,
116        )
117
118    acceptance_fee = schema.Float(
119        title = _(u'Acceptance Fee'),
120        default = 0.0,
121        required = False,
122        )
123
124    # Additional fees in waeup.uniben
125
126    maint_fee = schema.Float(
127        title = _(u'Maintenance Fee'),
128        default = 0.0,
129        required = False,
130        )
131
132    gown = schema.Float(
133        title = _(u'Gown Fee'),
134        default = 0.0,
135        required = False,
136        )
137
138    transfer = schema.Float(
139        title = _(u'Transfer Fee'),
140        default = 0.0,
141        required = False,
142        )
143
144    def getSessionString():
145        """Returns the session string from the vocabulary.
146        """
147
148
149class ICustomSessionConfigurationAdd(ICustomSessionConfiguration):
150    """A session configuration object in add mode.
151    """
152
153    academic_session = schema.Choice(
154        title = _(u'Academic Session'),
155        source = academic_sessions_vocab,
156        default = None,
157        required = True,
158        readonly = False,
159        )
160
161ICustomSessionConfigurationAdd[
162    'academic_session'].order =  ICustomSessionConfiguration[
163    'academic_session'].order
Note: See TracBrowser for help on using the repository browser.