X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FReportGenerator.pm;h=7bd935f3da33c922334a892bd91f9aad8224d219;hb=ee356cccfe9374acdc17b74f1d571d8da93789c7;hp=308961cb53602d4888dd2f4e3d71c450fa3a436a;hpb=100907745cbcbb880107cb6a1bbd0395d14093c8;p=kivitendo-erp.git diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index 308961cb5..7bd935f3d 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -1,10 +1,14 @@ package SL::ReportGenerator; +#use strict; + use Encode; use IO::Wrap; use List::Util qw(max); use Text::CSV_XS; use Text::Iconv; +#use PDF::API2; # these two eat up to .75s on startup. only load them if we actually need them +#use PDF::Table; use SL::Form; @@ -371,9 +375,6 @@ sub prepare_html_content { my $allow_pdf_export = $opts->{allow_pdf_export}; - eval { require PDF::API2; require PDF::Table; }; - $allow_pdf_export |= 1 if (! $@); - my $variables = { 'TITLE' => $opts->{title}, 'TOP_INFO_TEXT' => $self->html_format($opts->{top_info_text}), @@ -399,8 +400,6 @@ sub generate_html_content { my $self = shift; my $variables = $self->prepare_html_content(); - $main::lxdebug->dump(0, "VARs", $variables->{HEADER_ROWS}); - return $self->{form}->parse_html_template($self->{options}->{html_template}, $variables); } @@ -443,7 +442,7 @@ sub generate_pdf_content { my $font_encoding = $main::dbcharset || 'ISO-8859-15'; $self->{text_is_utf8} = $font_encoding =~ m/^utf-?8$/i; - foreach $name (@visible_columns) { + foreach my $name (@visible_columns) { push @column_props, { 'justify' => $self->{columns}->{$name}->{align} eq 'right' ? 'right' : 'left' }; } @@ -453,8 +452,8 @@ sub generate_pdf_content { push @data, $data_row; push @cell_props, $cell_props_row; - foreach $name (@visible_columns) { - $column = $self->{columns}->{$name}; + foreach my $name (@visible_columns) { + my $column = $self->{columns}->{$name}; push @{ $data_row }, $self->_decode_text($column->{text}); push @{ $cell_props_row }, {}; @@ -923,7 +922,7 @@ Output format. Used by generate_with_headers to determine the format. Supported =item allow_pdf_export -Used to determine if a button for PDF export should be displayed. Default is yes. The PDF button is hidden if neither the Perl module PDF::API2 nor the external applications html2ps and Ghostscript are available regardless of this parameter's value. +Used to determine if a button for PDF export should be displayed. Default is yes. =item allow_csv_export