Revision ecb5cd9f
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/ReportGenerator.pm | ||
---|---|---|
158 | 158 |
}; |
159 | 159 |
} |
160 | 160 |
|
161 |
sub get_attachment_basename { |
|
162 |
my $self = shift; |
|
163 |
my $filename = $self->{options}->{attachment_basename} || 'report'; |
|
164 |
$filename =~ s|.*\\||; |
|
165 |
$filename =~ s|.*/||; |
|
166 |
|
|
167 |
return $filename; |
|
168 |
} |
|
169 |
|
|
161 | 170 |
sub generate_with_headers { |
162 | 171 |
my $self = shift; |
163 | 172 |
my $format = lc $self->{options}->{output_format}; |
... | ... | |
167 | 176 |
$form->error('Incorrect usage -- no columns specified'); |
168 | 177 |
} |
169 | 178 |
|
170 |
my $filename = $self->{options}->{attachment_basename} || 'report'; |
|
171 |
$filename =~ s|.*\\||; |
|
172 |
$filename =~ s|.*/||; |
|
173 |
|
|
174 | 179 |
if ($format eq 'html') { |
175 | 180 |
my $title = $form->{title}; |
176 | 181 |
$form->{title} = $self->{title} if ($self->{title}); |
... | ... | |
180 | 185 |
print $self->generate_html_content(); |
181 | 186 |
|
182 | 187 |
} elsif ($format eq 'csv') { |
188 |
my $filename = $self->get_attachment_basename(); |
|
183 | 189 |
print qq|content-type: text/csv\n|; |
184 | 190 |
print qq|content-disposition: attachment; filename=${filename}.csv\n\n|; |
185 | 191 |
$self->generate_csv_content(); |
... | ... | |
385 | 391 |
my $content; |
386 | 392 |
|
387 | 393 |
if (!$printer_command) { |
394 |
my $filename = $self->get_attachment_basename(); |
|
388 | 395 |
print qq|content-type: application/pdf\n|; |
389 | 396 |
print qq|content-disposition: attachment; filename=${filename}.pdf\n\n|; |
390 | 397 |
|
Auch abrufbar als: Unified diff
Durch das Verschieben der Headerausgabe beim PDF-Export wurde der Name des Attachments nicht richtig gesetzt (jeweils nur '.pdf'). Fix für Bug 681.