Programmierrichtlinien etwas aktualisiert.
[kivitendo-erp.git] / SL / Form.pm
index b112ea7..3075968 100644 (file)
@@ -57,6 +57,7 @@ use SL::Template;
 use SL::User;
 use Template;
 use List::Util qw(first max min sum);
+use List::MoreUtils qw(any);
 
 my $standard_dbh;
 
@@ -255,7 +256,7 @@ sub _recode_recursively {
   $main::lxdebug->enter_sub();
   my ($iconv, $param) = @_;
 
-  if (ref $param eq 'HASH') {
+  if (any { ref $param eq $_ } qw(Form HASH)) {
     foreach my $key (keys %{ $param }) {
       if (!ref $param->{$key}) {
         $param->{$key} = $iconv->convert($param->{$key});
@@ -1194,7 +1195,7 @@ sub parse_template {
 
   if ($self->{"format"} =~ /(opendocument|oasis)/i) {
     $template       = OpenDocumentTemplate->new($self->{"IN"}, $self, $myconfig, $userspath);
-    $ext_for_format = 'odt';
+    $ext_for_format = $self->{"format"} =~ m/pdf/ ? 'pdf' : 'odt';
 
   } elsif ($self->{"format"} =~ /(postscript|pdf)/i) {
     $ENV{"TEXINPUTS"} = ".:" . getcwd() . "/" . $myconfig->{"templates"} . ":" . $ENV{"TEXINPUTS"};