source: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/interfaces.py @ 17939

Last change on this file since 17939 was 13739, checked in by Henrik Bettermann, 9 years ago

Show certificate-specific p_level value on payment pages.

  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1## $Id: interfaces.py 13739 2016-02-26 08:22:48Z 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
19from zope import schema
20from waeup.kofa.students.vocabularies import StudyLevelSource
21from kofacustom.nigeria.students.interfaces import (
22    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
23    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
24    INigeriaStudentStudyCourse, INigeriaCourseTicket,
25    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
26    )
27from waeup.kwarapoly.payments.interfaces import ICustomOnlinePayment
28from waeup.kwarapoly.interfaces import MessageFactory as _
29
30class ICustomStudentBase(INigeriaStudentBase):
31    """Representation of student base data.
32
33    """
34
35class ICustomStudentPersonal(INigeriaStudentPersonal):
36    """Student personal data.
37
38    """
39
40    perm_address = schema.Text(
41        title = _(u'Home Address'),
42        required = False,
43        )
44
45    corr_address = schema.Text(
46        title = _(u'Correspondence Address'),
47        required = False,
48        )
49
50    sponsor_name = schema.TextLine(
51        title = _(u'Sponsor\'s Name'),
52        required = False,
53        readonly = False,
54        )
55
56    sponsor_address = schema.Text(
57        title = _(u'Sponsor\'s Address'),
58        required = False,
59        readonly = False,
60        )
61
62class ICustomStudentPersonalEdit(ICustomStudentPersonal):
63    """Interface for editing personal data by students.
64
65    Here we can repeat the fields from IStudentPersonal and set the
66    `required` if necessary.
67    """
68
69    perm_address = schema.Text(
70        title = _(u'Home Address'),
71        required = True,
72        )
73
74    corr_address = schema.Text(
75        title = _(u'Correspondence Address'),
76        required = True,
77        )
78
79    sponsor_name = schema.TextLine(
80        title = _(u'Sponsor\'s Name'),
81        required = False,
82        readonly = False,
83        )
84
85    sponsor_address = schema.Text(
86        title = _(u'Sponsor\'s Address'),
87        required = False,
88        readonly = False,
89        )
90
91class ICustomUGStudentClearance(INigeriaUGStudentClearance):
92    """Representation of ug student clearance data.
93
94    """
95
96    fst_sit_pin = schema.TextLine(
97        title = _(u'Result Checking PIN'),
98        required = False,
99        readonly = False,
100        )
101
102    fst_sit_pin_serial = schema.TextLine(
103        title = _(u'PIN Serial Number'),
104        required = False,
105        readonly = False,
106        )
107
108    scd_sit_pin = schema.TextLine(
109        title = _(u'Result Checking PIN'),
110        required = False,
111        readonly = False,
112        )
113
114    scd_sit_pin_serial = schema.TextLine(
115        title = _(u'PIN Serial Number'),
116        required = False,
117        readonly = False,
118        )
119
120ICustomUGStudentClearance['fst_sit_pin'].order = ICustomUGStudentClearance[
121    'fst_sit_results'].order
122ICustomUGStudentClearance['fst_sit_pin_serial'].order = ICustomUGStudentClearance[
123    'fst_sit_results'].order
124ICustomUGStudentClearance['scd_sit_pin'].order = ICustomUGStudentClearance[
125    'scd_sit_results'].order
126ICustomUGStudentClearance['scd_sit_pin_serial'].order = ICustomUGStudentClearance[
127    'scd_sit_results'].order
128
129
130class ICustomPGStudentClearance(INigeriaPGStudentClearance):
131    """Representation of pg student clearance data.
132
133    """
134
135
136class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
137    ICustomPGStudentClearance,ICustomStudentPersonal):
138    """Representation of a student.
139
140    """
141
142class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
143    """A container for student study levels.
144
145    """
146
147class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
148    """A container for course tickets.
149
150    """
151
152class ICustomStudentOnlinePayment(ICustomOnlinePayment):
153    """A student payment via payment gateways.
154
155    This Interface does not inherit from IStudentOnlinePayment.
156    Thus all fields from IStudentOnlinePayment have to be repeated here.
157    """
158
159    p_current = schema.Bool(
160        title = _(u'Current Session Payment'),
161        default = True,
162        required = False,
163        )
164
165    p_level = schema.Choice(
166        title = _(u'Payment Level'),
167        source = StudyLevelSource(),
168        required = False,
169        )
170
171ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
172    'p_session'].order
173
174class ICustomCourseTicket(INigeriaCourseTicket):
175    """A course ticket.
176
177    """
178
179class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
180    """Representation of a student. Skip regular reg_number validation.
181
182    """
183
184class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
185    """Representation of a student. Skip regular matric_number validation.
186
187    """
Note: See TracBrowser for help on using the repository browser.