From 0ea99d65cafaa827d3bccbaf6e9ccb8f7458abfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 11 Nov 2015 13:10:59 +0100 Subject: [PATCH] Auftrags-Controller: generate_attachment_filename beim Erzeugen des PDFs nehmen --- SL/Controller/Order.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index aaa31cc19..6f422134a 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -125,9 +125,14 @@ sub action_create_pdf { my $key = join('_', Time::HiRes::gettimeofday(), int rand 1000000000000); $::auth->set_session_value("Order::create_pdf-${key}" => $sfile->file_name); - $::form->{formname} = $self->type; - $::form->{language} = 'de'; - my $pdf_filename = $::form->get_formname_translation . '_' . $self->order->ordnumber . '.pdf'; + my $form = Form->new; + $form->{ordnumber} = $self->order->ordnumber; + $form->{formname} = $self->type; + $form->{type} = $self->type; + $form->{language} = 'de'; + $form->{format} = 'pdf'; + + my $pdf_filename = $form->generate_attachment_filename(); $self->js ->run('download_pdf', $pdf_filename, $key) -- 2.20.1