Ignore:
Timestamp:
25 Mar 2023, 18:00:57 (21 months ago)
Author:
Henrik Bettermann
Message:

Add post_text to admission letter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r17255 r17362  
    1717##
    1818import grok
     19import os
    1920from datetime import datetime
    2021from zope.i18n import translate
     
    4142    StartClearancePage,
    4243    StudentFilesUploadPage,
    43     StudyCourseTranscriptPage)
     44    StudyCourseTranscriptPage,
     45    ExportPDFAdmissionSlip)
    4446from waeup.kofa.students.workflow import (CREATED, ADMITTED, PAID,
    4547    CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED,
     
    979981                               self.context.student.depcode)
    980982        return DEPLINKS[facdepkey]
     983
     984class CustomExportPDFAdmissionSlip(ExportPDFAdmissionSlip):
     985    """Deliver a PDF Admission slip.
     986    """
     987
     988    @property
     989    def post_text_pt(self):
     990        datelist = self.context.history.messages[0].split()[0].split('-')
     991        creation_date = u'%s/%s/%s' % (datelist[2], datelist[1], datelist[0])
     992        return (
     993            'Your Kofa student record was created on %s. <br/><br/>'
     994            'Please Note: This admission for '
     995            'Undergraduate Part-Time and Undergraduate Sandwich is incomplete '
     996            'until you have successfully applied on the <b>JAMB CAPS PORTAL</b>.  '
     997            'Ignore this if you have completed your own <b>pre-admission</b> '
     998            'activities on the JAMB website.' % creation_date)
     999
     1000    def render(self):
     1001        students_utils = getUtility(IStudentsUtils)
     1002        letterhead_path = os.path.join(
     1003            os.path.dirname(__file__), 'static', 'letterhead_admission.jpg')
     1004        if not os.path.exists(letterhead_path):
     1005            letterhead_path = None
     1006        if self.context.current_mode in ('ug_pt', 'ug_sw'):
     1007            return students_utils.renderPDFAdmissionLetter(self,
     1008                self.context.student, omit_fields=self.omit_fields,
     1009                letterhead_path=letterhead_path, post_text=self.post_text_pt)
     1010        return students_utils.renderPDFAdmissionLetter(self,
     1011            self.context.student, omit_fields=self.omit_fields,
     1012            letterhead_path=letterhead_path, post_text=None)
Note: See TracChangeset for help on using the changeset viewer.