X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=5a2ad92031dda916cc4e10ab1f2a9b4249b64341;hb=2868feee8fb33457e7562f02778186b5b5c1a2b6;hp=5d00a1c9005979184d22dfcc9141d98df5a3d18b;hpb=6c56877d1497223a3515dea602de77330626a7bd;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 5d00a1c90..5a2ad9203 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -222,7 +222,7 @@ sub new { $self->{action} = lc $self->{action}; $self->{action} =~ s/( |-|,|\#)/_/g; - $self->{version} = "2.4.3"; + $self->{version} = "2.6.0 beta 1"; $main::lxdebug->leave_sub(); @@ -617,15 +617,15 @@ sub header { - + @@ -771,6 +771,8 @@ sub parse_html_template { } sub show_generic_error { + $main::lxdebug->enter_sub(); + my ($self, $error, %params) = @_; my $add_params = { @@ -797,10 +799,14 @@ sub show_generic_error { $self->header(); print $self->parse_html_template("generic/error", $add_params); + $main::lxdebug->leave_sub(); + die("Error: $error\n"); } sub show_generic_information { + $main::lxdebug->enter_sub(); + my ($self, $text, $title) = @_; my $add_params = { @@ -813,6 +819,8 @@ sub show_generic_information { $self->header(); print $self->parse_html_template("generic/information", $add_params); + $main::lxdebug->leave_sub(); + die("Information: $error\n"); } @@ -1111,9 +1119,7 @@ sub parse_template { map { $self->{"employee_${_}"} = $myconfig->{$_}; } qw(email tel fax name signature company address businessnumber co_ustid taxnumber duns); } - map({ $self->{"${_}"} = $myconfig->{$_}; } - qw(co_ustid)); - + map { $self->{"${_}"} = $myconfig->{$_}; } qw(co_ustid); $self->{copies} = 1 if (($self->{copies} *= 1) <= 0); @@ -1308,14 +1314,19 @@ sub generate_attachment_filename { my $attachment_filename = $main::locale->unquote_special_chars('HTML', $self->get_formname_translation()); my $prefix = $self->get_number_prefix_for_type(); - if ($attachment_filename && $self->{"${prefix}number"}) { + if ($self->{preview} && (first { $self->{type} eq $_ } qw(invoice credit_note))) { + $attachment_filename .= ' (' . $main::locale->text('Preview') . ')' . $self->get_extension_for_format(); + + } elsif ($attachment_filename && $self->{"${prefix}number"}) { $attachment_filename .= "_" . $self->{"${prefix}number"} . $self->get_extension_for_format(); - $attachment_filename = $main::locale->quote_special_chars('filenames', $attachment_filename); - $attachment_filename =~ s|[\s/\\]+|_|g; + } else { $attachment_filename = ""; } + $attachment_filename = $main::locale->quote_special_chars('filenames', $attachment_filename); + $attachment_filename =~ s|[\s/\\]+|_|g; + return $attachment_filename; }