Fixed document mailing.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 1 Apr 2009 14:36:12 +0000 (14:36 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 1 Apr 2009 14:36:12 +0000 (14:36 +0000)
CHANGELOG.txt
reporting/includes/pdf_report.inc

index 83ca0ec2c9a4cf7b6a00379014cd925c49837c2b..92cb1e2f98ab9c1461bbdcc124d3aaad18e77f2b 100644 (file)
@@ -19,6 +19,9 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+01-Apr-2009 Janusz Dobrowolski
+# Fixed document mailing.
+$ /reporting/includes/pdf_report.inc
 ------------------------------- Release 2.1.1 ----------------------------------
 30-Mar-2009 Janusz Dobrowolski
 # Fixed display of unsufficient quantities in sales docs.
index 8c5d5727d42d1d6e11b41f327451c2369c39f1de..b81175a8250d3dfa6b99b538964144d6fc4f778b 100644 (file)
@@ -419,7 +419,7 @@ class FrontReport extends Cpdf
                                {
                                        include("doctext.inc");
                                }
-                               require_once($path_to_root . "reporting/includes/class.mail.inc");
+                               require_once($path_to_root . "/reporting/includes/class.mail.inc");
                        $mail = new email($this->company['coy_name'], $this->company['email']);
                        $from = $this->company['coy_name'] . " <" . $this->company['email'] . ">";
                        $to = $myrow['DebtorName'] . " <" . $myrow['email'] . ">";
@@ -457,14 +457,11 @@ class FrontReport extends Cpdf
                                $msg2 .= nl2br($sender) . "<br>";
                                $msg2 .= "<br>Filepath: " . $fname . "<br>Filename: " . $this->filename . "<br>";
                        }
-                       if ($ret)
-                               $str = "<br>" . $this->title . " " . $myrow['reference'] . " " . _("sent to") . " ";
-                       else
-                               $str = "<br>" . $this->title . " " . $myrow['reference'] . " " . _("NOT sent to") . " ";
-                       $msg2 .= $str . $myrow['DebtorName'] . " - " . $myrow['email'];
-                       echo "<html><body>";
-                       echo $msg2;
-                       echo "</body></html>";
+                               if (!$ret)
+                                       display_error(_("Sending document by email failed"));
+                               else
+                                       display_notification($this->title . " " . $myrow['reference'] . " " 
+                                               . _("has been sent by email."));
                        }
                        else
                        {