Revision f0ce00eb
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/ReportGenerator.pm | ||
---|---|---|
161 | 161 |
sub generate_with_headers { |
162 | 162 |
my $self = shift; |
163 | 163 |
my $format = lc $self->{options}->{output_format}; |
164 |
my $form = $self->{form}; |
|
164 | 165 |
|
165 | 166 |
if (!$self->{columns}) { |
166 |
$self->{form}->error('Incorrect usage -- no columns specified');
|
|
167 |
$form->error('Incorrect usage -- no columns specified');
|
|
167 | 168 |
} |
168 | 169 |
|
169 | 170 |
my $filename = $self->{options}->{attachment_basename} || 'report'; |
... | ... | |
171 | 172 |
$filename =~ s|.*/||; |
172 | 173 |
|
173 | 174 |
if ($format eq 'html') { |
174 |
$self->{form}->{title} = $self->{title}; |
|
175 |
$self->{form}->header(); |
|
175 |
my $title = $form->{title}; |
|
176 |
$form->{title} = $self->{title} if ($self->{title}); |
|
177 |
$form->header(); |
|
178 |
$form->{title} = $title; |
|
179 |
|
|
176 | 180 |
print $self->generate_html_content(); |
177 | 181 |
|
178 | 182 |
} elsif ($format eq 'csv') { |
... | ... | |
184 | 188 |
$self->generate_pdf_content(); |
185 | 189 |
|
186 | 190 |
} else { |
187 |
$self->{form}->error('Incorrect usage -- unknown format (supported are HTML, CSV, PDF)');
|
|
191 |
$form->error('Incorrect usage -- unknown format (supported are HTML, CSV, PDF)');
|
|
188 | 192 |
} |
189 | 193 |
} |
190 | 194 |
|
Auch abrufbar als: Unified diff
1. $form->{title} wird nicht mehr zwangsweise umgeschrieben und nach $form->header() wiederhergestellt.
2. Kosmetik: lokale Variable $form anstelle von $self->{form}.