- Timestamp:
- 28 Jun 2016, 11:25:21 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py
r13977 r13996 20 20 import grok 21 21 import os 22 from zope.component import getUtility 22 from zope.component import getUtility, getAdapter 23 from zope.i18n import translate 23 24 from waeup.kofa.interfaces import ( 24 IExtFileStore, IFileStoreNameChooser )25 IExtFileStore, IFileStoreNameChooser, IKofaUtils) 25 26 from zope.formlib.textwidgets import BytesDisplayWidget 26 27 from waeup.kofa.utils.helpers import string_from_bytes, file_size 27 from waeup.kofa.applicants.browser import ApplicantCheckStatusPage 28 from waeup.kofa.applicants.browser import ( 29 ApplicantCheckStatusPage, ApplicantBaseDisplayFormPage) 28 30 from waeup.kofa.applicants.viewlets import PDFActionButton 31 from waeup.kofa.browser.layout import UtilityView 32 from waeup.kofa.students.interfaces import IStudentsUtils 33 from waeup.kofa.interfaces import IPDF 34 from waeup.kofa.applicants.interfaces import IApplicant 29 35 from waeup.aaue.interfaces import MessageFactory as _ 30 36 from kofacustom.nigeria.applicants.browser import ( … … 40 46 ICustomUGApplicant, 41 47 ICustomUGApplicantEdit, 42 ITranscriptApplicant 48 ITranscriptApplicant, 49 ICustomApplicant 43 50 ) 44 51 … … 88 95 'course1', 89 96 'master_sheet_number', 97 'screening_venue', 98 'screening_score', 99 'screening_date' 90 100 ) 91 101 … … 333 343 """ 334 344 grok.template('applicantcheckstatus') 345 346 347 class ExportScreeningInvitationLetter(UtilityView, grok.View): 348 """Deliver a slip with only screening data. 349 This form page is available only in AAUE. 350 """ 351 grok.context(IApplicant) 352 grok.name('screening_invitation.pdf') 353 grok.require('waeup.viewApplication') 354 prefix = 'form' 355 356 label = u'Screening Invitation Letter' 357 358 form_fields = [] 359 360 @property 361 def note(self): 362 if self.context.screening_date: 363 return """ 364 <br /><br /><br /><br /><font size='12'> 365 Dear %s, 366 <br /><br /><br /> 367 You are invited for your screening exercise on: 368 <br /><br /> 369 <strong>%s</strong>. 370 <br /><br /> 371 Please bring along this letter of invitation to the %s 372 <br /><br /> 373 on your screening date. 374 <br /><br /><br /> 375 Signed, 376 <br /><br /> 377 xyz<br /> 378 </font> 379 380 """ % (self.context.display_fullname, 381 self.context.screening_date, 382 self.context.screening_venue) 383 return 384 385 @property 386 def title(self): 387 return None 388 389 def update(self): 390 if not self.context.screening_date: 391 self.flash(_('Forbidden'), type="warning") 392 self.redirect(self.url(self.context)) 393 394 def render(self): 395 applicantview = ApplicantBaseDisplayFormPage(self.context, self.request) 396 students_utils = getUtility(IStudentsUtils) 397 return students_utils.renderPDF(self,'screening_data.pdf', 398 self.context, applicantview, note=self.note)
Note: See TracChangeset for help on using the changeset viewer.