Changeset 10686 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 3 Nov 2013, 07:13:05 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r10681 r10686 527 527 return text 528 528 529 def renderPDFAdmissionLetter(self, view, student=None, omit_fields=()): 529 def renderPDFAdmissionLetter(self, view, student=None, omit_fields=(), 530 pre_text=None, post_text=None,): 530 531 """Render pdf admission letter. 531 532 """ … … 549 550 footer_text = "%s - %s - " % (student.student_id, footer_text) 550 551 551 # Admission text 552 html = format_html(self._admissionText(student, portal_language)) 552 # Insert text before student data 553 if pre_text is None: 554 html = format_html(self._admissionText(student, portal_language)) 555 else: 556 html = format_html(pre_text) 553 557 data.append(Paragraph(html, NOTE_STYLE)) 554 558 data.append(Spacer(1, 20)) … … 557 561 data.append(render_student_data(view, omit_fields, lang=portal_language)) 558 562 559 # Insert history563 # Insert text after student data 560 564 data.append(Spacer(1, 20)) 561 datelist = student.history.messages[0].split()[0].split('-') 562 creation_date = u'%s/%s/%s' % (datelist[2], datelist[1], datelist[0]) 563 text = trans(_( 564 'Your Kofa student record was created on ${a}.', 565 mapping = {'a': creation_date}), 566 portal_language) 565 if post_text is None: 566 datelist = student.history.messages[0].split()[0].split('-') 567 creation_date = u'%s/%s/%s' % (datelist[2], datelist[1], datelist[0]) 568 text = trans(_( 569 'Your Kofa student record was created on ${a}.', 570 mapping = {'a': creation_date}), 571 portal_language) 572 else: 573 text = post_text 567 574 html = format_html(text) 568 575 data.append(Paragraph(html, NOTE_STYLE))
Note: See TracChangeset for help on using the changeset viewer.