Fix: Free text overlap data when not on last page.

Conflicts:
	htdocs/core/lib/pdf.lib.php
	htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
	htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
	htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
	htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php
	htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
	htdocs/core/modules/project/pdf/pdf_baleine.modules.php
This commit is contained in:
Laurent Destailleur 2012-10-30 14:15:35 +01:00
parent 542dc8f98f
commit db00ca9dd7
10 changed files with 348 additions and 306 deletions

View File

@ -3332,6 +3332,28 @@ function dol_textishtml($msg,$option=0)
} }
} }
/**
* Concat 2 descriptions (second one after first one)
* text1 html + text2 html => text1 + '<br>' + text2
* text1 html + text2 txt => text1 + '<br>' + dol_nl2br(text2)
* text1 txt + text2 html => dol_nl2br(text1) + '<br>' + text2
* text1 txt + text2 txt => text1 + '\n' + text2
*
* @param string $text1 Text 1
* @param string $text2 Text 2
* @param string $forxml false=Use <br>, true=Use <br />
* @return string Text 1 + new line + Text2
* @see dol_textishtml
*/
function dol_concatdesc($text1,$text2,$forxml=false)
{
$ret='';
$ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1;
$ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"<br \>\n":"<br>\n") : "\n") : "";
$ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2;
return $ret;
}
/** /**
* Make substition into a string * Make substition into a string
* There is two type of substitions: * There is two type of substitions:

View File

@ -517,147 +517,149 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
} }
/** /**
* Show footer of page for PDF generation * Show footer of page for PDF generation
* *
* @param PDF &$pdf The PDF factory * @param PDF &$pdf The PDF factory
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text * @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company * @param Societe $fromcompany Object company
* @param int $marge_basse Margin bottom we use for the autobreak * @param int $marge_basse Margin bottom we use for the autobreak
* @param int $marge_gauche Margin left (no more used) * @param int $marge_gauche Margin left (no more used)
* @param int $page_hauteur Page height (no more used) * @param int $page_hauteur Page height (no more used)
* @param Object $object Object shown in PDF * @param Object $object Object shown in PDF
* @param int $showdetails Show company details into footer. This param seems to not be used by standard version. * @param int $showdetails Show company details into footer. This param seems to not be used by standard version.
* @return int Return height of bottom margin including footer text * @param int $hidefreetext 1=Hide free text, 0=Show free text
*/ * @return int Return height of bottom margin including footer text
function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0) */
{ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0,$hidefreetext=0)
global $conf,$user; {
global $conf,$user;
$outputlangs->load("dict");
$line=''; $outputlangs->load("dict");
$line='';
$dims=$pdf->getPageDimensions();
$dims=$pdf->getPageDimensions();
// Line of free text
if (! empty($conf->global->$paramfreetext)) // Line of free text
{ if (empty($hidefreetext) && ! empty($conf->global->$paramfreetext))
// Make substitution {
$substitutionarray=array( // Make substitution
'__FROM_NAME__' => $fromcompany->nom, $substitutionarray=array(
'__FROM_EMAIL__' => $fromcompany->email, '__FROM_NAME__' => $fromcompany->nom,
'__TOTAL_TTC__' => $object->total_ttc, '__FROM_EMAIL__' => $fromcompany->email,
'__TOTAL_HT__' => $object->total_ht, '__TOTAL_TTC__' => $object->total_ttc,
'__TOTAL_VAT__' => $object->total_vat '__TOTAL_HT__' => $object->total_ht,
); '__TOTAL_VAT__' => $object->total_vat
complete_substitutions_array($substitutionarray,$outputlangs,$object); );
$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray); complete_substitutions_array($substitutionarray,$outputlangs,$object);
$line.=$outputlangs->convToOutputCharset($newfreetext); $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
} $line.=$outputlangs->convToOutputCharset($newfreetext);
}
// First line of company infos
// First line of company infos
if ($showdetails)
{ if ($showdetails)
$line1=""; {
// Company name $line1="";
if ($fromcompany->name) // Company name
{ if ($fromcompany->name)
$line1.=($line1?" - ":"").$outputlangs->transnoentities("RegisteredOffice").": ".$fromcompany->name; {
} $line1.=($line1?" - ":"").$outputlangs->transnoentities("RegisteredOffice").": ".$fromcompany->name;
// Address }
if ($fromcompany->address) // Address
{ if ($fromcompany->address)
$line1.=($line1?" - ":"").$fromcompany->address; {
} $line1.=($line1?" - ":"").$fromcompany->address;
// Zip code }
if ($fromcompany->zip) // Zip code
{ if ($fromcompany->zip)
$line1.=($line1?" - ":"").$fromcompany->zip; {
} $line1.=($line1?" - ":"").$fromcompany->zip;
// Town }
if ($fromcompany->town) // Town
{ if ($fromcompany->town)
$line1.=($line1?" ":"").$fromcompany->town; {
} $line1.=($line1?" ":"").$fromcompany->town;
// Phone }
if ($fromcompany->phone) // Phone
{ if ($fromcompany->phone)
$line1.=($line1?" - ":"").$outputlangs->transnoentities("Phone").": ".$fromcompany->phone; {
} $line1.=($line1?" - ":"").$outputlangs->transnoentities("Phone").": ".$fromcompany->phone;
// Fax }
if ($fromcompany->fax) // Fax
{ if ($fromcompany->fax)
$line1.=($line1?" - ":"").$outputlangs->transnoentities("Fax").": ".$fromcompany->fax; {
} $line1.=($line1?" - ":"").$outputlangs->transnoentities("Fax").": ".$fromcompany->fax;
}
$line2="";
// URL $line2="";
if ($fromcompany->url) // URL
{ if ($fromcompany->url)
$line2.=($line2?" - ":"").$fromcompany->url; {
} $line2.=($line2?" - ":"").$fromcompany->url;
// Email }
if ($fromcompany->email) // Email
{ if ($fromcompany->email)
$line2.=($line2?" - ":"").$fromcompany->email; {
} $line2.=($line2?" - ":"").$fromcompany->email;
} }
}
// Line 3 of company infos
$line3=""; // Line 3 of company infos
// Juridical status $line3="";
if ($fromcompany->forme_juridique_code) // Juridical status
{ if ($fromcompany->forme_juridique_code)
$line3.=($line3?" - ":"").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code)); {
} $line3.=($line3?" - ":"").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code));
// Capital }
if ($fromcompany->capital) // Capital
{ if ($fromcompany->capital)
$line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->currency); {
} $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->currency);
// Prof Id 1 }
if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2)) // Prof Id 1
{ if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2))
$field=$outputlangs->transcountrynoentities("ProfId1",$fromcompany->country_code); {
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; $field=$outputlangs->transcountrynoentities("ProfId1",$fromcompany->country_code);
$line3.=($line3?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
} $line3.=($line3?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1);
// Prof Id 2 }
if ($fromcompany->idprof2) // Prof Id 2
{ if ($fromcompany->idprof2)
$field=$outputlangs->transcountrynoentities("ProfId2",$fromcompany->country_code); {
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; $field=$outputlangs->transcountrynoentities("ProfId2",$fromcompany->country_code);
$line3.=($line3?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof2); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
} $line3.=($line3?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof2);
}
// Line 4 of company infos
$line4=""; // Line 4 of company infos
// Prof Id 3 $line4="";
if ($fromcompany->idprof3) // Prof Id 3
{ if ($fromcompany->idprof3)
$field=$outputlangs->transcountrynoentities("ProfId3",$fromcompany->country_code); {
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; $field=$outputlangs->transcountrynoentities("ProfId3",$fromcompany->country_code);
$line4.=($line4?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
} $line4.=($line4?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3);
// Prof Id 4 }
if ($fromcompany->idprof4) // Prof Id 4
{ if ($fromcompany->idprof4)
$field=$outputlangs->transcountrynoentities("ProfId4",$fromcompany->country_code); {
if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; $field=$outputlangs->transcountrynoentities("ProfId4",$fromcompany->country_code);
$line4.=($line4?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1];
} $line4.=($line4?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4);
// IntraCommunautary VAT }
if ($fromcompany->tva_intra != '') // IntraCommunautary VAT
{ if ($fromcompany->tva_intra != '')
$line4.=($line4?" - ":"").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra); {
} $line4.=($line4?" - ":"").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra);
}
$pdf->SetFont('','',7);
$pdf->SetDrawColor(224,224,224); $pdf->SetFont('','',7);
$pdf->SetDrawColor(224,224,224);
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
$freetextheight=0;
if ($line) // Free text if ($line) // Free text
{ {
$width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. $width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.

View File

@ -344,9 +344,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return void * @return void
*/ */
function _pagefoot(&$pdf,$object,$outputlangs) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
global $conf; global $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);

View File

@ -360,7 +360,7 @@ class pdf_einstein extends ModelePDFCommandes
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@ -376,7 +376,7 @@ class pdf_einstein extends ModelePDFCommandes
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@ -1083,11 +1083,12 @@ class pdf_einstein extends ModelePDFCommandes
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
function _pagefoot(&$pdf,$object,$outputlangs) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
} }
} }

View File

@ -362,7 +362,7 @@ class pdf_crabe extends ModelePDFFactures
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@ -378,7 +378,7 @@ class pdf_crabe extends ModelePDFFactures
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@ -1271,11 +1271,12 @@ class pdf_crabe extends ModelePDFFactures
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
function _pagefoot(&$pdf,$object,$outputlangs) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
} }
} }

View File

@ -25,10 +25,10 @@
* \ingroup ficheinter * \ingroup ficheinter
* \brief Fichier de la classe permettant de generer les fiches d'intervention au modele Soleil * \brief Fichier de la classe permettant de generer les fiches d'intervention au modele Soleil
*/ */
require_once(DOL_DOCUMENT_ROOT."/core/modules/fichinter/modules_fichinter.php"); require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php';
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/** /**
@ -84,25 +84,29 @@ class pdf_soleil extends ModelePDFFicheinter
$this->option_multilang = 0; // Dispo en plusieurs langues $this->option_multilang = 0; // Dispo en plusieurs langues
$this->option_draft_watermark = 1; //Support add of a watermark on drafts $this->option_draft_watermark = 1; //Support add of a watermark on drafts
// Recupere emmetteur // Get source company
$this->emetteur=$mysoc; $this->emetteur=$mysoc;
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // By default, if not defined if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if not defined
// Defini position des colonnes // Define position of columns
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
} }
/** /**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
* @param object $object Object to generate * @param int $object Id of object to generate
* @param object $outputlangs Lang output object * @param object $outputlangs Lang output object
* @return int 1=ok, 0=ko * @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
* @param int $hidedesc Do not show desc
* @param int $hideref Do not show ref
* @param object $hookmanager Hookmanager object
* @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
{ {
global $user,$langs,$conf,$mysoc; global $user,$langs,$conf,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@ -113,6 +117,8 @@ class pdf_soleil extends ModelePDFFicheinter
$outputlangs->load("companies"); $outputlangs->load("companies");
$outputlangs->load("interventions"); $outputlangs->load("interventions");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->ficheinter->dir_output) if ($conf->ficheinter->dir_output)
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -134,6 +140,9 @@ class pdf_soleil extends ModelePDFFicheinter
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))
{ {
@ -157,34 +166,30 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("InterventionCard")); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("InterventionCard"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $object, 1, $outputlangs); $this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$tab_top = 100; $tab_top = 90;
$tab_top_middlepage = 50; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
$tab_top_newpage = 50; $tab_height = 130;
$tab_height = 120;
$tab_height_newpage = 150; $tab_height_newpage = 150;
$tab_height_middlepage = 200;
$tab_height_endpage = 170;
// Affiche notes // Affiche notes
if (! empty($object->note_public)) if (! empty($object->note_public))
{ {
$tab_top = 88; $tab_top = 88;
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page $pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$height_note=$nexY-$tab_top; $height_note=$nexY-$tab_top;
@ -240,81 +245,64 @@ class pdf_soleil extends ModelePDFFicheinter
if ($valide > 0 || $object->specimen) if ($valide > 0 || $object->specimen)
{ {
$curY = $nexY; $curY = $nexY;
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','B', $default_font_size - 1); $pdf->setTopMargin($tab_top_newpage);
$pdf->SetXY($this->marge_gauche, $curY); $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output); $pageposbefore=$pdf->getPage();
$curYold=$nexYold=$nexY; // Description of product line
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0); $txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).'</strong>';
$curY = $pdf->GetY(); $desc=dol_htmlentitiesbr($objectligne->desc,1);
$nexY+=3;
$pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0);
$pdf->SetXY($this->marge_gauche, $nexY); $nexY = $pdf->GetY();
$desc = dol_htmlentitiesbr($objectligne->desc,1); $pageposafter=$pdf->getPage();
$pdf->setPage($pageposbefore);
$pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
$curYold = $pdf->GetY(); // We suppose that a too long description is moved completely on next page
$nexYold = $curYold; if ($pageposafter > $pageposbefore) {
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $desc, 0, 1, 0);
$stringheight=$pdf->getStringHeight('A', $txt);
$curY = $pdf->GetY();
$nexY+=(dol_nboflines_bis($objectligne->desc,0,$outputlangs->charset_output)*$stringheight);
//print $curYold."-".$nexYold." +".dol_nboflines_bis($objectligne->desc,52,$outputlangs->charset_output)."*".$stringheight."= ".$curY."-".$nexY."<br>";
$nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante
if ($i < ($nblines - 1) && empty($hidedesc)) // If it's not last line
{
//on recupere la description du produit suivant
$follow_descproduitservice = $objectligne->desc;
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres)
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*3);
}
else // If it's last line
{
$nblineFollowDesc = 0;
} }
// Test if a new page is required $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
if ($pagenb == 1)
{ // Detect if some page were added automatically and output _tableau for past pages
$tab_top_in_current_page=$tab_top; while ($pagenb < $pageposafter)
$tab_height_in_current_page=$tab_height;
}
else
{
$tab_top_in_current_page=$tab_top_newpage;
$tab_height_in_current_page=$tab_height_middlepage;
}
if (($nexY+$nblineFollowDesc) > ($tab_top_in_current_page+$tab_height_in_current_page) && $i < ($nblines - 1))
{ {
$pdf->setPage($pagenb);
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height_middlepage, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs,1);
$this->_pagefoot($pdf,$object,$outputlangs); $pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
}
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{
if ($pagenb == 1)
{
$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, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$nexY = $tab_top_newpage + 7;
} }
} }
} }
@ -322,17 +310,15 @@ class pdf_soleil extends ModelePDFFicheinter
// Show square // Show square
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
$bottomlasttab=$tab_top + $tab_height + 1; $bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
$bottomlasttab=$tab_top_newpage + $tab_height_newpage + 1; $bottomlasttab=$this->page_hauteur - $heightforfooter - $heightforfooter + 1;
} }
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
@ -367,11 +353,18 @@ class pdf_soleil extends ModelePDFFicheinter
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y * @param int $nexY Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void * @return void
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{ {
global $conf; global $conf;
// Force to disable hidetop and hidebottom
$hidebottom=0;
if ($hidetop) $hidetop=-1;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
/* /*
$pdf->SetXY($this->marge_gauche, $tab_top); $pdf->SetXY($this->marge_gauche, $tab_top);
@ -398,21 +391,24 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also. $pdf->MultiCell(0, 3, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
*/ */
$pdf->Rect($this->marge_gauche, $tab_top, ($this->page_largeur-$this->marge_gauche-$this->marge_droite), $tab_height+3);
$pdf->SetXY($this->marge_gauche, $pdf->GetY() + 20);
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
$pdf->SetXY(20,230); // Output Rect
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0); $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height+3, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
$pdf->SetXY(20,235); if (empty($hidebottom))
$pdf->MultiCell(80,30, '', 1); {
$pdf->SetXY(20,230);
$pdf->MultiCell(66,5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"),0,'L',0);
$pdf->SetXY(110,230); $pdf->SetXY(20,235);
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0); $pdf->MultiCell(80,25, '', 1);
$pdf->SetXY(110,235); $pdf->SetXY(110,230);
$pdf->MultiCell(80,30, '', 1); $pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
$pdf->SetXY(110,235);
$pdf->MultiCell(80,25, '', 1);
}
} }
/** /**
@ -556,7 +552,7 @@ class pdf_soleil extends ModelePDFFicheinter
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $object->client->nom;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
@ -565,29 +561,31 @@ class pdf_soleil extends ModelePDFFicheinter
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
} }
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
// Show recipient // Show recipient
$widthrecbox=100;
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
$posy=42; $posy=42;
$posx=$this->page_largeur-$this->marge_droite-100; $posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
// Show recipient frame // Show recipient frame
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2); $pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posx,$posy-5); $pdf->SetXY($posx+2,$posy-5);
$pdf->Rect($posx, $posy, 100, $hautcadre); $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
// Show recipient name // Show recipient name
$pdf->SetXY($posx+2,$posy+3); $pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B', $default_font_size); $pdf->SetFont('','B', $default_font_size);
$pdf->MultiCell(100,4, $carac_client_name, 0, 'L'); $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
// Show recipient information // Show recipient information
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
$pdf->MultiCell(100,4, $carac_client, 0, 'L'); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
} }
} }
@ -599,9 +597,9 @@ class pdf_soleil extends ModelePDFFicheinter
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @return void * @return void
*/ */
function _pagefoot(&$pdf,$object,$outputlangs) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); return pdf_pagefoot($pdf,$outputlangs,'FICHINTER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
} }
} }

View File

@ -23,11 +23,11 @@
* \author Regis Houssin * \author Regis Houssin
*/ */
require_once(DOL_DOCUMENT_ROOT."/core/modules/project/modules_project.php"); require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php';
require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"); require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
/** /**
@ -127,6 +127,9 @@ class pdf_baleine extends ModelePDFProjects
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);
if (class_exists('TCPDF')) if (class_exists('TCPDF'))
{ {
@ -151,10 +154,9 @@ class pdf_baleine extends ModelePDFProjects
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project")); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
@ -225,43 +227,52 @@ class pdf_baleine extends ModelePDFProjects
$nexY+=2; // Passe espace entre les lignes $nexY+=2; // Passe espace entre les lignes
// Cherche nombre de lignes a venir pour savoir si place suffisante // Detect if some page were added automatically and output _tableau for past pages
if ($i < ($nblignes - 1) && empty($hidedesc)) // If it's not last line while ($pagenb < $pageposafter)
{ {
//on recupere la description du produit suivant $pdf->setPage($pagenb);
$follow_descproduitservice = $object->lines[$i+1]->desc; if ($pagenb == 1)
//on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres) {
$nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4); $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, 1);
}
$this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
} }
else // If it's last line if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
{ {
$nblineFollowDesc = 0; if ($pagenb == 1)
} {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1)) }
{ else
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); {
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
$this->_pagefoot($pdf, $object, $outputlangs); }
$this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $object, 0, $outputlangs);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0,0,0);
$tab_top=$tab_top_newpage;
$tab_height=$tab_height_newpage;
$nexY = $tab_top + 7;
} }
} }
// Show square // Show square
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); if ($pagenb == 1)
$bottomlasttab=$tab_top + $tab_height + 1; {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
}
else
{
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
}
/* /*
* Pied de page * Pied de page
@ -297,9 +308,11 @@ class pdf_baleine extends ModelePDFProjects
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y * @param int $nexY Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
* @param int $hidetop Hide top bar of array
* @param int $hidebottom Hide bottom bar of array
* @return void * @return void
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
{ {
global $conf,$mysoc; global $conf,$mysoc;
@ -412,11 +425,12 @@ class pdf_baleine extends ModelePDFProjects
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return void * @return void
*/ */
function _pagefoot(&$pdf,$object,$outputlangs) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
} }
} }

View File

@ -360,7 +360,7 @@ class pdf_azur extends ModelePDFPropales
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@ -376,7 +376,7 @@ class pdf_azur extends ModelePDFPropales
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@ -1158,11 +1158,12 @@ class pdf_azur extends ModelePDFPropales
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
function _pagefoot(&$pdf,$object,$outputlangs) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
} }
} }

View File

@ -350,7 +350,7 @@ if ($pageposafter > $pageposbefore) {
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@ -365,7 +365,7 @@ if ($pageposafter > $pageposbefore) {
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@ -976,11 +976,12 @@ if ($pageposafter > $pageposbefore) {
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
function _pagefoot(&$pdf, $object, $outputlangs) function _pagefoot(&$pdf, $object, $outputlangs,$hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
} }
} }

View File

@ -367,7 +367,7 @@ if ($pageposafter > $pageposbefore) {
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
$pagenb++; $pagenb++;
$pdf->setPage($pagenb); $pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
@ -382,7 +382,7 @@ if ($pageposafter > $pageposbefore) {
{ {
$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, 1);
} }
$this->_pagefoot($pdf,$object,$outputlangs); $this->_pagefoot($pdf,$object,$outputlangs,1);
// New page // New page
$pdf->AddPage(); $pdf->AddPage();
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
@ -1082,11 +1082,12 @@ if ($pageposafter > $pageposbefore) {
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text
*/ */
function _pagefoot(&$pdf, $object, $outputlangs) function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
{ {
return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object); return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext);
} }
} }