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

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

More docs.

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