Beim Versenden per Email eine anständige Überschrift anzeigen und nicht "email oe".
[kivitendo-erp.git] / SL / Form.pm
index d43e51f..d1dbfb6 100644 (file)
@@ -181,7 +181,7 @@ sub new {
   $self->{action} = lc $self->{action};
   $self->{action} =~ s/( |-|,|\#)/_/g;
 
-  $self->{version}   = "2.4.2";
+  $self->{version}   = "2.4.3";
 
   $main::lxdebug->leave_sub();
 
@@ -690,7 +690,9 @@ sub redirect {
 
   if ($self->{callback}) {
 
-    ($script, $argv) = split(/\?/, $self->{callback});
+    ($script, $argv) = split(/\?/, $self->{callback}, 2);
+    $script =~ s|.*/||;
+    $script =~ s|[^a-zA-Z_\.]||g;
     exec("perl", "$script", $argv);
 
   } else {
@@ -980,8 +982,10 @@ Content-Length: $numbytes
   $main::lxdebug->leave_sub();
 }
 
-sub generate_attachment_filename {
-  my ($self) = @_;
+sub get_formname_translation {
+  my ($self, $formname) = @_;
+
+  $formname ||= $self->{formname};
 
   my %formname_translations = (
      bin_list            => $main::locale->text('Bin List'),
@@ -998,7 +1002,13 @@ sub generate_attachment_filename {
      storno_packing_list => $main::locale->text('Storno Packing List'),
   );
 
-  my $attachment_filename = $formname_translations{$self->{"formname"}};
+  return $formname_translations{$formname}
+}
+
+sub generate_attachment_filename {
+  my ($self) = @_;
+
+  my $attachment_filename = $self->get_formname_translation();
   my $prefix = 
       (grep { $self->{"type"} eq $_ } qw(invoice credit_note)) ? "inv"
     : ($self->{"type"} =~ /_quotation$/)                       ? "quo"