X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=600e9b81c145c41adef654cdc060188b671a8a49;hb=33d6a85c50f243f1b54b3be9ac8bf5a465ba86c4;hp=3969cbfef301a42e20fe23c066d8f86166e1982e;hpb=3d8c8e2fa8dc160248411314e135b21e92332201;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 3969cbfef..600e9b81c 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -621,7 +621,7 @@ sub parse_html_template { $additional_params ||= { }; my $real_file = $self->_prepare_html_template($file, $additional_params); - my $template = $self->template || $self->init_template; + my $template = $self->template; map { $additional_params->{$_} ||= $self->{$_} } keys %{ $self }; @@ -633,32 +633,7 @@ sub parse_html_template { return $output; } -sub init_template { - my $self = shift; - - return $self->template if $self->template; - - # Force scripts/locales.pl to pick up the exception handling template. - # parse_html_template('generic/exception') - return $self->template(Template->new({ - 'INTERPOLATE' => 0, - 'EVAL_PERL' => 0, - 'ABSOLUTE' => 1, - 'CACHE_SIZE' => 0, - 'PLUGIN_BASE' => 'SL::Template::Plugin', - 'INCLUDE_PATH' => '.:templates/webpages', - 'COMPILE_EXT' => '.tcc', - 'COMPILE_DIR' => $::lx_office_conf{paths}->{userspath} . '/templates-cache', - 'ERROR' => 'templates/webpages/generic/exception.html', - 'ENCODING' => 'utf8', - })) || die; -} - -sub template { - my $self = shift; - $self->{template_object} = shift if @_; - return $self->{template_object}; -} +sub template { $::request->presenter->get_template } sub show_generic_error { $main::lxdebug->enter_sub(); @@ -1102,7 +1077,7 @@ sub parse_template { if ( !$self->{preview} && $ext_for_format eq 'pdf' && $::instance_conf->get_doc_storage) { $self->{attachment_filename} ||= $self->generate_attachment_filename; - $self->{print_file_id} = $self->store_pdf($self); + $self->{print_file_id} = $self->store_pdf($self)->id; } if ($self->{media} eq 'email') { if ( getcwd() eq $self->{"tmpdir"} ) { @@ -1127,10 +1102,10 @@ sub parse_template { sub get_bcc_defaults { my ($self, $myconfig, $mybcc) = @_; -# if (SL::DB::Default->get->bcc_to_login) { -# $mybcc .= ", " if $mybcc; -# $mybcc .= $myconfig->{email}; -# } + if (SL::DB::Default->get->bcc_to_login) { + $mybcc .= ", " if $mybcc; + $mybcc .= $myconfig->{email}; + } my $otherbcc = SL::DB::Default->get->global_bcc; if ($otherbcc) { $mybcc .= ", " if $mybcc; @@ -1212,10 +1187,11 @@ sub send_email { } } foreach my $attfile ( @attfiles ) { - push @{ $mail->{attachments} }, { path => SL::File->get_file_path(dbfile => $attfile), - id => $attfile->id, - type => $attfile->file_mime_type, - name => $attfile->file_name }; + push @{ $mail->{attachments} }, { path => $attfile->get_file, + id => $attfile->id, + type => $attfile->mime_type, + name => $attfile->file_name, + content => $attfile->get_content }; } } $mail->{message} =~ s/\r//g;