Scanne auch das Verzeichnis sql/Pg-upgrade nach Perl-Scripten und parse diese nach...
[kivitendo-erp.git] / SL / Form.pm
index e0a3d23..96d0adc 100644 (file)
@@ -778,6 +778,7 @@ sub parse_template {
       $mail->{to}     = qq|$self->{email}|;
       $mail->{from}   = qq|"$myconfig->{name}" <$myconfig->{email}>|;
       $mail->{fileid} = "$fileid.";
+      $myconfig->{signature} =~ s/\\r\\n/\\n/g;
 
       # if we send html or plain text inline
       if (($self->{format} eq 'html') && ($self->{sendmode} eq 'inline')) {
@@ -785,7 +786,7 @@ sub parse_template {
 
         $mail->{message}       =~ s/\r\n/<br>\n/g;
         $myconfig->{signature} =~ s/\\n/<br>\n/g;
-        $mail->{message} .= "<br>\n--<br>\n$myconfig->{signature}\n<br>";
+        $mail->{message} .= "<br>\n-- <br>\n$myconfig->{signature}\n<br>";
 
         open(IN, $self->{tmpfile})
           or $self->error($self->cleanup . "$self->{tmpfile} : $!");
@@ -799,8 +800,9 @@ sub parse_template {
 
         @{ $mail->{attachments} } = ($self->{tmpfile}) unless ($form->{do_not_attach});
 
-        $myconfig->{signature} =~ s/\\n/\r\n/g;
-        $mail->{message} .= "\r\n--\r\n$myconfig->{signature}";
+        $mail->{message}       =~ s/\r\n/\n/g;
+        $myconfig->{signature} =~ s/\\n/\n/g;
+        $mail->{message} .= "\n-- \n$myconfig->{signature}";
 
       }
 
@@ -1208,7 +1210,7 @@ sub get_shipto {
 
 
     my $query = qq|SELECT s.* FROM shipto s
-                  WHERE s.id = $self->{shipto_id}|;
+                  WHERE s.shipto_id = $self->{shipto_id}|;
     my $sth = $dbh->prepare($query);
     $sth->execute || $self->dberror($query);
     $ref = $sth->fetchrow_hashref(NAME_lc);
@@ -1235,7 +1237,6 @@ sub add_shipto {
     }
     $self->{"shipto$item"} =~ s/\'/\'\'/g;
   }
-
   if ($shipto) {
     if ($self->{shipto_id}) {
       my $query = qq| UPDATE shipto set
@@ -1250,7 +1251,7 @@ sub add_shipto {
                       shiptophone = '$self->{shiptophone}',
                       shiptofax = '$self->{shiptofax}',
                       shiptoemail = '$self->{shiptoemail}'
-                      WHERE id = $self->{shipto_id}|;
+                      WHERE shipto_id = $self->{shipto_id}|;
       $dbh->do($query) || $self->dberror($query);
     } else {
       my $query =