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

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

Add option which allows students to select a desired hostel before booking accommodation.

  • Property svn:keywords set to Id
File size: 25.2 KB
RevLine 
[7191]1## $Id: interfaces.py 13457 2015-11-16 09:05:30Z 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'),
[13345]248        required = False,
[7133]249        constraint=validate_email,
250        )
[8176]251    phone = PhoneNumber(
[7723]252        title = _(u'Phone'),
[7133]253        required = False,
254        )
255
[9334]256    def setTempPassword(user, password):
257        """Set a temporary password (LDAP-compatible) SSHA encoded for
258        officers.
259        """
260
261    def getTempPassword():
262        """Check if a temporary password has been set and if it
[12997]263        is not expired. Return the temporary password if valid,
[9334]264        None otherwise. Unset the temporary password if expired.
265        """
266
[9131]267    def transfer(certificate, current_session,
268        current_level, current_verdict):
269        """ Creates a new studycourse and backups the old one.
[12997]270        """
[9131]271
[12997]272    def revert_transfer():
273        """ Revert previous transfer.
[9131]274        """
275
[7993]276class IUGStudentClearance(IKofaObject):
277    """Representation of undergraduate student clearance data.
[6631]278    """
[9543]279    officer_comment = schema.Text(
280        title = _(u"Officer's Comment"),
281        required = False,
[6631]282        )
283
[6769]284    clr_code = schema.TextLine(
[7723]285        title = _(u'CLR Activation Code'),
[6769]286        required = False,
[8977]287        readonly = False,
[6769]288        )
289
[9543]290    date_of_birth = FormattedDate(
291        title = _(u'Date of Birth'),
292        required = True,
293        show_year = True,
294        )
295
[7523]296    nationality = schema.Choice(
[8069]297        vocabulary = nats_vocab,
[7723]298        title = _(u'Nationality'),
[7983]299        required = False,
[7523]300        )
301
[7993]302class IPGStudentClearance(IUGStudentClearance):
303    """Representation of postgraduate student clearance data.
304    """
305    employer = schema.TextLine(
306        title = _(u'Employer'),
307        required = False,
308        readonly = False,
309        )
310
[7819]311class IStudentPersonal(IKofaObject):
[6631]312    """Representation of student personal data.
313    """
[9543]314    personal_updated = schema.Datetime(
315        title = _(u'Updated'),
316        required = False,
317        readonly = False,
318        )
319
[6651]320    perm_address = schema.Text(
[7723]321        title = _(u'Permanent Address'),
[6631]322        required = False,
323        )
324
[10447]325class IStudentTranscript(IKofaObject):
326    """Representation of student transcript data.
327    """
328
[10458]329    transcript_comment = schema.Text(
330        title = _(u'Comment'),
[10447]331        required = False,
332        )
333
334
[8008]335class IStudent(IStudentBase,IUGStudentClearance,IPGStudentClearance,
[10447]336    IStudentPersonal, IStudentTranscript):
[6631]337    """Representation of a student.
338    """
339
[9563]340class IStudentPersonalEdit(IStudentPersonal):
341    """Interface for editing personal data by students.
342    Here we can repeat the fields from IStudentPersonal and set the
343    `required` if necessary.
344    """
345
346    perm_address = schema.Text(
347        title = _(u'Permanent Address'),
348        required = True,
349        )
350
[6849]351class IStudentUpdateByRegNo(IStudent):
352    """Representation of a student. Skip regular reg_number validation.
353    """
354    reg_number = schema.TextLine(
[7723]355        title = _(u'Registration Number'),
[6849]356        required = False,
357        )
358
359class IStudentUpdateByMatricNo(IStudent):
360    """Representation of a student. Skip regular matric_number validation.
361    """
362    matric_number = schema.TextLine(
[7723]363        title = _(u'Matriculation Number'),
[6849]364        required = False,
365        )
366
[8779]367class IStudentRequestPW(IStudent):
[12999]368    """Representation of a student for first-time password request.
[8779]369    This interface is used when students use the requestpw page to
370    login for the the first time.
371    """
[8854]372    number = schema.TextLine(
373        title = _(u'Registr. or Matric. Number'),
[8779]374        required = True,
375        )
376
377    firstname = schema.TextLine(
378        title = _(u'First Name'),
379        required = True,
380        )
381
382    email = schema.ASCIILine(
383        title = _(u'Email Address'),
384        required = True,
385        constraint=validate_email,
386        )
387
[7819]388class IStudentStudyCourse(IKofaObject):
[12999]389    """Representation of student study course data.
[6633]390    """
[13002]391    next_session_allowed = Attribute('True if the student can proceed to next session')
392    is_postgrad = Attribute('True if student is postgraduate student')
393    is_current = Attribute('True if the study course is the current course of studies')
394    is_previous = Attribute('True if the study course is the previous course of studies')
395
[6648]396    certificate = schema.Choice(
[7723]397        title = _(u'Certificate'),
[6648]398        source = CertificateSource(),
[7209]399        required = False,
[6633]400        )
[6635]401
[6996]402    entry_mode = schema.Choice(
[7723]403        title = _(u'Entry Mode'),
[7681]404        source = StudyModeSource(),
[6996]405        required = True,
406        readonly = False,
407        )
408
409    entry_session = schema.Choice(
[7723]410        title = _(u'Entry Session'),
[6996]411        source = academic_sessions_vocab,
[7425]412        #default = datetime.now().year,
[6996]413        required = True,
414        readonly = False,
415        )
416
[6724]417    current_session = schema.Choice(
[7723]418        title = _(u'Current Session'),
[6744]419        source = academic_sessions_vocab,
[6724]420        required = True,
[6996]421        readonly = False,
[6724]422        )
423
424    current_level = schema.Choice(
[7723]425        title = _(u'Current Level'),
[6725]426        source = StudyLevelSource(),
427        required = False,
[6996]428        readonly = False,
[6724]429        )
430
431    current_verdict = schema.Choice(
[7723]432        title = _(u'Current Verdict'),
[7619]433        source = VerdictSource(),
[8820]434        default = '0',
[6725]435        required = False,
[6724]436        )
437
438    previous_verdict = schema.Choice(
[7723]439        title = _(u'Previous Verdict'),
[7619]440        source = VerdictSource(),
[8820]441        default = '0',
[6725]442        required = False,
[6724]443        )
444
[13002]445    def addStudentStudyLevel(cert, studylevel):
446        """Add a study level object.
447        """
448
449    def getTranscriptData():
450        """Get a sorted list of dicts with level and course ticket data.
451        This method is used for transcripts.
452        """
453
[9138]454class IStudentStudyCourseTransfer(IStudentStudyCourse):
[12999]455    """An interface used for student transfers.
[9138]456    """
457    certificate = schema.Choice(
458        title = _(u'Certificate'),
459        source = CertificateSource(),
460        required = True,
461        )
462
463    current_level = schema.Choice(
464        title = _(u'Current Level'),
465        source = StudyLevelSource(),
466        required = True,
467        readonly = False,
468        )
469
[9960]470    entry_session = schema.Choice(
471        title = _(u'Entry Session'),
472        source = academic_sessions_vocab,
473        #default = datetime.now().year,
474        required = False,
475        readonly = False,
476        )
477
478
[9138]479IStudentStudyCourseTransfer['certificate'].order = IStudentStudyCourse[
480    'certificate'].order
481IStudentStudyCourseTransfer['current_level'].order = IStudentStudyCourse[
482    'current_level'].order
483
[10250]484class IStudentStudyCourseTranscript(IKofaObject):
485    """An interface for student transcripts.
486    """
487    entry_mode = schema.Choice(
488        title = _(u'Entry Mode'),
489        source = StudyModeSource(),
490        required = True,
491        readonly = False,
492        )
493
494    entry_session = schema.Choice(
495        title = _(u'Entry Session'),
496        source = academic_sessions_vocab,
497        #default = datetime.now().year,
498        required = True,
499        readonly = False,
500        )
501
[7951]502class IStudentVerdictUpdate(IKofaObject):
503    """A interface for verdict imports.
504    """
505    current_verdict = schema.Choice(
506        title = _(u'Current Verdict'),
507        source = VerdictSource(),
508        required = True,
509        )
510
511    current_session = schema.Choice(
512        title = _(u'Current Session'),
513        source = academic_sessions_vocab,
514        required = True,
515        )
516
517    current_level = schema.Choice(
518        title = _(u'Current Level'),
519        source = StudyLevelSource(),
520        required = True,
521        )
522
[9296]523    bypass_validation = schema.Bool(
524        title = _(u'Bypass validation'),
525        required = False,
526        )
527
528    validated_by = schema.TextLine(
529        title = _(u'Validated by'),
530        required = False,
531        )
532
[7819]533class IStudentStudyLevel(IKofaObject):
[12999]534    """A representation of student study level data.
[6774]535    """
[13002]536    certcode = Attribute('The certificate code of the study course')
537    is_current_level = Attribute('True if level is current level of the student')
538    level_title = Attribute('Level title from source')
539    getSessionString = Attribute('Session title from source')
[9235]540    number_of_tickets = Attribute('Number of tickets contained in this level')
[10553]541    passed_params = Attribute('Information about passed and failed courses')
[13002]542    gpa_params_rectified = Attribute('Corrected sessional GPA parameters')
543    gpa_params = Attribute('GPA parameters for this level.')
544    cumulative_params = Attribute('Cumulative GPA and other cumulative parameters for this level')
[13031]545    course_registration_allowed = Attribute('True if registerin courses is allowed')
[6774]546
[12873]547    level = schema.Choice(
548        title = _(u'Level'),
549        source = StudyLevelSource(),
550        required = True,
551        readonly = False,
552        )
553
[6793]554    level_session = schema.Choice(
[7723]555        title = _(u'Session'),
[6793]556        source = academic_sessions_vocab,
[9437]557        required = True,
[6793]558        )
[6781]559
[6793]560    level_verdict = schema.Choice(
[7723]561        title = _(u'Verdict'),
[7619]562        source = VerdictSource(),
[8820]563        default = '0',
[6793]564        required = False,
565        )
566
[9161]567    validated_by = schema.TextLine(
568        title = _(u'Validated by'),
569        default = None,
570        required = False,
571        )
572
573    validation_date = schema.Datetime(
574        title = _(u'Validation Date'),
575        required = False,
576        readonly = False,
577        )
578
[9690]579    total_credits = schema.Int(
580        title = _(u'Total Credits'),
581        required = False,
582        readonly = True,
583        )
584
[10479]585    gpa = schema.Int(
586        title = _(u'Unrectified GPA'),
587        required = False,
588        readonly = True,
589        )
[9690]590
[8920]591    def addCourseTicket(ticket, course):
[8182]592        """Add a course ticket object.
593        """
594
[9501]595    def addCertCourseTickets(cert):
596        """Collect all certificate courses and create course
597        tickets automatically.
598        """
599
[7819]600class ICourseTicket(IKofaObject):
[12999]601    """A representation of course ticket data.
[6781]602    """
[13003]603    certcode = Attribute('Certificate code of the study course')
604    level_session = Attribute('Session of the study level the ticket has been added to')
605    level = Attribute('Level value of the study level the ticket has been added to')
606    grade = Attribute('Grade calculated from score')
607    weight = Attribute('Weight calculated from score')
608    removable_by_student = Attribute('True if student is allowed to remove the ticket')
609    editable_by_lecturer = Attribute('True if lecturer is allowed to edit the ticket')
[6781]610
[13003]611    code = Attribute('Code of the original course')
612
[9420]613    title = schema.TextLine(
614        title = _(u'Title'),
615        required = False,
616        )
617
618    fcode = schema.TextLine(
619        title = _(u'Faculty Code'),
620        required = False,
621        )
622
623    dcode = schema.TextLine(
624        title = _(u'Department Code'),
625        required = False,
626        )
627
628    semester = schema.Choice(
629        title = _(u'Semester/Term'),
630        source = SemesterSource(),
631        required = False,
632        )
633
634    passmark = schema.Int(
635        title = _(u'Passmark'),
636        required = False,
637        )
638
639    credits = schema.Int(
640        title = _(u'Credits'),
641        required = False,
642        )
643
[7665]644    mandatory = schema.Bool(
[9320]645        title = _(u'Required'),
[6795]646        default = False,
647        required = False,
648        )
649
[6781]650    score = schema.Int(
[7723]651        title = _(u'Score'),
[9684]652        default = None,
[6781]653        required = False,
[10637]654        missing_value = None,
[6781]655        )
656
[7661]657    carry_over = schema.Bool(
[7723]658        title = _(u'Carry-over Course'),
[7661]659        default = False,
660        required = False,
661        )
662
[9420]663    automatic = schema.Bool(
664        title = _(u'Automatical Creation'),
665        default = False,
[9316]666        required = False,
667        )
668
[9420]669class ICourseTicketAdd(IKofaObject):
[7150]670    """An interface for adding course tickets.
[6795]671    """
672    course = schema.Choice(
[7723]673        title = _(u'Course'),
[6795]674        source = CourseSource(),
675        readonly = False,
676        )
677
[9420]678class ICourseTicketImport(ICourseTicket):
679    """An interface for importing course results and nothing more.
680    """
681    score = schema.Int(
682        title = _(u'Score'),
683        required = False,
684        readonly = False,
685        )
686
687    level_session = schema.Choice(
688        title = _(u'Level Session'),
689        source = academic_sessions_vocab,
690        required = False,
691        readonly = False,
692        )
693
[7819]694class IStudentAccommodation(IKofaObject):
[6635]695    """A container for student accommodation objects.
696    """
697
[13457]698    desired_hostel = schema.TextLine(
699        title = _(u'Desired Hostel'),
700        required = False,
701        )
702
[9423]703    def addBedTicket(bedticket):
704        """Add a bed ticket object.
705        """
706
707
[7819]708class IBedTicket(IKofaObject):
[12999]709    """A representation of accommodation booking data.
[6989]710    """
[13314]711    bed = Attribute('The bed object')
712    maint_payment_made = Attribute('True if maintenance payment is made')
[6996]713
[13012]714    display_coordinates = schema.TextLine(
715        title = _(u'Allocated Bed'),
716        required = False,
717        readonly = True,
718        )
719
[6996]720    bed_coordinates = schema.TextLine(
[9984]721        title = u'',
[9423]722        required = True,
[7014]723        readonly = False,
[6992]724        )
725
[6996]726    bed_type = schema.TextLine(
[9424]727        title = _(u'Requested Bed Type'),
[9423]728        required = True,
[7014]729        readonly = False,
[6996]730        )
731
[6992]732    booking_session = schema.Choice(
[7723]733        title = _(u'Session'),
[6992]734        source = academic_sessions_vocab,
735        required = True,
[13316]736        readonly = False
[6992]737        )
738
[8170]739    booking_date = schema.Datetime(
[7723]740        title = _(u'Booking Date'),
[6992]741        required = False,
[13316]742        readonly = False,
[6992]743        )
744
745    booking_code = schema.TextLine(
[7723]746        title = _(u'Booking Activation Code'),
[6992]747        required = False,
[13316]748        readonly = False,
[6992]749        )
750
[6994]751    def getSessionString():
[13012]752        """Returns the title of academic_sessions_vocab term of the session
753        when the bed was booked.
[6994]754        """
[6992]755
[6860]756class IStudentPaymentsContainer(IPaymentsContainer):
[6635]757    """A container for student payment objects.
758    """
759
[6877]760class IStudentOnlinePayment(IOnlinePayment):
761    """A student payment via payment gateways.
762    """
763
[9148]764    p_current = schema.Bool(
765        title = _(u'Current Session Payment'),
766        default = True,
767        required = False,
768        )
769
[8268]770    p_level = schema.Int(
771        title = _(u'Payment Level'),
772        required = False,
773        )
[6877]774
[8422]775    def doAfterStudentPayment():
776        """Process student after payment was made.
777        """
778
[8453]779    def doAfterStudentPaymentApproval():
780        """Process student after payment was approved.
781        """
782
[8420]783    def approveStudentPayment():
[8422]784        """Approve payment and process student.
[8420]785        """
786
[8268]787IStudentOnlinePayment['p_level'].order = IStudentOnlinePayment[
788    'p_session'].order
[8408]789
[9864]790class IStudentPreviousPayment(IKofaObject):
[9148]791    """An interface for adding previous session payments.
792    """
793
[9864]794    p_category = schema.Choice(
795        title = _(u'Payment Category'),
796        default = u'schoolfee',
797        source = PreviousPaymentCategorySource(),
798        required = True,
799        )
800
[9148]801    p_session = schema.Choice(
802        title = _(u'Payment Session'),
803        source = academic_sessions_vocab,
804        required = True,
805        )
806
807    p_level = schema.Choice(
808        title = _(u'Payment Level'),
809        source = StudyLevelSource(),
810        required = True,
811        )
812
[9864]813class IStudentBalancePayment(IKofaObject):
814    """An interface for adding balances.
815    """
816
[9868]817    p_category = schema.Choice(
[9864]818        title = _(u'Payment Category'),
819        default = u'schoolfee',
820        required = True,
[9868]821        source = BalancePaymentCategorySource(),
[9864]822        )
823
824    balance_session = schema.Choice(
825        title = _(u'Payment Session'),
826        source = academic_sessions_vocab,
827        required = True,
828        )
829
830    balance_level = schema.Choice(
831        title = _(u'Payment Level'),
832        source = StudyLevelSource(),
833        required = True,
834        )
835
836    balance_amount = schema.Float(
837        title = _(u'Balance Amount'),
[9874]838        default = None,
[9864]839        required = True,
840        readonly = False,
841        description = _(
842            u'Balance in Naira '),
843        )
844
[8408]845class ICSVStudentExporter(ICSVExporter):
846    """A regular ICSVExporter that additionally supports exporting
847      data from a given student object.
848    """
[9801]849    def get_filtered(site, **kw):
[9797]850        """Get a filtered set of students.
851        """
[8408]852
[12518]853    def get_selected(site, selected):
854        """Get set of selected students.
855        """
856
[8408]857    def export_student(student, filepath=None):
858        """Export data for a given student.
859        """
[9734]860
[9797]861    def export_filtered(site, filepath=None, **kw):
[12518]862        """Export data for filtered set of students.
[9734]863        """
[12518]864
865    def export_selected(site, filepath=None, **kw):
866        """Export data for selected set of students.
867        """
Note: See TracBrowser for help on using the repository browser.