Changeset 16252 for main


Ignore:
Timestamp:
29 Sep 2020, 07:00:27 (4 years ago)
Author:
Henrik Bettermann
Message:

More customizations regarding personal/bio data forms.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/locales/en/LC_MESSAGES/waeup.kofa.po

    r16250 r16252  
    128128
    129129msgid "Your personal data record is outdated. Please update."
    130 msgstr ""
     130msgstr "Your personal/bio data record is outdated. Please update."
    131131
    132132msgid "${a}: Personal Data"
    133 msgstr "${a}: Personal/Bio Data"
     133msgstr "${a}: Personal / Bio Data"
    134134
    135135msgid "Manage personal data"
    136 msgstr "Manage personal/bio data"
     136msgstr "Manage personal / bio data"
    137137
    138138msgid "Edit personal data"
    139 msgstr "Edit personal/bio data"
     139msgstr "Edit personal / bio data"
    140140
    141141msgid "Personal Data"
    142 msgstr "Personal/Bio Data"
     142msgstr "Personal / Bio Data"
     143
     144msgid "Personal Data of"
     145msgstr "Personal / Bio Data of"
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r16249 r16252  
    3333    CourseTicketDisplayFormPage, StudentTriggerTransitionFormPage,
    3434    StartClearancePage, BalancePaymentAddFormPage,
    35     ExportPDFAdmissionSlip,
     35    ExportPDFAdmissionSlip, ExportPDFPersonalDataSlip,
    3636    msave, emit_lock_message)
    3737from waeup.kofa.students.interfaces import (
     
    129129        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    130130
     131class CustomExportPDFPersonalDataSlip(ExportPDFPersonalDataSlip):
     132    """Deliver a PDF base and personal data slip.
     133    """
     134    omit_fields = (
     135        'phone', 'email',
     136        'suspended',
     137        'adm_code', 'suspended_comment',
     138        'current_level',
     139        'flash_notice', 'entry_session',
     140        'parents_email')
     141
     142    form_fields = grok.AutoFields(ICustomStudentPersonal)
     143
    131144class CustomAccommodationDisplayFormPage(NigeriaAccommodationDisplayFormPage):
    132145    """ Page to view bed tickets.
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/interfaces.py

    r16249 r16252  
    5555
    5656class ICustomStudentPersonal(IStudentPersonal):
    57     """Student bio data.
     57    """Student personal/bio data.
    5858
    5959    """
    6060
    6161    is_foreigner = Attribute('True if student is non-Nigerian')
     62
     63    # Duplicated fields from the ICustomStudentBase
     64
     65    email = schema.ASCIILine(
     66        title = _(u'Email'),
     67        required = False,
     68        constraint=validate_email,
     69        )
     70
     71    email2 = schema.ASCIILine(
     72        title = _(u'Second Email'),
     73        required = False,
     74        constraint=validate_email,
     75        )
     76
     77    phone = PhoneNumber(
     78        title = _(u'Phone'),
     79        required = False,
     80        )
     81
     82    parents_email = schema.ASCIILine(
     83        title = _(u"Parents' Email"),
     84        required = False,
     85        constraint=validate_email,
     86        )
     87
     88    # New fields
    6289
    6390    perm_address = schema.Text(
     
    145172    """
    146173
    147 
    148174class ICustomUGStudentClearance(INigeriaUGStudentClearance):
    149175    """Representation of ug student clearance data.
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_browser.py

    r16238 r16252  
    123123        self.assertFalse(self.student.library)
    124124
    125     def test_student_basedata_slip(self):
     125    def test_student_studycourse_slip(self):
    126126        IWorkflowState(self.student).setState('school fee paid')
    127127        self.browser.open(self.login_path)
     
    131131        # Students can open base data slip
    132132        # (no button available in base package)
    133         pdf_url = '%s/basedata_slip.pdf' % self.studycourse_path
     133        pdf_url = '%s/studycourse_slip.pdf' % self.studycourse_path
    134134        self.browser.open(pdf_url)
    135135        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    136136        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
    137         path = os.path.join(samples_dir(), 'basedata_slip.pdf')
     137        path = os.path.join(samples_dir(), 'studycourse_slip.pdf')
    138138        open(path, 'wb').write(self.browser.contents)
    139         print "Sample PDF basedata_slip.pdf written to %s" % path
     139        print "Sample PDF studycourse_slip.pdf written to %s" % path
     140
     141    def test_student_personal_slip(self):
     142        IWorkflowState(self.student).setState('school fee paid')
     143        self.browser.open(self.login_path)
     144        self.browser.getControl(name="form.login").value = self.student_id
     145        self.browser.getControl(name="form.password").value = 'spwd'
     146        self.browser.getControl("Login").click()
     147        # Students can open base data slip
     148        # (no button available in base package)
     149        pdf_url = '%s/personal_slip.pdf' % self.student_path
     150        self.browser.open(pdf_url)
     151        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     152        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
     153        path = os.path.join(samples_dir(), 'personal_slip.pdf')
     154        open(path, 'wb').write(self.browser.contents)
     155        print "Sample PDF personal_slip.pdf written to %s" % path
    140156
    141157    def test_student_admission_letter(self):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/viewlets.py

    r16154 r16252  
    3131    StudyLevelDisplayFormPage, StudentBaseDisplayFormPage)
    3232from waeup.kofa.students.viewlets import (
    33     AddPreviousPaymentActionButton, AddBalancePaymentActionButton)
     33    AddPreviousPaymentActionButton, AddBalancePaymentActionButton,
     34    StudentPersonalEditActionButton)
    3435
    3536from kofacustom.nigeria.interfaces import MessageFactory as _
     37
     38class StudentPersonalEditActionButton(StudentPersonalEditActionButton):
     39    text = _('Edit personal / bio data')
    3640
    3741class SwitchLibraryAccessActionButton(ManageActionButton):
     
    5357    icon = 'actionicon_pay.png'
    5458
    55 class BaseDataSlipActionButton(ManageActionButton):
     59class EditPersonalActionButton(ManageActionButton):
     60    grok.order(9)
     61    grok.context(ICustomStudent)
     62    grok.view(StudentBaseDisplayFormPage)
     63    grok.require('waeup.handleStudent')
     64    text = _('Edit personal/bio data now')
     65    target = 'edit_personal'
     66    #icon = 'actionicon_edit.png'
     67
     68class PersonalDataSlipActionButton(ManageActionButton):
    5669    grok.order(10)
    57     grok.context(ICustomStudentStudyCourse)
    58     grok.view(StudyCourseDisplayFormPage)
     70    grok.context(ICustomStudent)
     71    grok.view(StudentBaseDisplayFormPage)
    5972    grok.require('waeup.viewStudent')
    60     text = _('Download base data slip')
    61     target = 'basedata_slip.pdf'
     73    text = _('Download personal / bio data slip')
     74    target = 'personal_slip.pdf'
    6275    icon = 'actionicon_pdf.png'
    6376
     
    6780class GetMatricNumberActionButton(ManageActionButton):
    6881    grok.order(10)
    69     grok.context(IStudent)
     82    grok.context(ICustomStudent)
    7083    grok.view(StudentBaseDisplayFormPage)
    7184    grok.require('waeup.manageStudent')
     
    8396            return ''
    8497        return self.view.url(self.view.context, 'get_matric_number')
     98
     99class StudyCourseDataSlipActionButton(ManageActionButton):
     100    grok.order(10)
     101    grok.context(ICustomStudentStudyCourse)
     102    grok.view(StudyCourseDisplayFormPage)
     103    grok.require('waeup.viewStudent')
     104    text = _('Download study course slip')
     105    target = 'studycourse_slip.pdf'
     106    icon = 'actionicon_pdf.png'
    85107
    86108# Library
Note: See TracChangeset for help on using the changeset viewer.