source: main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py @ 13353

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

Extend personal data form and force student to fill the form.

  • Property svn:keywords set to Id
File size: 7.0 KB
Line 
1## $Id: interfaces.py 13351 2015-10-26 17:18:16Z 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 zc.sourcefactory.contextual import BasicContextualSourceFactory
21from zope.catalog.interfaces import ICatalog
22from zope.component import getUtility
23from waeup.kofa.interfaces import IKofaObject
24from waeup.kofa.schema import PhoneNumber
25from kofacustom.nigeria.students.interfaces import (
26    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
27    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
28    INigeriaStudentStudyCourse, INigeriaCourseTicket,
29    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
30    )
31from waeup.aaue.payments.interfaces import ICustomOnlinePayment
32from waeup.aaue.interfaces import MessageFactory as _
33
34class ICustomStudentBase(INigeriaStudentBase):
35    """Representation of student base data.
36
37    """
38
39class ICustomStudentPersonal(INigeriaStudentPersonal):
40    """Student personal data.
41
42    """
43
44    father_name = schema.TextLine(
45        title = _(u'Father\'s Name'),
46        required = False,
47        readonly = False,
48        )
49
50    father_address = schema.Text(
51        title = _(u'Father\'s Permanent Address'),
52        required = False,
53        readonly = False,
54        )
55
56    father_work = schema.TextLine(
57        title = _(u'Father\'s Place of Work'),
58        required = False,
59        readonly = False,
60        )
61
62    father_phone = PhoneNumber(
63        title = _(u'Father\'s Phone'),
64        required = False,
65        readonly = False,
66        )
67
68    mother_name = schema.TextLine(
69        title = _(u'Mother\'s Name'),
70        required = False,
71        readonly = False,
72        )
73
74    mother_address = schema.Text(
75        title = _(u'Mother\'s Permanent Address'),
76        required = False,
77        readonly = False,
78        )
79
80    mother_work = schema.TextLine(
81        title = _(u'Mother\'s Place of Work'),
82        required = False,
83        readonly = False,
84        )
85
86    mother_phone = PhoneNumber(
87        title = _(u'Mother\'s Phone'),
88        required = False,
89        readonly = False,
90        )
91
92    phone_personal = PhoneNumber(
93        title = _(u'Student\'s Personal Phone'),
94        description = u'',
95        required = True,
96        readonly = False,
97        )
98
99class ICustomStudentPersonalEdit(ICustomStudentPersonal):
100    """Interface for editing personal data by students.
101
102    Here we can repeat the fields from IStudentPersonal and set the
103    `required` if necessary.
104    """
105
106    perm_address = schema.Text(
107        title = _(u'Permanent Address'),
108        required = True,
109        )
110
111    next_kin_name = schema.TextLine(
112        title = _(u'Next of Kin Name'),
113        required = True,
114        readonly = False,
115        )
116
117    next_kin_relation = schema.TextLine(
118        title = _(u'Next of Kin Relationship'),
119        required = True,
120        readonly = False,
121        )
122
123    next_kin_address = schema.Text(
124        title = _(u'Next of Kin Address'),
125        required = True,
126        readonly = False,
127        )
128
129    next_kin_phone = PhoneNumber(
130        title = _(u'Next of Kin Phone'),
131        description = u'',
132        required = True,
133        readonly = False,
134        )
135
136    father_name = schema.TextLine(
137        title = _(u'Father\'s Name'),
138        required = True,
139        readonly = False,
140        )
141
142    father_address = schema.Text(
143        title = _(u'Father\'s Permanent Address'),
144        required = True,
145        readonly = False,
146        )
147
148    father_work = schema.TextLine(
149        title = _(u'Father\'s Place of Work'),
150        required = True,
151        readonly = False,
152        )
153
154    father_phone = PhoneNumber(
155        title = _(u'Father\'s Phone'),
156        required = True,
157        readonly = False,
158        )
159
160    mother_name = schema.TextLine(
161        title = _(u'Mother\'s Name'),
162        required = True,
163        readonly = False,
164        )
165
166    mother_address = schema.Text(
167        title = _(u'Mother\'s Permanent Address'),
168        required = True,
169        readonly = False,
170        )
171
172    mother_work = schema.TextLine(
173        title = _(u'Mother\'s Place of Work'),
174        required = True,
175        readonly = False,
176        )
177
178    mother_phone = PhoneNumber(
179        title = _(u'Mother\'s Phone'),
180        required = True,
181        readonly = False,
182        )
183
184    phone_personal = PhoneNumber(
185        title = _(u'Student\'s Personal Phone'),
186        description = u'',
187        required = True,
188        readonly = False,
189        )
190
191class ICustomUGStudentClearance(INigeriaUGStudentClearance):
192    """Representation of ug student clearance data.
193
194    """
195
196class ICustomPGStudentClearance(INigeriaPGStudentClearance):
197    """Representation of pg student clearance data.
198
199    """
200
201
202class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
203    ICustomPGStudentClearance,ICustomStudentPersonal):
204    """Representation of a student.
205
206    """
207
208class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
209    """A container for student study levels.
210
211    """
212
213class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
214    """A container for course tickets.
215
216    """
217
218    total_credits_s1 = schema.Int(
219        title = _(u'1st Semester Units'),
220        required = False,
221        readonly = True,
222        )
223
224    total_credits_s2 = schema.Int(
225        title = _(u'2nd Semester Units'),
226        required = False,
227        readonly = True,
228        )
229
230    total_credits = schema.Int(
231        title = _(u'Total Units'),
232        required = False,
233        readonly = True,
234        )
235
236class ICustomStudentOnlinePayment(ICustomOnlinePayment):
237    """A student payment via payment gateways.
238
239    This Interface does not inherit from IStudentOnlinePayment.
240    Thus all fields from IStudentOnlinePayment have to be repeated here.
241    """
242
243    p_current = schema.Bool(
244        title = _(u'Current Session Payment'),
245        default = True,
246        required = False,
247        )
248
249    p_level = schema.Int(
250        title = _(u'Payment Level'),
251        required = False,
252        )
253
254ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
255    'p_session'].order
256
257class ICustomCourseTicket(INigeriaCourseTicket):
258    """A course ticket.
259
260    """
261
262class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
263    """Representation of a student. Skip regular reg_number validation.
264
265    """
266
267class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
268    """Representation of a student. Skip regular matric_number validation.
269
270    """
Note: See TracBrowser for help on using the repository browser.