Changeset 13898 for main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
- Timestamp:
- 9 Jun 2016, 12:36:41 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r13797 r13898 55 55 ('INNERGRID', (0,0), (-1,-1), 0.25, colors.black), 56 56 ('BOX', (0,0), (-1,-1), 1, colors.black), 57 58 57 ] 59 58 … … 936 935 return pdf_stream 937 936 937 def renderPDFCourseticketsOverview( 938 self, view, session, table_data, lecturers): 939 filename = 'coursetickets_%s_%s_%s.pdf' % ( 940 view.context.code, session, view.request.principal.id) 941 session = academic_sessions_vocab.getTerm(session).title 942 creator = getUtility(IPDFCreator) 943 style = getSampleStyleSheet() 944 pdf_data = [Table(table_data, style=CONTENT_STYLE)] 945 doc_title = translate( 946 _('${a} - Session ${b}\n' 947 'Lecturer(s): ${c}', 948 mapping = {'a':view.context.code, 'b':session, 'c':lecturers})) 949 author = '%s (%s)' % (view.request.principal.title, 950 view.request.principal.id) 951 view.response.setHeader( 952 'Content-Type', 'application/pdf') 953 view.response.setHeader( 954 'Content-Disposition:', 'attachment; filename="%s' % filename) 955 pdf_stream = creator.create_pdf( 956 pdf_data, None, doc_title, author, doc_title + ' -' 957 ) 958 return pdf_stream 959 938 960 def maxCredits(self, studylevel): 939 961 """Return maximum credits.
Note: See TracChangeset for help on using the changeset viewer.