From: <dai...@us...> - 2010-01-06 04:40:33
|
Revision: 3270 http://web-erp.svn.sourceforge.net/web-erp/?rev=3270&view=rev Author: daintree Date: 2010-01-06 04:40:23 +0000 (Wed, 06 Jan 2010) Log Message: ----------- fix DateFunctions.inc for US format m/d/Y dates the FormatDateForSQL function was munted Modified Paths: -------------- trunk/CustomerBranches.php trunk/EmailCustTrans.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/includes/DateFunctions.inc trunk/includes/SQL_CommonFunctions.inc Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/CustomerBranches.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -577,7 +577,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); - echo "<br><a href='$rootpath/SalesPeople.php?" . SID . "'>"._('Define Sales People').'</a>'; + echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php?"' . SID . '">'._('Define Sales People') . '</a>'; include('includes/footer.inc'); exit; } Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/EmailCustTrans.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -5,6 +5,7 @@ $PageSecurity = 2; include ('includes/session.inc'); +include ('includes/SQL_CommonFunctions.inc'); if ($_GET['InvOrCredit']=='Invoice'){ $TransactionType = _('Invoice'); @@ -15,7 +16,7 @@ } $title=_('Email') . ' ' . $TransactionType . ' ' . _('Number') . ' ' . $_GET['FromTransNo']; -if (isset($_POST['DoIt']) AND strlen($_POST['EmailAddr'])>3){ +if (isset($_POST['DoIt']) AND IsEmailAddress($_POST['EmailAddr'])){ if ($_SESSION['InvoicePortraitFormat']==0){ echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PrintCustTrans.php?' . SID . '&FromTransNo=' . $_POST['TransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . "'>"; @@ -24,20 +25,18 @@ } else { echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PrintCustTransPortrait.php?' . SID . '&FromTransNo=' . $_POST['TransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . "'>"; - prnMsg(_('The transaction should have been emailed off') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ')' . "<a href='" . $rootpath . '/PrintCustTransPortrait.php?' . SID . '&FromTransNo=' . $_POST['FromTransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . "'>" . _('click here') . '</a> ' . _('to email the customer transaction'),'success'); + prnMsg(_('The transaction should have been emailed off. If this does not happen (perhaps the browser does not support META Refresh)') . '<a href="' . $rootpath . '/PrintCustTransPortrait.php?' . SID . '&FromTransNo=' . $_POST['FromTransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . '">' . _('click here') . '</a> ' . _('to email the customer transaction'),'success'); } exit; } elseif (isset($_POST['DoIt'])) { $_GET['InvOrCredit'] = $_POST['InvOrCredit']; $_GET['FromTransNo'] = $_POST['FromTransNo']; - prnMsg(_('The email address entered is too short to be a valid email address') . '. ' . _('The transaction was not emailed'),'warn'); + prnMsg(_('The email address does not appear to be a valid email address. The transaction was not emailed'),'warn'); } include ('includes/header.inc'); - - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; echo "<input type=hidden name='TransNo' VALUE=" . $_GET['FromTransNo'] . ">"; @@ -45,7 +44,6 @@ echo '<p><table>'; - $SQL = "SELECT email FROM custbranch INNER JOIN debtortrans ON custbranch.debtorno= debtortrans.debtorno Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/PrintCustTrans.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -7,8 +7,6 @@ $PageSecurity = 1; -error_reporting (E_ALL); - include('includes/session.inc'); if (isset($_GET['FromTransNo'])) { @@ -45,7 +43,6 @@ and $FromTransNo!=''){ include ('includes/class.pdf.php'); -// define('FPDF_FONTPATH','font/'); require('fpdi/fpdi.php'); /* This invoice is hard coded for A4 Landscape invoices or credit notes so can't use PDFStarter.inc */ @@ -511,17 +508,11 @@ $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','I'); exit; // If EMAIL is selected, send the invoice via email, this is not appending pages yet though - } else if (isset($_GET['Email'])) { - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); - $pdfcode = $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf'); + } elseif (isset($_GET['Email'])) { + $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); } else { - -// Javier: esto tiene que estar mal, si imprime la factura sin adjuntar nada pq llama a concat? // If the appendfile field is empty and EMAIL is not selected, just print the invoice without any appended pages - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); - $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','D'); + $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','I'); exit; } } Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/PrintCustTransPortrait.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -579,14 +579,9 @@ exit; // If EMAIL is selected, send the invoice via email, this is not appending pages yet though } else if (isset($_GET['Email'])) { - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); - $pdfcode = $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf'); + $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); } else { -// Javier: esto tiene que estar mal, si imprime la factura sin adjuntar nada pq llama a concat? // If the appendfile field is empty and EMAIL is not selected, just print the invoice without any appended pages - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','I'); exit; } Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/includes/DateFunctions.inc 2010-01-06 04:40:23 UTC (rev 3270) @@ -5,7 +5,7 @@ /* date validation and parsing functions -These functions refer to the config variable defining the date format +These functions refer to the session variable defining the date format The date format is defined in SystemParameters called DefaultDateFormat this can be a string either 'd/m/Y' for UK/Australia/New Zealand dates or 'm/d/Y' for US/Canada format dates @@ -49,7 +49,7 @@ if (is_long((int)$Date_Array[0]) AND is_long((int)$Date_Array[1]) AND is_long((int)$Date_Array[2])) { - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ if (checkdate((int)$Date_Array[1],(int)$Date_Array[0],(int)$Date_Array[2])){ return 1; @@ -140,7 +140,7 @@ // Returns the timestamp for the financial year end. To find other year ends, -// use $YearIncrement to move back and fgorward. in -1 gives last year end, 1 +// use $YearIncrement to move back and forward. in -1 gives last year end, 1 // gives next year end. function YearEndDate($MonthNo, $YearIncrement) { @@ -416,7 +416,7 @@ } elseif ($_SESSION['DefaultDateFormat']=='d.m.Y') { return $Date_Array[2].'.'.$Date_Array[1].'.'.$Date_Array[0]; } elseif ($_SESSION['DefaultDateFormat']=='m/d/Y') { - return $Date_Array[1].'/'.$Date_Array[2].'/'.$Date_Array[0]; + return $Date_Array[2].'/'.$Date_Array[0].'/'.$Date_Array[1]; } elseif ($_SESSION['DefaultDateFormat']=='Y/m/d') { return $Date_Array[0].'/'.$Date_Array[1].'/'.$Date_Array[2]; } @@ -449,7 +449,7 @@ /*The 0 and 1 elements of the array are switched depending on the format used */ - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ if ( ($Date1_array[1] - $Date2_array[1]) >0){ return 1; } elseif (($Date1_array[1] - $Date2_array[1])==0){ @@ -492,7 +492,7 @@ $Date_Array = explode('.',$TranDate); } - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ if ($DayInFollowingMonth==0){ /*then it must be set up for DaysBeforeDue type */ $DayDue = $Date_Array[0]+$DaysBeforeDue; @@ -559,7 +559,7 @@ $Date_Array = explode('.',$DateToAddTo); } - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ switch ($PeriodString) { case 'd': //Days Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/includes/SQL_CommonFunctions.inc 2010-01-06 04:40:23 UTC (rev 3270) @@ -326,4 +326,4 @@ } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |