X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDN.pm;h=b64e48ce651109f53278933710f680c4a4b454a7;hb=9b36c5639d01f1c9059381c12fac5d57ff614710;hp=8eb407b60d1bba0b5d98865665e88d1c9812a2c1;hpb=a4d740099476b4383a40a21ab5472e75806f3f4f;p=kivitendo-erp.git diff --git a/SL/DN.pm b/SL/DN.pm index 8eb407b60..b64e48ce6 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -36,6 +36,7 @@ package DN; use SL::Common; use SL::DBUtils; +use SL::DB::Default; use SL::GenericTranslations; use SL::IS; use SL::Mailer; @@ -368,7 +369,6 @@ sub send_email { my $template = SL::Template::create(type => 'PlainText', form => $form, myconfig => $myconfig); my $mail = Mailer->new(); - $mail->{charset} = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET; $mail->{from} = $myconfig->{email}; $mail->{to} = $ref->{recipient}; $mail->{subject} = $template->parse_block($ref->{email_subject}); @@ -394,7 +394,9 @@ sub set_template_options { my ($self, $myconfig, $form) = @_; - $form->{templates} = "$myconfig->{templates}"; + my $defaults = SL::DB::Default->get; + $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; + $form->{templates} = $defaults->templates; $form->{language} = $form->get_template_language($myconfig); $form->{printer_code} = $form->get_printer_code($myconfig); @@ -433,7 +435,7 @@ sub set_template_options { $form->{IN} = undef; for my $filename (@template_files) { - if (-f "$form->{templates}/$filename") { + if (-f ($defaults->templates . "/$filename")) { $form->{IN} = $filename; last; }