From: Sven Schöling Date: Fri, 2 Oct 2015 12:08:33 +0000 (+0200) Subject: Druck: Bei template-toolkit auch die globals setzen X-Git-Tag: release-3.4.1~671 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d56c9b0850c73bceeeadc534836c8164928cff71;p=kivitendo-erp.git Druck: Bei template-toolkit auch die globals setzen --- diff --git a/SL/Form.pm b/SL/Form.pm index 9c6a3a8f1..28e50a2c7 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -584,6 +584,17 @@ sub set_standard_title { $::lxdebug->leave_sub; } +sub prepare_global_vars { + my ($self) = @_; + + $self->{AUTH} = $::auth; + $self->{INSTANCE_CONF} = $::instance_conf; + $self->{LOCALE} = $::locale; + $self->{LXCONFIG} = $::lx_office_conf; + $self->{LXDEBUG} = $::lxdebug; + $self->{MYCONFIG} = \%::myconfig; +} + sub _prepare_html_template { $main::lxdebug->enter_sub(); diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index 31cb28fb3..6ec4d96a3 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -437,6 +437,8 @@ sub parse { $contents = "[% TAGS $self->{tag_start} $self->{tag_end} %]\n" . $contents; } + $form->prepare_global_vars; + $::form->init_template->process(\$contents, $form, \$new_contents) || die $::form->template->error; } else { $new_contents = $self->parse_block($contents);