source: main/waeup.kofa/branches/uli-py3/src/waeup/kofa/students/interfaces.py @ 17930

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

Add UpdateCourseTicketsView.

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