From 8a5f68de9c90b1aaf702d6c984756eaea5095b94 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 22 Feb 2013 12:21:49 +0100 Subject: [PATCH 1/2] Fix: wrong hidden --- htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index a88d2ca06f4..f402045a471 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -323,11 +323,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPage($pagenb); if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1); } $this->_pagefoot($pdf,$object,$outputlangs,1); $pagenb++; @@ -355,12 +355,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Show square if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 1); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 1); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1; } From 7d0f02eb8b1bcf73297d639b60f3f8bf0ce75b12 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 22 Feb 2013 13:14:04 +0100 Subject: [PATCH 2/2] Fix: pdf models are unstable and time consuming. --- .../livraison/pdf/pdf_typhon.modules.php | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index f402045a471..0e65800698a 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -214,7 +214,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,0); $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?22:10); $tab_height = 130; $tab_height_newpage = 150; @@ -252,7 +252,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext); // The only function to edit the bottom margin of current page to set it. $pageposbefore=$pdf->getPage(); // Description of product line @@ -323,11 +323,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPage($pagenb); if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); } $this->_pagefoot($pdf,$object,$outputlangs,1); $pagenb++; @@ -355,12 +355,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Show square if ($pagenb == 1) { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 1); + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1; } else { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 1); + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1); $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1; } @@ -472,25 +472,32 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Rect prend une longueur en 3eme param $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height); // line prend une position y en 3eme param - $pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6); + if (empty($hidetop)) + $pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6); $pdf->SetTextColor(0,0,0); $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($this->posxdesc-1, $tab_top+1); - $pdf->MultiCell(80,2, $outputlangs->transnoentities("Designation"),'','L'); + if (empty($hidetop)) { + $pdf->SetXY($this->posxdesc-1, $tab_top+1); + $pdf->MultiCell(80,2, $outputlangs->transnoentities("Designation"),'','L'); + } // Modif SEB pour avoir une col en plus pour les commentaires clients $pdf->line($this->posxcomm, $tab_top, $this->posxcomm, $tab_top + $tab_height); - $pdf->SetXY($this->posxcomm, $tab_top+1); - $pdf->MultiCell(80,2, $outputlangs->transnoentities("Comments"),'','L'); + if (empty($hidetop)) { + $pdf->SetXY($this->posxcomm, $tab_top+1); + $pdf->MultiCell(80,2, $outputlangs->transnoentities("Comments"),'','L'); + } // Qty $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); - $pdf->SetXY($this->posxqty-1, $tab_top+1); - $pdf->MultiCell(30, 2, $outputlangs->transnoentities("QtyShipped"),'','R'); + if (empty($hidetop)) { + $pdf->SetXY($this->posxqty-1, $tab_top+1); + $pdf->MultiCell(30, 2, $outputlangs->transnoentities("QtyShipped"),'','R'); + } - if (!empty($hidebottom)) { + if (empty($hidebottom)) { // Modif Seb cadres signatures $pdf->SetFont('','', $default_font_size); $larg_sign = ($this->page_largeur-$this->marge_gauche-$this->marge_droite)/3;