From: <ice...@us...> - 2013-07-26 02:33:47
|
Revision: 6146 http://sourceforge.net/p/web-erp/reponame/6146 Author: icedlava Date: 2013-07-26 02:33:44 +0000 (Fri, 26 Jul 2013) Log Message: ----------- Fix PO PDF Preview when $result returns Bool in some environments. Outputs error to browser and prevents PDF output. Modified Paths: -------------- trunk/PO_PDFPurchOrder.php Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2013-07-25 06:36:51 UTC (rev 6145) +++ trunk/PO_PDFPurchOrder.php 2013-07-26 02:33:44 UTC (rev 6146) @@ -226,7 +226,7 @@ include('includes/PO_PDFOrderPageHeader.inc'); $YPos = $Page_Height - $FormDesign->Data->y; $OrderTotal = 0; - while ((isset($OrderNo) AND $OrderNo == 'Preview') OR (isset($result) AND $POLine = DB_fetch_array($result))) { + while ((isset($OrderNo) AND $OrderNo == 'Preview') OR (isset($result) AND !is_bool($result) AND $POLine = DB_fetch_array($result))) { /* If we are previewing the order then fill the * order line with dummy data */ if ($OrderNo == 'Preview') { @@ -328,18 +328,18 @@ $mail->setSubject(_('Purchase Order Number') . ' ' . $OrderNo); $mail->addAttachment($attachment, $PdfFileName, 'application/pdf'); //since sometime the mail server required to verify the users, so must set this information. - if($_SESSION['SmtpSetting'] == 0){//use the mail service provice by the server. + if($_SESSION['SmtpSetting'] == 0){//use the mail service provice by the server. $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); $Success = $mail->send(array($_POST['EmailTo'])); }else if($_SESSION['SmtpSetting'] == 1) { $Success = SendmailBySmtp($mail,array($_POST['EmailTo'])); - + }else{ prnMsg(_('The SMTP settings are wrong, please ask administrator for help'),'error'); exit; include('includes/footer.inc'); } - + if ($Success == 1) { $Title = _('Email a Purchase Order'); include('includes/header.inc'); |