source: main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py @ 15880

Last change on this file since 15880 was 15880, checked in by Henrik Bettermann, 5 years ago

Add LetterPDFCreator utility and use this pdf creator
for admission slips. letterhead_admission.jpg file
must exist in students/static.

  • Property svn:keywords set to Id
File size: 28.0 KB
Line 
1## $Id: interfaces.py 15880 2019-12-11 12:02:09Z 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#from datetime import datetime
19from zope.component import getUtility
20from zope.interface import Attribute, Interface, invariant, Invalid
21from zope import schema
22from zc.sourcefactory.contextual import BasicContextualSourceFactory
23from waeup.kofa.browser.interfaces import IStudentNavigationBase
24from waeup.kofa.interfaces import (
25    IKofaObject, academic_sessions_vocab, validate_email, ICSVExporter,
26    ContextualDictSourceFactoryBase, IKofaUtils)
27from waeup.kofa.interfaces import MessageFactory as _
28from waeup.kofa.schema import TextLineChoice, FormattedDate, PhoneNumber
29from waeup.kofa.students.vocabularies import (
30    StudyLevelSource, contextual_reg_num_source, contextual_mat_num_source,
31    GenderSource, nats_vocab
32    )
33from waeup.kofa.payments.interfaces import (
34    IPaymentsContainer, IOnlinePayment)
35from waeup.kofa.university.vocabularies import (
36    CourseSource, StudyModeSource, CertificateSource,
37    SemesterSource, CourseCategorySource
38    )
39
40class PreviousPaymentCategorySource(ContextualDictSourceFactoryBase):
41    """A source that delivers all selectable categories of previous session
42    payments.
43    """
44    #: name of dict to deliver from kofa utils.
45    DICT_NAME = 'PREVIOUS_PAYMENT_CATEGORIES'
46
47class BalancePaymentCategorySource(ContextualDictSourceFactoryBase):
48    """A source that delivers all selectable items of balance payments.
49    """
50    #: name of dict to deliver from kofa utils.
51    DICT_NAME = 'BALANCE_PAYMENT_CATEGORIES'
52
53# VerdictSource can't be placed into the vocabularies module because it
54# requires importing IStudentsUtils which then leads to circular imports.
55class VerdictSource(BasicContextualSourceFactory):
56    """A verdicts source delivers all verdicts provided
57    in the portal.
58    """
59    def getValues(self, context):
60        verdicts_dict = getUtility(IKofaUtils).VERDICTS_DICT
61        return sorted(verdicts_dict.keys())
62
63    def getToken(self, context, value):
64        return value
65
66    def getTitle(self, context, value):
67        verdicts_dict = getUtility(IKofaUtils).VERDICTS_DICT
68        if value != '0':
69            return verdicts_dict[value] + ' (%s)' % value
70        return verdicts_dict[value]
71
72
73class IStudentsUtils(Interface):
74    """A collection of methods which are subject to customization.
75    """
76    def setReturningData(student):
77        """ This method defines what happens after school fee payment
78        depending on the student's senate verdict.
79
80        In the base configuration current level is always increased
81        by 100 no matter which verdict has been assigned.
82        """
83
84    def setPaymentDetails(category, student, previous_session=None,
85            previous_level=None, combi=None):
86        """Create Payment object and set the payment data of a student for
87        the payment category specified.
88        """
89
90    def increaseMatricInteger(student):
91        """Increase counter for matric numbers.
92
93        This counter can be a centrally stored attribute or an attribute of
94        faculties, departments or certificates. In the base package the counter
95        is as an attribute of the site configuration object.
96        """
97
98    def constructMatricNumber(student):
99        """Fetch the matric number counter which fits the student and
100        construct the new matric number of the student.
101
102        In the base package the counter is returned which is as an attribute
103        of the site configuration object.
104        """
105
106    def setMatricNumber(student):
107        """Set matriculation number of student.
108
109        If the student's matric number is unset a new matric number is
110        constructed according to the matriculation number construction rules
111        defined in the constructMatricNumber method. The new matric number is
112        set, the students catalog updated. The corresponding matric number
113        counter is increased by one.
114
115        This method is tested but not used in the base package. It can
116        be used in custom packages by adding respective views
117        and by customizing increaseMatricInteger and constructMatricNumber
118        according to the university's matriculation number construction rules.
119
120        The method can be disabled by setting the counter to zero.
121        """
122
123    def getAccommodation_details(student):
124        """Determine the accommodation dates of a student.
125        """
126
127    def selectBed(available_beds):
128        """Select a bed from a list of available beds.
129        In the standard configuration we select the first bed found,
130        but can also randomize the selection if we like.
131        """
132
133    def getDegreeClassNumber(level_obj):
134        """Get degree class number (used for SessionResultsPresentation
135        reports).
136        """
137
138    def getPDFCreator(context):
139        """Get some IPDFCreator instance suitable for use with `context`.
140        """
141
142    def renderPDF(view, subject='', filename='slip.pdf',):
143        """Render pdf slips for various pages.
144        """
145
146    def renderPDFAdmissionLetter(view, student=None, omit_fields=(),
147                                 pre_text=None, post_text=None,
148                                 letterhead_path=None):
149        """Render pdf admission letter.
150        """
151
152    def renderPDFTranscript(view, filename, student,
153                  studentview, note, signatures, sigs_in_footer,
154                  show_scans, topMargin, omit_fields,
155                  tableheader, no_passport):
156        """Render pdf slip of a transcripts.
157        """
158
159    def renderPDFCourseticketsOverview(
160                  view, name, session, data, lecturers, orientation,
161                  title_length, note):
162        """Render pdf slip of course tickets for a lecturer.
163        """
164
165    def warnCreditsOOR(studylevel, course=None):
166        """Return message if credits are out of range. In the base
167        package only maximum credits is set.
168        """
169
170    def getBedCoordinates(bedticket):
171        """Return descriptive bed coordinates.
172        This method can be used to customize the `display_coordinates`
173        property method in order to  display a
174        customary description of the bed space.
175        """
176
177    def clearance_disabled_message(student):
178        """Render message if clearance is disabled.
179        """
180
181class IStudentsContainer(IKofaObject):
182    """A students container contains university students.
183    """
184    def addStudent(student):
185        """Add an IStudent object and subcontainers.
186        """
187
188    unique_student_id = Attribute('A unique student id')
189
190class IStudentNavigation(IStudentNavigationBase):
191    """Interface needed for navigation and logging. This interface is
192    implemented by all content classes in the students section.
193    """
194    student = Attribute('Student object of context')
195
196    def writeLogMessage(view, message):
197        """Add an INFO message to students.log.
198        """
199
200class IStudentBase(IKofaObject):
201    """Representation of student base data.
202    """
203    history = Attribute('Object history, a list of messages')
204    state = Attribute('Registration state')
205    translated_state = Attribute('Real name of the registration state')
206    certcode = Attribute('Certificate code of any chosen study course')
207    depcode = Attribute('Department code of any chosen study course')
208    faccode = Attribute('Faculty code of any chosen study course')
209    entry_session = Attribute('Entry session')
210    current_session = Attribute('Current session')
211    current_level = Attribute('Current level')
212    current_mode = Attribute('Current mode')
213    current_verdict = Attribute('Current verdict')
214    fullname = Attribute('All name parts separated by hyphens')
215    display_fullname = Attribute('Fullname as displayed on pages')
216    is_postgrad = Attribute('True if postgraduate student')
217    is_special_postgrad = Attribute('True if special postgraduate student')
218    is_fresh = Attribute('True if fresh student')
219    before_payment = Attribute('True if no previous payment has to be made')
220    personal_data_expired = Attribute('True if personal data expired')
221    transcript_enabled = Attribute('True if transcript processing is enabled')
222    clearance_locked = Attribute('True if clearance form is locked')
223    studycourse_locked = Attribute(
224        'True if nobody is allowed to change studycourse, studylecel or '
225        'course ticket data, neither through the UI nor via import')
226
227    password = Attribute('Encrypted password')
228    temp_password = Attribute('Dictionary with user name, timestamp and encrypted password')
229    parents_password = Attribute('Dictionary with student_id, timestamp and encrypted password')
230
231    suspended = schema.Bool(
232        title = _(u'Account suspended'),
233        default = False,
234        required = False,
235        )
236
237    suspended_comment = schema.Text(
238        title = _(u"Reasons for Deactivation"),
239        required = False,
240        description = _(
241            u'This message will be shown if and only if deactivated '
242            'students try to login.'),
243        )
244
245    flash_notice = schema.TextLine(
246        title = _(u'Flash Notice'),
247        required = False,
248        readonly = False,
249        description = _(
250            u'This single-line message will be shown in a flash box.'),
251        )
252
253    student_id = schema.TextLine(
254        title = _(u'Student Id'),
255        required = False,
256        )
257
258    firstname = schema.TextLine(
259        title = _(u'First Name'),
260        required = True,
261        )
262
263    middlename = schema.TextLine(
264        title = _(u'Middle Name'),
265        required = False,
266        )
267
268    lastname = schema.TextLine(
269        title = _(u'Last Name (Surname)'),
270        required = True,
271        )
272
273    sex = schema.Choice(
274        title = _(u'Gender'),
275        source = GenderSource(),
276        required = True,
277        )
278
279    reg_number = TextLineChoice(
280        title = _(u'Registration Number'),
281        required = True,
282        readonly = False,
283        source = contextual_reg_num_source,
284        )
285
286    matric_number = TextLineChoice(
287        title = _(u'Matriculation Number'),
288        required = False,
289        readonly = False,
290        source = contextual_mat_num_source,
291        )
292
293    adm_code = schema.TextLine(
294        title = _(u'PWD Activation Code'),
295        required = False,
296        readonly = False,
297        )
298
299    email = schema.ASCIILine(
300        title = _(u'Email'),
301        required = False,
302        constraint=validate_email,
303        )
304
305    phone = PhoneNumber(
306        title = _(u'Phone'),
307        required = False,
308        )
309
310    parents_email = schema.ASCIILine(
311        title = _(u"Parents' Email"),
312        required = False,
313        constraint=validate_email,
314        )
315
316    def setTempPassword(user, password):
317        """Set a temporary password (LDAP-compatible) SSHA encoded for
318        officers.
319        """
320
321    def getTempPassword():
322        """Check if a temporary password has been set and if it
323        is not expired. Return the temporary password if valid,
324        None otherwise. Unset the temporary password if expired.
325        """
326
327    def setParentsPassword(password):
328        """Set a parents password (LDAP-compatible) SSHA encoded for
329        parents.
330        """
331
332    def getParentsPassword():
333        """Check if a parents password has been set and if it
334        is not expired.
335
336        Return the parents password if valid,
337        None otherwise. Unset the parents password if expired.
338        """
339
340    def transfer(certificate, current_session,
341        current_level, current_verdict):
342        """ Creates a new studycourse and backups the old one.
343        """
344
345    def revert_transfer():
346        """ Revert previous transfer.
347        """
348
349class IUGStudentClearance(IKofaObject):
350    """Representation of undergraduate student clearance data.
351    """
352    officer_comment = schema.Text(
353        title = _(u"Officer's Comment"),
354        required = False,
355        )
356
357    clr_code = schema.TextLine(
358        title = _(u'CLR Activation Code'),
359        required = False,
360        readonly = False,
361        )
362
363    date_of_birth = FormattedDate(
364        title = _(u'Date of Birth'),
365        required = True,
366        show_year = True,
367        )
368
369    nationality = schema.Choice(
370        vocabulary = nats_vocab,
371        title = _(u'Nationality'),
372        required = False,
373        )
374
375class IPGStudentClearance(IUGStudentClearance):
376    """Representation of postgraduate student clearance data.
377    """
378    employer = schema.TextLine(
379        title = _(u'Employer'),
380        required = False,
381        readonly = False,
382        )
383
384class IStudentPersonal(IKofaObject):
385    """Representation of student personal data.
386    """
387    personal_updated = schema.Datetime(
388        title = _(u'Updated'),
389        required = False,
390        readonly = False,
391        )
392
393    perm_address = schema.Text(
394        title = _(u'Permanent Address'),
395        required = False,
396        )
397
398class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,
399    IStudentPersonal):
400    """Representation of a student.
401    """
402
403class IStudentPersonalEdit(IStudentPersonal):
404    """Interface for editing personal data by students.
405    Here we can repeat the fields from IStudentPersonal and set the
406    `required` if necessary.
407    """
408
409    perm_address = schema.Text(
410        title = _(u'Permanent Address'),
411        required = True,
412        )
413
414class IStudentUpdateByRegNo(IStudent):
415    """Representation of a student. Skip regular reg_number validation.
416    """
417    reg_number = schema.TextLine(
418        title = _(u'Registration Number'),
419        required = False,
420        )
421
422class IStudentUpdateByMatricNo(IStudent):
423    """Representation of a student. Skip regular matric_number validation.
424    """
425    matric_number = schema.TextLine(
426        title = _(u'Matriculation Number'),
427        required = False,
428        )
429
430class IStudentRequestPW(IStudent):
431    """Representation of a student for first-time password request.
432    This interface is used when students use the requestpw page to
433    login for the the first time.
434    """
435    number = schema.TextLine(
436        title = _(u'Registr. or Matric. Number'),
437        required = True,
438        )
439
440    email = schema.ASCIILine(
441        title = _(u'Email Address'),
442        required = True,
443        constraint=validate_email,
444        )
445
446class IStudentStudyCourse(IKofaObject):
447    """Representation of student study course data.
448    """
449    next_session_allowed = Attribute('True if the student can proceed to next session')
450    is_postgrad = Attribute('True if student is postgraduate student')
451    is_current = Attribute('True if the study course is the current course of studies')
452    is_previous = Attribute('True if the study course is the previous course of studies')
453
454    certificate = schema.Choice(
455        title = _(u'Certificate'),
456        source = CertificateSource(),
457        required = False,
458        )
459
460    entry_mode = schema.Choice(
461        title = _(u'Entry Mode'),
462        source = StudyModeSource(),
463        required = True,
464        readonly = False,
465        )
466
467    entry_session = schema.Choice(
468        title = _(u'Entry Session'),
469        source = academic_sessions_vocab,
470        #default = datetime.now().year,
471        required = True,
472        readonly = False,
473        )
474
475    current_session = schema.Choice(
476        title = _(u'Current Session'),
477        source = academic_sessions_vocab,
478        required = True,
479        readonly = False,
480        )
481
482    current_level = schema.Choice(
483        title = _(u'Current Level'),
484        source = StudyLevelSource(),
485        required = False,
486        readonly = False,
487        )
488
489    current_verdict = schema.Choice(
490        title = _(u'Current Verdict'),
491        source = VerdictSource(),
492        default = '0',
493        required = False,
494        )
495
496    previous_verdict = schema.Choice(
497        title = _(u'Previous Verdict'),
498        source = VerdictSource(),
499        default = '0',
500        required = False,
501        )
502
503    def addStudentStudyLevel(cert, studylevel):
504        """Add a study level object.
505        """
506
507    def getTranscriptData():
508        """Get a sorted list of dicts with level and course ticket data.
509        This method is used for transcripts.
510        """
511
512class IStudentStudyCourseTransfer(IStudentStudyCourse):
513    """An interface used for student transfers.
514    """
515    certificate = schema.Choice(
516        title = _(u'Certificate'),
517        source = CertificateSource(),
518        required = True,
519        )
520
521    current_level = schema.Choice(
522        title = _(u'Current Level'),
523        source = StudyLevelSource(),
524        required = True,
525        readonly = False,
526        )
527
528    entry_session = schema.Choice(
529        title = _(u'Entry Session'),
530        source = academic_sessions_vocab,
531        #default = datetime.now().year,
532        required = False,
533        readonly = False,
534        )
535
536
537IStudentStudyCourseTransfer['certificate'].order = IStudentStudyCourse[
538    'certificate'].order
539IStudentStudyCourseTransfer['current_level'].order = IStudentStudyCourse[
540    'current_level'].order
541
542class IStudentVerdictUpdate(IKofaObject):
543    """A interface for verdict imports.
544    """
545    current_verdict = schema.Choice(
546        title = _(u'Current Verdict'),
547        source = VerdictSource(),
548        required = True,
549        )
550
551    current_session = schema.Choice(
552        title = _(u'Current Session'),
553        source = academic_sessions_vocab,
554        required = True,
555        )
556
557    current_level = schema.Choice(
558        title = _(u'Current Level'),
559        source = StudyLevelSource(),
560        required = True,
561        )
562
563    bypass_validation = schema.Bool(
564        title = _(u'Bypass validation'),
565        required = False,
566        )
567
568    validated_by = schema.TextLine(
569        title = _(u'Validated by'),
570        required = False,
571        )
572
573class IStudentStudyLevel(IKofaObject):
574    """A representation of student study level data.
575    """
576    certcode = Attribute('The certificate code of the study course')
577    is_current_level = Attribute('True if level is current level of the student')
578    level_title = Attribute('Level title from source')
579    getSessionString = Attribute('Session title from source')
580    number_of_tickets = Attribute('Number of tickets contained in this level')
581    passed_params = Attribute('Information about passed and failed courses')
582    gpa_params_rectified = Attribute('Corrected sessional GPA parameters')
583    gpa_params = Attribute('GPA parameters for this level.')
584    cumulative_params = Attribute(
585        'Cumulative GPA and other cumulative parameters for this level')
586    course_registration_forbidden = Attribute(
587        'Return error message if course registration is forbidden')
588
589    level = schema.Choice(
590        title = _(u'Level'),
591        source = StudyLevelSource(),
592        required = True,
593        readonly = False,
594        )
595
596    level_session = schema.Choice(
597        title = _(u'Session'),
598        source = academic_sessions_vocab,
599        required = True,
600        )
601
602    level_verdict = schema.Choice(
603        title = _(u'Verdict'),
604        source = VerdictSource(),
605        default = '0',
606        required = False,
607        )
608
609    validated_by = schema.TextLine(
610        title = _(u'Validated by'),
611        default = None,
612        required = False,
613        )
614
615    validation_date = schema.Datetime(
616        title = _(u'Validation Date'),
617        required = False,
618        readonly = False,
619        )
620
621    total_credits = schema.Int(
622        title = _(u'Total Credits'),
623        required = False,
624        readonly = True,
625        )
626
627    gpa = schema.TextLine(
628        title = _(u'Unrectified GPA'),
629        required = False,
630        readonly = True,
631        )
632
633    transcript_remark = schema.TextLine(
634        title = _(u'Transcript Remark'),
635        required = False,
636        readonly = False,
637        )
638
639    def addCourseTicket(ticket, course):
640        """Add a course ticket object.
641        """
642
643    def addCertCourseTickets(cert):
644        """Collect all certificate courses and create course
645        tickets automatically.
646        """
647
648    def updateCourseTicket(ticket, course):
649        """Updates a course ticket object and return code
650        if ticket has been invalidated.
651        """
652
653class ICourseTicket(IKofaObject):
654    """A representation of course ticket data.
655    """
656    certcode = Attribute('Certificate code of the study course')
657    level_session = Attribute('Session of the study level the ticket has been added to')
658    level = Attribute('Level value of the study level the ticket has been added to')
659    total_score = Attribute('Score')
660    grade = Attribute('Grade calculated from total score')
661    weight = Attribute('Weight calculated from total score')
662    removable_by_student = Attribute('True if student is allowed to remove the ticket')
663    editable_by_lecturer = Attribute('True if lecturer is allowed to edit the ticket')
664
665    code = Attribute('Code of the original course')
666
667    title = schema.TextLine(
668        title = _(u'Title'),
669        required = False,
670        )
671
672    fcode = schema.TextLine(
673        title = _(u'Faculty Code'),
674        required = False,
675        )
676
677    dcode = schema.TextLine(
678        title = _(u'Department Code'),
679        required = False,
680        )
681
682    semester = schema.Choice(
683        title = _(u'Semester/Term'),
684        source = SemesterSource(),
685        required = False,
686        )
687
688    ticket_session = schema.Choice(
689        title = _(u'Imported Session'),
690        source = academic_sessions_vocab,
691        required = False,
692        )
693
694    passmark = schema.Int(
695        title = _(u'Passmark'),
696        required = False,
697        )
698
699    credits = schema.Int(
700        title = _(u'Credits'),
701        required = False,
702        )
703
704    mandatory = schema.Bool(
705        title = _(u'Required'),
706        default = False,
707        required = False,
708        )
709
710    outstanding = schema.Bool(
711        title = _(u'Outstanding Course'),
712        default = False,
713        required = False,
714        )
715
716    course_category = schema.Choice(
717        title = _(u'Course Category'),
718        source = CourseCategorySource(),
719        required = False,
720        )
721
722    score = schema.Int(
723        title = _(u'Score'),
724        default = None,
725        required = False,
726        missing_value = None,
727        )
728
729    carry_over = schema.Bool(
730        title = _(u'Carry-over Course'),
731        default = False,
732        required = False,
733        )
734
735    automatic = schema.Bool(
736        title = _(u'Automatical Creation'),
737        default = False,
738        required = False,
739        )
740
741class ICourseTicketAdd(IKofaObject):
742    """An interface for adding course tickets.
743    """
744    course = schema.Choice(
745        title = _(u'Course'),
746        source = CourseSource(),
747        readonly = False,
748        )
749
750class ICourseTicketImport(ICourseTicket):
751    """An interface for importing course results and nothing more.
752    """
753    score = schema.Int(
754        title = _(u'Score'),
755        required = False,
756        readonly = False,
757        )
758
759    level_session = schema.Choice(
760        title = _(u'Level Session'),
761        source = academic_sessions_vocab,
762        required = False,
763        readonly = False,
764        )
765
766class IStudentAccommodation(IKofaObject):
767    """A container for student accommodation objects.
768    """
769
770    desired_hostel = schema.TextLine(
771        title = _(u'Desired Hostel'),
772        required = False,
773        )
774
775    def addBedTicket(bedticket):
776        """Add a bed ticket object.
777        """
778
779
780class IBedTicket(IKofaObject):
781    """A representation of accommodation booking data.
782    """
783    bed = Attribute('The bed object')
784    maint_payment_made = Attribute('True if maintenance payment is made')
785
786    display_coordinates = schema.TextLine(
787        title = _(u'Allocated Bed'),
788        required = False,
789        readonly = True,
790        )
791
792    bed_coordinates = schema.TextLine(
793        title = u'',
794        required = True,
795        readonly = False,
796        )
797
798    bed_type = schema.TextLine(
799        title = _(u'Requested Bed Type'),
800        required = True,
801        readonly = False,
802        )
803
804    booking_session = schema.Choice(
805        title = _(u'Session'),
806        source = academic_sessions_vocab,
807        required = True,
808        readonly = False
809        )
810
811    booking_date = schema.Datetime(
812        title = _(u'Booking Date'),
813        required = False,
814        readonly = False,
815        )
816
817    booking_code = schema.TextLine(
818        title = _(u'Booking Activation Code'),
819        required = False,
820        readonly = False,
821        )
822
823    def getSessionString():
824        """Returns the title of academic_sessions_vocab term of the session
825        when the bed was booked.
826        """
827
828class IStudentPaymentsContainer(IPaymentsContainer):
829    """A container for student payment objects.
830    """
831
832    certificate = Attribute('Certificate to determine the correct p_level value')
833
834class IStudentOnlinePayment(IOnlinePayment):
835    """A student payment via payment gateways.
836    """
837
838    certificate = Attribute('Certificate to determine the correct p_level value')
839    student = Attribute('Student')
840
841    p_current = schema.Bool(
842        title = _(u'Current Session Payment'),
843        default = True,
844        required = False,
845        )
846
847    p_level = schema.Choice(
848        title = _(u'Payment Level'),
849        source = StudyLevelSource(),
850        required = False,
851        )
852
853    def redeemTicket():
854        """Either create an appropriate access code or trigger an action
855        directly.
856        """
857
858    def doAfterStudentPayment():
859        """Process student after payment was made.
860        """
861
862    def doAfterStudentPaymentApproval():
863        """Process student after payment was approved.
864        """
865
866    def approveStudentPayment():
867        """Approve payment and process student.
868        """
869
870IStudentOnlinePayment['p_level'].order = IStudentOnlinePayment[
871    'p_session'].order
872
873class IStudentPreviousPayment(IKofaObject):
874    """An interface for adding previous session payments.
875    """
876
877    p_category = schema.Choice(
878        title = _(u'Payment Category'),
879        default = u'schoolfee',
880        source = PreviousPaymentCategorySource(),
881        required = True,
882        )
883
884    p_session = schema.Choice(
885        title = _(u'Payment Session'),
886        source = academic_sessions_vocab,
887        required = True,
888        )
889
890    p_level = schema.Choice(
891        title = _(u'Payment Level'),
892        source = StudyLevelSource(),
893        required = True,
894        )
895
896class IStudentBalancePayment(IKofaObject):
897    """An interface for adding balances.
898    """
899
900    p_category = schema.Choice(
901        title = _(u'Payment Category'),
902        default = u'schoolfee',
903        required = True,
904        source = BalancePaymentCategorySource(),
905        )
906
907    balance_session = schema.Choice(
908        title = _(u'Payment Session'),
909        source = academic_sessions_vocab,
910        required = True,
911        )
912
913    balance_level = schema.Choice(
914        title = _(u'Payment Level'),
915        source = StudyLevelSource(),
916        required = True,
917        )
918
919    balance_amount = schema.Float(
920        title = _(u'Balance Amount'),
921        default = None,
922        required = True,
923        readonly = False,
924        description = _(
925            u'Balance in Naira '),
926        )
927
928class ICSVStudentExporter(ICSVExporter):
929    """A regular ICSVExporter that additionally supports exporting
930      data from a given student object.
931    """
932    def get_filtered(site, **kw):
933        """Get a filtered set of students.
934        """
935
936    def get_selected(site, selected):
937        """Get set of selected students.
938        """
939
940    def export_student(student, filepath=None):
941        """Export data for a given student.
942        """
943
944    def export_filtered(site, filepath=None, **kw):
945        """Export data for filtered set of students.
946        """
947
948    def export_selected(site, filepath=None, **kw):
949        """Export data for selected set of students.
950        """
Note: See TracBrowser for help on using the repository browser.