forked from Wavyzz/dolibarr
Fix: PDF soleil
This commit is contained in:
@@ -245,7 +245,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$pdf->SetFont('Arial','',12);
|
||||
|
||||
$tab_top = 100;
|
||||
$tab_height = 110;
|
||||
$tab_height = 16;
|
||||
|
||||
$pdf->SetXY (10, $tab_top);
|
||||
$pdf->MultiCell(190,8,$langs->transnoentities("Description"),0,'L',0);
|
||||
@@ -256,8 +256,34 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$pdf->SetFont('Arial','', 10);
|
||||
|
||||
$pdf->SetXY (10, $tab_top + 8 );
|
||||
$pdf->MultiCell(190, 5, $fichinter->description, 0, 'J', 0);
|
||||
$pdf->writeHTMLCell(190, 5, 10, $tab_top + 8, dol_htmlentitiesbr($fichinter->description), 0, 'J', 0);
|
||||
|
||||
//dolibarr_syslog("desc=".dol_htmlentitiesbr($fichinter->description));
|
||||
$fichinter->fetch_lines();
|
||||
$num = sizeof($fichinter->lignes);
|
||||
$i=0;
|
||||
if ($num)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$fichinterligne = $fichinter->lignes[$i];
|
||||
|
||||
$valide = $fichinterligne->fetch($fichinterligne->id);
|
||||
if ($valide>0)
|
||||
{
|
||||
$pdf->SetXY (20, $tab_top + 16 + $i * 20);
|
||||
$pdf->writeHTMLCell(190, 8, 20, $tab_top + 16 + $i * 20,
|
||||
dol_htmlentitiesbr("Date : ".dolibarr_print_date($fichinterligne->datei)." - Dur<75>e : ".ConvertSecondToTime($fichinterligne->duration)), 0, 'J', 0);
|
||||
|
||||
$pdf->SetXY (20, $tab_top + 22 + $i * 20);
|
||||
$pdf->writeHTMLCell(170, 8, 20, $tab_top + 22 + $i * 20,
|
||||
dol_htmlentitiesbr($fichinterligne->desc,1), 0, 'L', 0);
|
||||
$tab_height+=20;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$pdf->Rect(10, $tab_top, 190, $tab_height);
|
||||
$pdf->SetXY (10, $pdf->GetY() + 20 );
|
||||
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
|
||||
|
||||
|
||||
@@ -2531,7 +2531,12 @@ function dol_nl2br($stringtoencode,$nl2brmode=0)
|
||||
*/
|
||||
function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0)
|
||||
{
|
||||
if (dol_textishtml($stringtoencode)) return $stringtoencode;
|
||||
if (dol_textishtml($stringtoencode))
|
||||
{
|
||||
// Replace "<br type="_moz" />" by "<br>". It's same and avoid pb with FPDF.
|
||||
$stringtoencode=eregi_replace('<br( [ a-zA-Z_="]*)?/?>','<br>',$stringtoencode);
|
||||
return $stringtoencode;
|
||||
}
|
||||
else {
|
||||
$newstring=dol_nl2br(htmlentities($stringtoencode),$nl2brmode);
|
||||
// Other substitutions that htmlentities does not do
|
||||
@@ -2547,22 +2552,22 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0)
|
||||
function dol_htmlentitiesbr_decode($stringtodecode)
|
||||
{
|
||||
$ret=html_entity_decode($stringtodecode);
|
||||
$ret=eregi_replace("\r\n".'<br ?/?>',"<br>",$ret);
|
||||
$ret=eregi_replace('<br ?/?>'."\r\n","\r\n",$ret);
|
||||
$ret=eregi_replace('<br ?/?>'."\n","\n",$ret);
|
||||
$ret=eregi_replace('<br ?/?>',"\n",$ret);
|
||||
$ret=eregi_replace("\r\n".'<br( [ a-zA-Z_="]*)?/?>',"<br>",$ret);
|
||||
$ret=eregi_replace('<br( [ a-zA-Z_="]*)?/?>'."\r\n","\r\n",$ret);
|
||||
$ret=eregi_replace('<br( [ a-zA-Z_="]*)??/?>'."\n","\n",$ret);
|
||||
$ret=eregi_replace('<br( [ a-zA-Z_="]*)??/?>',"\n",$ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Decode le code html
|
||||
\param string StringHtml
|
||||
\return string DecodeString
|
||||
* \brief Decode le code html
|
||||
* \param string stringhtml
|
||||
* \return string decodestring
|
||||
*/
|
||||
function dol_entity_decode($StringHtml)
|
||||
function dol_entity_decode($stringhtml)
|
||||
{
|
||||
$DecodeString = html_entity_decode($StringHtml);
|
||||
return $DecodeString;
|
||||
$decodedstring = html_entity_decode($stringhtml);
|
||||
return $decodedstring;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user