Changeset 11864


Ignore:
Timestamp:
21 Oct 2014, 08:10:34 (10 years ago)
Author:
Henrik Bettermann
Message:

Add PIN fields to first and second sitting sections on UG clearance form'.

Location:
main/waeup.kwarapoly/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kwarapoly/trunk/CHANGES.txt

    r11847 r11864  
    441.2dev (unreleased)
    55===================
     6
     7* Add PIN fields to first and second sitting sections on UG clearance form'.
    68
    79* Add PIN fields to 'O' level section on application form'.
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/browser.py

    r11539 r11864  
    2929    StudentBasePDFFormPage)
    3030from waeup.kwarapoly.students.interfaces import (
    31     ICustomStudent, ICustomStudentBase, ICustomStudentStudyLevel)
     31    ICustomStudent, ICustomStudentBase, ICustomStudentStudyLevel,
     32    ICustomUGStudentClearance, ICustomPGStudentClearance)
    3233from waeup.kwarapoly.interfaces import MessageFactory as _
    3334from waeup.kofa.students.workflow import (
     
    3839    NigeriaOnlinePaymentAddFormPage,
    3940    NigeriaExportPDFPaymentSlipPage,
     41    NigeriaStudentClearanceDisplayFormPage,
     42    NigeriaExportPDFClearanceSlipPage,
    4043    NigeriaStudentClearanceEditFormPage,
    4144    NigeriaExportPDFCourseRegistrationSlipPage,
    4245    NigeriaStudentPersonalDisplayFormPage,
     46    NigeriaStudentClearanceManageFormPage,
    4347    NigeriaStudentPersonalEditFormPage,
    4448    NigeriaStudentPersonalManageFormPage,
     
    113117    with_ac = False
    114118
     119
     120class CustomStudentClearanceDisplayFormPage(NigeriaStudentClearanceDisplayFormPage):
     121    """ Page to display student clearance data
     122    """
     123
     124    @property
     125    def form_fields(self):
     126        if self.context.is_postgrad:
     127            form_fields = grok.AutoFields(
     128                ICustomPGStudentClearance).omit('clearance_locked')
     129        else:
     130            form_fields = grok.AutoFields(
     131                ICustomUGStudentClearance).omit('clearance_locked')
     132        if not getattr(self.context, 'officer_comment'):
     133            form_fields = form_fields.omit('officer_comment')
     134        else:
     135            form_fields['officer_comment'].custom_widget = BytesDisplayWidget
     136        return form_fields
     137
     138class CustomExportPDFClearanceSlipPage(NigeriaExportPDFClearanceSlipPage):
     139    """Deliver a PDF slip of the context.
     140    """
     141
     142    @property
     143    def form_fields(self):
     144        if self.context.is_postgrad:
     145            form_fields = grok.AutoFields(
     146                ICustomPGStudentClearance).omit('clearance_locked')
     147        else:
     148            form_fields = grok.AutoFields(
     149                ICustomUGStudentClearance).omit('clearance_locked')
     150        if not getattr(self.context, 'officer_comment'):
     151            form_fields = form_fields.omit('officer_comment')
     152        return form_fields
     153
     154class CustomStudentClearanceManageFormPage(NigeriaStudentClearanceManageFormPage):
     155    """ Page to edit student clearance data
     156    """
     157
     158    @property
     159    def form_fields(self):
     160        if self.context.is_postgrad:
     161            form_fields = grok.AutoFields(
     162                ICustomPGStudentClearance).omit('clr_code')
     163        else:
     164            form_fields = grok.AutoFields(
     165                ICustomUGStudentClearance).omit('clr_code')
     166        return form_fields
     167
    115168class CustomStudentClearanceEditFormPage(NigeriaStudentClearanceEditFormPage):
    116169    """ View to edit student clearance data by student
     
    119172    def dataNotComplete(self):
    120173        return False
     174
     175    @property
     176    def form_fields(self):
     177        if self.context.is_postgrad:
     178            form_fields = grok.AutoFields(ICustomPGStudentClearance).omit(
     179            'clearance_locked', 'nysc_location', 'clr_code', 'officer_comment')
     180        else:
     181            form_fields = grok.AutoFields(ICustomUGStudentClearance).omit(
     182            'clearance_locked', 'clr_code', 'officer_comment')
     183        return form_fields
    121184
    122185class BedTicketAddPage(BedTicketAddPage):
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/interfaces.py

    r10710 r11864  
    9393    """
    9494
     95    fst_sit_pin = schema.TextLine(
     96        title = _(u'Result Checking PIN'),
     97        required = False,
     98        readonly = False,
     99        )
     100
     101    fst_sit_pin_serial = schema.TextLine(
     102        title = _(u'PIN Serial Number'),
     103        required = False,
     104        readonly = False,
     105        )
     106
     107    scd_sit_pin = schema.TextLine(
     108        title = _(u'Result Checking PIN'),
     109        required = False,
     110        readonly = False,
     111        )
     112
     113    scd_sit_pin_serial = schema.TextLine(
     114        title = _(u'PIN Serial Number'),
     115        required = False,
     116        readonly = False,
     117        )
     118
     119ICustomUGStudentClearance['fst_sit_pin'].order = ICustomUGStudentClearance[
     120    'fst_sit_results'].order
     121ICustomUGStudentClearance['fst_sit_pin_serial'].order = ICustomUGStudentClearance[
     122    'fst_sit_results'].order
     123ICustomUGStudentClearance['scd_sit_pin'].order = ICustomUGStudentClearance[
     124    'scd_sit_results'].order
     125ICustomUGStudentClearance['scd_sit_pin_serial'].order = ICustomUGStudentClearance[
     126    'scd_sit_results'].order
     127
     128
    95129class ICustomPGStudentClearance(INigeriaPGStudentClearance):
    96130    """Representation of pg student clearance data.
Note: See TracChangeset for help on using the changeset viewer.