Ignore:
Timestamp:
6 Nov 2012, 05:58:48 (12 years ago)
Author:
Henrik Bettermann
Message:

Customize renderPDF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r9520 r9549  
    209209    def renderPDF(self, view, filename='slip.pdf', student=None,
    210210                  studentview=None, tableheader=None, tabledata=None,
    211                   note=None, signatures=None):
     211                  note=None, signatures=None, sig_in_footer=False):
    212212        """Render pdf slips for various pages.
    213213        """
     
    245245        #data.extend(docs_as_flowables(view, portal_language))
    246246
     247        # Insert history
     248        if filename.startswith('clearance') or filename.startswith('course'):
     249            hist_translation = trans(_('Workflow History'), portal_language)
     250            data.append(Paragraph(hist_translation, style["Heading3"]))
     251            data.extend(creator.fromStringList(student.history.messages))
     252
    247253       # Insert content table (optionally on second page)
    248254        if tabledata and tableheader:
     
    254260
    255261        # Insert signatures
    256         if signatures:
     262        if signatures and not sig_in_footer:
    257263            data.append(Spacer(1, 20))
    258264            signaturetable = get_signature_table(signatures)
    259265            data.append(signaturetable)
    260 
    261         # Insert history
    262         if filename.startswith('clearance') or filename.startswith('course'):
    263             data.append(Spacer(1, 20))
    264             hist_translation = trans(_('Workflow History'), portal_language)
    265             data.append(Paragraph(hist_translation, style["Heading3"]))
    266             data.extend(creator.fromStringList(student.history.messages))
    267266
    268267        view.response.setHeader(
     
    271270            pdf_stream = creator.create_pdf(
    272271                data, None, doc_title, author=author, footer=footer_text,
    273                 note=note)
     272                note=note, sig_in_footer=sig_in_footer)
    274273        except IOError:
    275274            view.flash('Error in image file.')
Note: See TracChangeset for help on using the changeset viewer.