Changeset 9945 for main


Ignore:
Timestamp:
13 Feb 2013, 10:19:34 (12 years ago)
Author:
Henrik Bettermann
Message:

Add 'IN AFFILIATION WITH UNIVERSITY OF IBADAN' on admission slip.

File:
1 edited

Legend:

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

    r9780 r9945  
    1818import grok
    1919from zope.i18n import translate
     20from zope.component import getUtility
    2021from hurry.workflow.interfaces import IWorkflowInfo
    21 from waeup.kofa.interfaces import ADMITTED
     22from waeup.kofa.interfaces import ADMITTED, IKofaUtils
    2223from waeup.kofa.interfaces import MessageFactory as _
    2324from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
    24 from waeup.kofa.students.browser import StartClearancePage, BedTicketAddPage
     25from waeup.kofa.students.browser import (
     26    StartClearancePage, BedTicketAddPage, ExportPDFAdmissionSlipPage)
    2527from kofacustom.nigeria.students.browser import (
    2628    NigeriaOnlinePaymentDisplayFormPage,
     
    3133
    3234from waeup.fceokene.students.interfaces import ICustomStudentOnlinePayment
     35
     36class CustomExportPDFAdmissionSlipPage(ExportPDFAdmissionSlipPage):
     37    """Deliver a PDF Admission slip.
     38    """
     39
     40    @property
     41    def label(self):
     42        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     43        return translate(_('Admission Letter of'),
     44            'waeup.kofa', target_language=portal_language) \
     45            + ' %s' % self.context.display_fullname
     46
     47    @property
     48    def label(self):
     49        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
     50        lang = self.request.cookies.get('kofa.language', portal_language)
     51        line0 = ''
     52        if self.context.student.current_mode.startswith('ug'):
     53            line0 = 'IN AFFILIATION WITH UNIVERSITY OF IBADAN\n'
     54        line1 = translate(_('Admission Letter of'),
     55            'waeup.kofa', target_language=portal_language) \
     56            + ' %s' % self.context.display_fullname
     57        return '%s%s' % (line0, line1)
    3358
    3459class CustomOnlinePaymentDisplayFormPage(NigeriaOnlinePaymentDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.