def _badge(self, id): c.fulfilment = Fulfilment.find_by_id(id) xml_s = render('/fulfilment/badge.mako') xsl_f = app_globals.mako_lookup.get_template('/fulfilment/badge.xsl').filename pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) return pdf_data
def pdf(self, id): c.fulfilment_group = FulfilmentGroup.find_by_id(id, True) xml_s = render('/fulfilment_group/pdf.mako') xsl_f = app_globals.mako_lookup.get_template('/fulfilment_group/pdf.xsl').filename pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) filename = klf_info['event_shortname'] + '_' + str(c.fulfilment_group.id) + '.pdf' return pdfgen.wrap_pdf_response(pdf_data, filename)
def pdf(self, id): c.fulfilment_group = FulfilmentGroup.find_by_id(id, True) xml_s = render('/fulfilment_group/pdf.mako') xsl_f = app_globals.mako_lookup.get_template('/fulfilment_group/pdf.xsl').filename pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) filename = Config.get('event_shortname') + '_' + str(c.fulfilment_group.id) + '.pdf' return pdfgen.wrap_pdf_response(pdf_data, filename)
def pdf(self, id): if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_attendee(id), h.auth.has_organiser_role, h.auth.has_unique_key())): # Raise a no_auth error h.auth.no_role() c.invoice = Invoice.find_by_id(id, True) xml_s = render('/invoice/pdf.mako') xsl_f = get_path('zk_root') + '/zkpylons/templates/invoice/pdf.xsl' pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) filename = Config.get('event_shortname') + '_' + str(c.invoice.id) + '.pdf' return pdfgen.wrap_pdf_response(pdf_data, filename)
def pdf(self, id): if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_attendee(id), h.auth.has_organiser_role, h.auth.has_unique_key())): # Raise a no_auth error h.auth.no_role() c.invoice = Invoice.find_by_id(id, True) xml_s = render('/invoice/pdf.mako') xsl_f = file_paths['zk_root'] + '/zkpylons/templates/invoice/pdf.xsl' pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) filename = lca_info['event_shortname'] + '_' + str(c.invoice.id) + '.pdf' return pdfgen.wrap_pdf_response(pdf_data, filename)
def pdf(self, id): if not h.auth.authorized( h.auth.Or(h.auth.is_same_zkpylons_attendee(id), h.auth.has_organiser_role, h.auth.has_unique_key()) ): # Raise a no_auth error h.auth.no_role() c.invoice = Invoice.find_by_id(id, True) xml_s = render("/invoice/pdf.mako") xsl_f = file_paths["zk_root"] + "/zkpylons/templates/invoice/pdf.xsl" pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) filename = lca_info["event_shortname"] + "_" + str(c.invoice.id) + ".pdf" return pdfgen.wrap_pdf_response(pdf_data, filename)
def pdf(self, id): if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_attendee(id), h.auth.has_organiser_role, h.auth.has_unique_key())): # Raise a no_auth error h.auth.no_role() c.fulfilment_group = FulfilmentGroup.find_by_id(id, True) xml_s = render('/fulfilment/boardingpass.mako') xsl_f = file_paths['zk_root'] + '/zkpylons/templates/fulfilment/boardingpass.xsl' pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) if c.fulfilment_group.person: filename = lca_info['event_shortname'] + '_' + str(c.fulfilment_group.person_id) + '.pdf' else: filename = lca_info['event_shortname'] + '_' + str(c.fulfilment_group.id) + '.pdf' return pdfgen.wrap_pdf_response(pdf_data, filename)
def pdf(self, id): if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_attendee(id), h.auth.has_organiser_role, h.auth.has_unique_key())): # Raise a no_auth error h.auth.no_role() c.invoice = Invoice.find_by_id(id, True) xml_s = render('/invoice/pdf.mako') template_path = file_paths['theme_templates'] + '/invoice/pdf.xsl' if(os.path.isfile(template_path)): xsl_f = template_path else: xsl_f = file_paths['zk_root'] + '/zkpylons/templates/invoice/pdf.xsl' pdf_data = pdfgen.generate_pdf(xml_s, xsl_f) filename = lca_info['event_shortname'] + '_' + str(c.invoice.id) + '.pdf' return pdfgen.wrap_pdf_response(pdf_data, filename)