use SL::Form;
+# Cause locales.pl to parse these files:
+# parse_html_template('report_generator/html_report')
+# parse_html_template('report_generator/pdf_report')
+
sub new {
my $type = shift;
'output_format' => 'HTML',
'allow_pdf_export' => 1,
'allow_csv_export' => 1,
+ 'html_template' => 'report_generator/html_report',
+ 'pdf_template' => 'report_generator/pdf_report',
'pdf_export' => {
'paper_size' => 'A4',
'orientation' => 'landscape',
sub generate_html_content {
my $self = shift;
my $variables = $self->prepare_html_content();
- my $report_template = $self->{form}->{report_template} ? $self->{form}->{report_template} : 'report_generator/html_report';
- # $form->parse_html_template('report_generator/html_report', $variables));
- return $self->{form}->parse_html_template($report_template, $variables);
+
+ return $self->{form}->parse_html_template($self->{options}->{html_template}, $variables);
}
sub verify_paper_size {
my $form = $self->{form};
my $myconfig = $self->{myconfig};
my $opt = $self->{options}->{pdf_export};
- my $report_template = $form->{report_template} ? $form->{report_template} : 'report_generator/pdf_report';
my $opt_number = $opt->{number} ? 'number : 1' : '';
my $opt_landscape = $opt->{orientation} eq 'landscape' ? 'landscape : 1' : '';
unlink $cfg_file_name;
$form->error($locale->text('Could not write the temporary HTML file.'));
}
- # $form->parse_html_template('report_generator/pdf_report', $variables));
- $html_file->print($form->parse_html_template($report_template, $variables));
+
+ $html_file->print($form->parse_html_template($self->{options}->{pdf_template}, $variables));
$html_file->close();
my $cmdline =