Ignore:
Timestamp:
1 Sep 2016, 15:33:23 (8 years ago)
Author:
Henrik Bettermann
Message:

Implement screening invitation letter.

File:
1 edited

Legend:

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

    r14141 r14147  
    3131    ApplicationFeePaymentAddPage,
    3232    OnlinePaymentApprovePage,
    33     ExportPDFPageApplicationSlip)
     33    ExportPDFPageApplicationSlip,
     34    ApplicantBaseDisplayFormPage)
     35from waeup.kofa.students.interfaces import IStudentsUtils
    3436from waeup.kofa.applicants.interfaces import (
    3537    ISpecialApplicant, IApplicantsUtils)
     
    609611        return '%s - %s %s' % (container_title,
    610612            ar_translation, self.context.application_number)
     613
     614class ExportScreeningInvitationSlip(UtilityView, grok.View):
     615    """Deliver a PDF slip of the context.
     616    """
     617    grok.context(ICustomApplicant)
     618    grok.name('screening_invitation_slip.pdf')
     619    grok.require('waeup.viewApplication')
     620    form_fields = None
     621    label = u'Invitation Letter for Screening'
     622
     623
     624    @property
     625    def note(self):
     626        if self.context.screening_date:
     627            return """
     628<br /><br /><br /><br /><font size='12'>
     629Dear %s,
     630<br /><br /><br />
     631You are invited for your Uniben Admission Screening Exercise on:
     632<br /><br />
     633<strong>%s</strong>.
     634<br /><br />
     635Please bring along this letter of invitation to the University Main Auditorium
     636<br /><br />
     637on your screening date.
     638<br /><br /><br />
     639Signed,
     640<br /><br />
     641The Registrar<br />
     642</font>
     643
     644""" % (self.context.display_fullname, self.context.screening_date)
     645        return
     646
     647    def update(self):
     648        if not self.context.screening_date:
     649            self.flash(_('Forbidden'), type="warning")
     650            self.redirect(self.url(self.context))
     651
     652    def render(self):
     653        applicantview = ApplicantBaseDisplayFormPage(self.context, self.request)
     654        students_utils = getUtility(IStudentsUtils)
     655        return students_utils.renderPDF(self,'screening_invitation_slip.pdf',
     656            self.context, applicantview, note=self.note)
Note: See TracChangeset for help on using the changeset viewer.