Changeset 15880 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 11 Dec 2019, 12:02:09 (5 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r15865 r15880 22 22 import pytz 23 23 import sys 24 import os 24 25 import textwrap 25 26 from cStringIO import StringIO … … 543 544 def render(self): 544 545 students_utils = getUtility(IStudentsUtils) 546 letterhead_path = os.path.join( 547 os.path.dirname(__file__), 'static', 'letterhead_admission.jpg') 548 if not os.path.exists(letterhead_path): 549 letterhead_path = None 545 550 return students_utils.renderPDFAdmissionLetter(self, 546 self.context.student, omit_fields=self.omit_fields) 551 self.context.student, omit_fields=self.omit_fields, 552 letterhead_path=letterhead_path) 547 553 548 554 class StudentBaseManageFormPage(KofaEditFormPage): -
main/waeup.kofa/trunk/src/waeup/kofa/students/fileviewlets.py
r15833 r15880 24 24 IExtFileStore, IFileStoreNameChooser, IKofaObject, IKofaUtils) 25 25 from waeup.kofa.utils.helpers import string_from_bytes, file_size 26 from waeup.kofa.browser import DEFAULT_IMAGE_PATH27 26 28 27 from waeup.kofa.students.interfaces import IStudent, IStudentsUtils -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r15790 r15880 145 145 146 146 def renderPDFAdmissionLetter(view, student=None, omit_fields=(), 147 pre_text=None, post_text=None,): 147 pre_text=None, post_text=None, 148 letterhead_path=None): 148 149 """Render pdf admission letter. 149 150 """ -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r15879 r15880 859 859 860 860 def renderPDFAdmissionLetter(self, view, student=None, omit_fields=(), 861 pre_text=None, post_text=None,): 861 pre_text=None, post_text=None, 862 letterhead_path=None): 862 863 """Render pdf admission letter. 863 864 """ … … 865 866 return 866 867 style = getSampleStyleSheet() 867 creator = self.getPDFCreator(student) 868 if letterhead_path: 869 creator = getUtility(IPDFCreator, name='letter') 870 else: 871 creator = getUtility(IPDFCreator) 868 872 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 869 873 data = [] … … 912 916 pdf_stream = creator.create_pdf( 913 917 data, None, doc_title, author=author, footer=footer_text, 914 note=post_text )918 note=post_text, letterhead_path=letterhead_path) 915 919 return pdf_stream 916 920
Note: See TracChangeset for help on using the changeset viewer.