New: Uniformize pdf generation code. We also keep space to repeat pdf
head info.
This commit is contained in:
parent
832a472325
commit
2170801fd2
@ -261,18 +261,20 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -182,7 +182,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 52;
|
$tab_top = 52;
|
||||||
$tab_top_newpage = 10;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = $this->page_hauteur - $tab_top - $heightforfooter;
|
$tab_height = $this->page_hauteur - $tab_top - $heightforfooter;
|
||||||
$tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
|
$tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
|
||||||
|
|
||||||
@ -198,9 +198,9 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 3);
|
$pdf->SetFont('','', $default_font_size - 3);
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
@ -210,6 +210,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -170,7 +170,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = 10;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
@ -226,9 +226,9 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
|
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
@ -238,6 +238,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -98,7 +98,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
||||||
|
|
||||||
// Defini position des colonnes
|
// Defini position des colonnes
|
||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
@ -178,7 +178,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 80; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -221,13 +221,14 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
|
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
|
$this->_pagehead($pdf, $object, 1, $outputlangs, $hookmanager);
|
||||||
$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);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = 10;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
@ -260,27 +261,29 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$nexY = $tab_top + 7;
|
$nexY = $tab_top + 7;
|
||||||
|
|
||||||
// Loop on each lines
|
// Loop on each lines
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0; $i < $nblignes; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
if ($pageposafter > $pageposbefore) {
|
if ($pageposafter > $pageposbefore) {
|
||||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|
||||||
@ -376,12 +379,12 @@ if ($pageposafter > $pageposbefore) {
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,10 +84,9 @@ 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 (empty($this->emetteur->country_code))
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if not defined
|
||||||
$this->emetteur->country_code = substr($langs->defaultlang,-2); // By default, if not defined
|
|
||||||
|
|
||||||
// Defini position des colonnes
|
// Defini position des colonnes
|
||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
@ -96,14 +95,18 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
/**
|
/**
|
||||||
* 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
|
||||||
@ -114,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();
|
||||||
@ -135,7 +140,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 80; // Height reserved to output the info and total part (value include bottom margin)
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
@ -169,16 +174,14 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$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 = 90;
|
$tab_top = 90;
|
||||||
$tab_top_middlepage = 10;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_top_newpage = 10;
|
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_middlepage = 200;
|
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
@ -186,7 +189,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
{
|
{
|
||||||
$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;
|
||||||
@ -242,39 +245,22 @@ 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->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
$pdf->SetFont('','B', $default_font_size - 1);
|
// Description of product line
|
||||||
$pdf->SetXY($this->marge_gauche, $curY);
|
$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>';
|
||||||
$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);
|
$desc=dol_htmlentitiesbr($objectligne->desc,1);
|
||||||
|
|
||||||
$curYold=$nexYold=$nexY;
|
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0);
|
||||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0);
|
|
||||||
$curY = $pdf->GetY();
|
|
||||||
$nexY+=3;
|
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
|
||||||
|
|
||||||
$pdf->SetXY($this->marge_gauche, $nexY);
|
|
||||||
$desc = dol_htmlentitiesbr($objectligne->desc,1);
|
|
||||||
|
|
||||||
$curYold = $pdf->GetY();
|
|
||||||
$nexYold = $curYold;
|
|
||||||
|
|
||||||
$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
|
|
||||||
|
|
||||||
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
@ -323,17 +309,15 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforfooter + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
|
$bottomlasttab=$this->page_hauteur - $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();
|
||||||
|
|
||||||
@ -401,21 +385,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,25, '', 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,25, '', 1);
|
$pdf->MultiCell(80,5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"),0,'L',0);
|
||||||
|
|
||||||
|
$pdf->SetXY(110,235);
|
||||||
|
$pdf->MultiCell(80,25, '', 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -171,10 +171,10 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 100;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = 50;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 140;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 190;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
$curY = $tab_top + 7;
|
$curY = $tab_top + 7;
|
||||||
@ -183,18 +183,19 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
for ($i = 0 ; $i < $nblines ; $i++)
|
for ($i = 0 ; $i < $nblines ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
|
||||||
//$curX = $this->posxdesc-1;
|
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -206,8 +206,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = 5;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 150;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
@ -240,18 +240,20 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
for ($i = 0 ; $i < $nblines ; $i++)
|
for ($i = 0 ; $i < $nblines ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot-50); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot-50); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$curX,$curY);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$curX,$curY);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -226,8 +226,8 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_middlepage = 10;
|
$tab_top_middlepage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_top_newpage = 10;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_middlepage = 200;
|
$tab_height_middlepage = 200;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
@ -262,18 +262,20 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -225,7 +225,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = 10;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
@ -259,18 +259,20 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1,$hookmanager);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -237,7 +237,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = 10;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
$tab_height = 130;
|
||||||
$tab_height_newpage = 150;
|
$tab_height_newpage = 150;
|
||||||
|
|
||||||
@ -271,18 +271,20 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
$pageposbefore=$pdf->getPage();
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
// Description of product line
|
// Description of product line
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
|
||||||
$curX = $this->posxdesc-1;
|
$curX = $this->posxdesc-1;
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,0,0,1,$hookmanager);
|
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,0,0,1,$hookmanager);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$pdf->setPage($pageposbefore);
|
$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.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
// We suppose that a too long description is moved completely on next page
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
|||||||
@ -27,8 +27,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class Fichinter
|
* Classe des gestion des fiches interventions
|
||||||
* \brief Classe des gestion des fiches interventions
|
|
||||||
*/
|
*/
|
||||||
class Fichinter extends CommonObject
|
class Fichinter extends CommonObject
|
||||||
{
|
{
|
||||||
@ -818,10 +817,11 @@ class Fichinter extends CommonObject
|
|||||||
$this->ref = 'SPECIMEN';
|
$this->ref = 'SPECIMEN';
|
||||||
$this->specimen=1;
|
$this->specimen=1;
|
||||||
$this->socid = 1;
|
$this->socid = 1;
|
||||||
$this->date = $now;
|
$this->datec = $now;
|
||||||
|
$this->note_private='Private note';
|
||||||
$this->note_public='SPECIMEN';
|
$this->note_public='SPECIMEN';
|
||||||
$this->duree = 0;
|
$this->duree = 0;
|
||||||
$nbp = 5;
|
$nbp = 20;
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
while ($xnbp < $nbp)
|
while ($xnbp < $nbp)
|
||||||
{
|
{
|
||||||
@ -884,8 +884,7 @@ class Fichinter extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class FichinterLigne
|
* Classe permettant la gestion des lignes d'intervention
|
||||||
* \brief Classe permettant la gestion des lignes d'intervention
|
|
||||||
*/
|
*/
|
||||||
class FichinterLigne
|
class FichinterLigne
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user