From 86d91f0a632a795b32a2a66aa4378bef6b5e6955 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Wed, 23 Jun 2010 14:16:46 +1000 Subject: [PATCH] Considering refactoring the Document generation --- vendors/shells/firstpass.php | 6 ++++-- vendors/shells/vault.php | 2 +- vendors/xtcpdf.php | 19 ++++++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/vendors/shells/firstpass.php b/vendors/shells/firstpass.php index c56915c9..af7db743 100644 --- a/vendors/shells/firstpass.php +++ b/vendors/shells/firstpass.php @@ -117,10 +117,12 @@ class FirstpassShell extends Shell { $check = imap_check($mbox); - + + $number_of_messages = $check->Nmsgs; + echo "Messages after delete: ".$number_of_messages."\n"; - $number_of_messages = $check->Nmsgs; + // } diff --git a/vendors/shells/vault.php b/vendors/shells/vault.php index fa45023b..c10dafd6 100755 --- a/vendors/shells/vault.php +++ b/vendors/shells/vault.php @@ -236,7 +236,7 @@ class VaultShell extends Shell { * */ - function fetchBodyAttachments($mailbox, $msg_number, $email_dir, $ripmime_path) { + function fetchBodyAttachments($mailbox, $msg_number, $email_dir, $uniqid, $ripmime_path) { diff --git a/vendors/xtcpdf.php b/vendors/xtcpdf.php index 8e3326e4..b1b2a946 100755 --- a/vendors/xtcpdf.php +++ b/vendors/xtcpdf.php @@ -181,7 +181,7 @@ class XTCPDF extends TCPDF { //$availableHeight = 253; - $availableHeight = 320; + $availableHeight = 230; $heightLeft = $availableHeight; //height left on this particular page. @@ -240,18 +240,24 @@ class XTCPDF extends TCPDF { //echo "Currently have $heightLeft Comm details height is ".$commDetailsHeight." totals height is: ".$totalsHeight."
"; + $heightLeft -= $totalsHeight; - - if($heightLeft - $totalsHeight <= 0) { + if($heightLeft <= 0) { // echo "
Need a new page for last item and totals"; - array_pop($pageProducts[$pagesRequired]); + //array_pop($pageProducts[$pagesRequired]); $pagesRequired++; $heightLeft = $availableHeight; $heightLeft -= $totalsHeight; - $pageProducts[$pagesRequired][] = $product[$docType]['id']; + //$pageProducts[$pagesRequired][] = $product[$docType]['id']; } - if($heightLeft - $commDetailsHeight <= 0) { + echo "Height left before commDetails is:".$heightLeft; + echo "Comm Details Height is:".$commDetailsHeight; + + $heightLeft -= $commDetailsHeight; + echo "Heigh Left is now:".$heightLeft; + + if($heightLeft <= 0) { $pagesRequired++; } @@ -294,7 +300,6 @@ class XTCPDF extends TCPDF { $options = 0; //Toggled to 1 when we encounter an Optional product. Stops the totals being printed. - echo "FUCK"; print_r($principlesList[0]); foreach ($pageProducts as $page) {