X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FSimple.pm;h=c525dabe49e1db83fcc9e6c641ed3be080027c2e;hb=c4ce237aaab9c25c41334c30852d2ea640730efe;hp=8696796bc914b40681cf5e6c379885abf8ff87b4;hpb=7e0814bb34ae9e6c424aa10e37ccb9ca4541fc49;p=kivitendo-erp.git diff --git a/SL/Template/Simple.pm b/SL/Template/Simple.pm index 8696796bc..c525dabe4 100644 --- a/SL/Template/Simple.pm +++ b/SL/Template/Simple.pm @@ -32,8 +32,15 @@ sub new { sub _init { my ($self, %params) = @_; + $params{myconfig} ||= \%::myconfig; + $params{userspath} ||= $::lx_office_conf{paths}->{userspath}; + $self->{$_} = $params{$_} for keys %params; + $self->{variable_content_types} ||= {}; + $self->{variable_content_types}->{$_} = lc $self->{variable_content_types}->{$_} for keys %{ $self->{variable_content_types} }; + $self->{default_variable_content_type} = 'text'; + $self->{error} = undef; $self->{quot_re} = '"'; @@ -135,7 +142,7 @@ sub substitute_vars { my $value = $self->_get_loop_variable($var, 0, @indices); $value = $form->parse_amount({ numberformat => $::myconfig{output_numberformat} || $::myconfig{numberformat} }, $value) if $options{NOFORMAT}; - $value = $self->format_string($value) unless $options{NOESCAPE}; + $value = $self->format_string($value, $var) unless $options{NOESCAPE}; substr($text, $tag_pos, $tag_len, $value); }