WebDAV: Überflüssigen Aufruf webdav_path im Frontend entfernt
[kivitendo-erp.git] / SL / Form.pm
index 33e0fcb..6f183e9 100644 (file)
@@ -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();
@@ -685,6 +660,16 @@ sub show_generic_error {
 
   $self->{title} = $params{title} if $params{title};
 
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Back'),
+        call      => [ 'kivi.history_back' ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+
   $self->header();
   print $self->parse_html_template("generic/error", $add_params);
 
@@ -1216,7 +1201,7 @@ sub send_email {
                                         id      => $attfile->id,
                                         type    => $attfile->mime_type,
                                         name    => $attfile->file_name,
-                                        content => $attfile->get_content };
+                                        content => $attfile->get_content ? ${ $attfile->get_content } : undef };
     }
   }
   $mail->{message}  =~ s/\r//g;
@@ -1308,6 +1293,7 @@ sub get_formname_translation {
     dunning                 => $main::locale->text('Dunning'),
     letter                  => $main::locale->text('Letter'),
     ic_supply               => $main::locale->text('Intra-Community supply'),
+    statement               => $main::locale->text('Statement'),
   );
 
   $main::lxdebug->leave_sub();