From 6046feda11a7aee4efa86e793c05ec2187c26c28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 11 Oct 2012 09:42:47 +0200 Subject: [PATCH] Restore border into PDF --- .../core/class/commondocgenerator.class.php | 4 ++-- .../commande/doc/pdf_einstein.modules.php | 4 ++++ .../doc/pdf_expedition_rouget.modules.php | 4 ++++ .../modules/facture/doc/pdf_crabe.modules.php | 20 +++++++++++-------- .../fichinter/doc/pdf_soleil.modules.php | 5 +++++ .../modules/propale/doc/pdf_azur.modules.php | 5 +++++ .../pdf/pdf_canelle.modules.php | 4 ++++ .../pdf/pdf_muscadet.modules.php | 6 +++++- 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index bf3e8e98ddf..aab699cc934 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -173,13 +173,13 @@ abstract class CommonDocGenerator * @param float $y Ordinate of first point * @param float $l ?? * @param float $h ?? - * @param int $hidetop Hide top + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title * @param int $hidebottom Hide bottom * @return void */ function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) { - if (empty($hidetop)) $pdf->line($x, $y, $x+$l, $y); + if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); $pdf->line($x+$l, $y, $x+$l, $y+$h); if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h); $pdf->line($x, $y+$h, $x, $y); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index c28ccb38e7e..b6b3b8fe68e 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -812,6 +812,10 @@ class pdf_einstein extends ModelePDFCommandes { global $conf; + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + $default_font_size = pdf_getPDFFontSize($outputlangs); // Amount in (at tab_top - 1) diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index 946bb1958bf..87c39ce56b0 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -353,6 +353,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition { global $conf; + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + $default_font_size = pdf_getPDFFontSize($outputlangs); // Amount in (at tab_top - 1) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ec5b6330407..ea467d3de3b 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -940,7 +940,7 @@ class pdf_crabe extends ModelePDFFactures * @param string $tab_height Height of table (rectangle) * @param int $nexY Y (not used) * @param Translate $outputlangs Langs object - * @param int $hidetop Hide top bar of array + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title * @param int $hidebottom Hide bottom bar of array * @return void */ @@ -948,6 +948,10 @@ class pdf_crabe extends ModelePDFFactures { global $conf; + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + $default_font_size = pdf_getPDFFontSize($outputlangs); // Amount in (at tab_top - 1) @@ -1097,11 +1101,11 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); $posy+=1; - $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetFont('','', $default_font_size - 2); if ($object->ref_client) { - $posy+=5; + $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); @@ -1113,7 +1117,7 @@ class pdf_crabe extends ModelePDFFactures $objectreplacing=new Facture($this->db); $objectreplacing->fetch($objectidnext); - $posy+=4; + $posy+=3; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R'); @@ -1133,7 +1137,7 @@ class pdf_crabe extends ModelePDFFactures $objectreplaced=new Facture($this->db); $objectreplaced->fetch($object->fk_facture_source); - $posy+=4; + $posy+=3; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); @@ -1146,7 +1150,7 @@ class pdf_crabe extends ModelePDFFactures if ($object->type != 2) { - $posy+=4; + $posy+=3; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); @@ -1154,13 +1158,13 @@ class pdf_crabe extends ModelePDFFactures if ($object->client->code_client) { - $posy+=4; + $posy+=3; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); } - $posy+=2; + $posy+=1; // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size, $hookmanager); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 9a5509de183..d56122061d6 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -360,6 +360,11 @@ class pdf_soleil extends ModelePDFFicheinter function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) { global $conf; + + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + $default_font_size = pdf_getPDFFontSize($outputlangs); /* $pdf->SetXY($this->marge_gauche, $tab_top); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 9f199310dc4..5a9050abd11 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -863,6 +863,11 @@ class pdf_azur extends ModelePDFPropales function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) { global $conf; + + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + $default_font_size = pdf_getPDFFontSize($outputlangs); // Amount in (at tab_top - 1) diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index f0c7fe65819..4494a0ca546 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -633,6 +633,10 @@ if ($pageposafter > $pageposbefore) { { global $conf; + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + $default_font_size = pdf_getPDFFontSize($outputlangs); // Amount in (at tab_top - 1) diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index d638c940988..e83ced5dbc6 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -812,7 +812,11 @@ if ($pageposafter > $pageposbefore) { { global $conf; - $default_font_size = pdf_getPDFFontSize($outputlangs); + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + + $default_font_size = pdf_getPDFFontSize($outputlangs); // Amount in (at tab_top - 1) $pdf->SetTextColor(0,0,0);