Locales Quoting war fehlerhaft.
[kivitendo-erp.git] / SL / Form.pm
index 71fadb5..a6b21e2 100644 (file)
@@ -57,7 +57,7 @@ use List::Util qw(first max min sum);
 
 my $standard_dbh;
 
-sub DESTROY {
+END {
   if ($standard_dbh) {
     $standard_dbh->disconnect();
     undef $standard_dbh;
@@ -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 {
 
   <meta name="robots" content="noindex,nofollow" />
   <script type="text/javascript" src="js/highlight_input.js"></script>
-  <link rel="stylesheet" type="text/css" href="css/tabcontent.css" />
 
+  <link rel="stylesheet" type="text/css" href="css/tabcontent.css" />
   <script type="text/javascript" src="js/tabcontent.js">
 
   /***********************************************
-  * Tab Content script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
-  * This notice MUST stay intact for legal use
-  * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
-  ***********************************************/
+   * Tab Content script v2.2- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
+   * This notice MUST stay intact for legal use
+   * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
+   ***********************************************/
 
   </script>
 
@@ -1119,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);
 
@@ -1316,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;
 }