]> wagnertech.de Git - mfinanz.git/blobdiff - SL/ReportGenerator.pm
Parser für besondere Zeichen in special_chars umgeschrieben.
[mfinanz.git] / SL / ReportGenerator.pm
index 965961ac5ca348431d66306d2adf8f89d9203794..988d295e68f2e5eb2c6ca4d00269e8b5523742e7 100644 (file)
@@ -60,34 +60,9 @@ sub new {
 
   $self->set_options(@_) if (@_);
 
-  $self->_init_escaped_strings_map();
-
   return $self;
 }
 
-sub _init_escaped_strings_map {
-  my $self = shift;
-
-  $self->{escaped_strings_map} = {
-    'ä'  => 'ä',
-    'ö'  => 'ö',
-    'ü'  => 'ü',
-    'Ä'  => 'Ä',
-    'Ö'  => 'Ö',
-    'Ü'  => 'Ü',
-    'ß' => 'ß',
-    '>'    => '>',
-     '&lt;'    => '<',
-    '&quot;'  => '"',
-  };
-
-  my $iconv = $main::locale->{iconv_iso8859};
-
-  if ($iconv) {
-    map { $self->{escaped_strings_map}->{$_} = $iconv->convert($self->{escaped_strings_map}->{$_}) } keys %{ $self->{escaped_strings_map} };
-  }
-}
-
 sub set_columns {
   my $self    = shift;
   my %columns = @_;
@@ -277,7 +252,7 @@ sub html_format {
   my $self  = shift;
   my $value = shift;
 
-  $value =  $self->{form}->quote_html($value);
+  $value =  $main::locale->quote_special_chars('HTML', $value);
   $value =~ s/\r//g;
   $value =~ s/\n/<br>/g;
 
@@ -453,8 +428,9 @@ sub render_pdf_with_pdf_api2 {
         push @cell_props, $cell_props_row;
 
         foreach (0 .. $num_columns - 1) {
-          push @{ $cell_props_row }, { 'background_color' => '#000000',
-                                       'font_color'       => '#ffffff', };
+          push @{ $cell_props_row }, { 'background_color' => '#666666',
+                                       'font_color'       => '#ffffff',
+                                       'colspan'          => $_ == 0 ? -1 : undef, };
         }
       }
       next;
@@ -631,7 +607,7 @@ sub verify_paper_size {
   my $requested_paper_size = lc shift;
   my $default_paper_size   = shift;
 
-  my %allowed_paper_sizes  = map { $_ => 1 } qw(a3 a4 letter legal);
+  my %allowed_paper_sizes  = map { $_ => 1 } qw(a3 a4 a5 letter legal);
 
   return $allowed_paper_sizes{$requested_paper_size} ? $requested_paper_size : $default_paper_size;
 }
@@ -766,14 +742,12 @@ sub generate_pdf_content {
 }
 
 sub unescape_string {
-  my $self = shift;
-  my $text = shift;
-
-  foreach my $key (keys %{ $self->{escaped_strings_map} }) {
-    $text =~ s/\Q$key\E/$self->{escaped_strings_map}->{$key}/g;
-  }
+  my $self  = shift;
+  my $text  = shift;
+  my $iconv = $main::locale->{iconv};
 
-  $text =~ s/\Q&amp;\E/&/g;
+  $text     = $main::locale->unquote_special_chars('HTML', $text);
+  $text     = $main::locale->{iconv}->convert($text) if ($main::locale->{iconv});
 
   return $text;
 }