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);
|
$pdf->SetFont('Arial','',12);
|
||||||
|
|
||||||
$tab_top = 100;
|
$tab_top = 100;
|
||||||
$tab_height = 110;
|
$tab_height = 16;
|
||||||
|
|
||||||
$pdf->SetXY (10, $tab_top);
|
$pdf->SetXY (10, $tab_top);
|
||||||
$pdf->MultiCell(190,8,$langs->transnoentities("Description"),0,'L',0);
|
$pdf->MultiCell(190,8,$langs->transnoentities("Description"),0,'L',0);
|
||||||
@@ -256,8 +256,34 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$pdf->SetFont('Arial','', 10);
|
$pdf->SetFont('Arial','', 10);
|
||||||
|
|
||||||
$pdf->SetXY (10, $tab_top + 8 );
|
$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->SetXY (10, $pdf->GetY() + 20 );
|
||||||
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
|
$pdf->MultiCell(60, 5, '', 0, 'J', 0);
|
||||||
|
|
||||||
|
|||||||
@@ -2531,7 +2531,12 @@ function dol_nl2br($stringtoencode,$nl2brmode=0)
|
|||||||
*/
|
*/
|
||||||
function dol_htmlentitiesbr($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 {
|
else {
|
||||||
$newstring=dol_nl2br(htmlentities($stringtoencode),$nl2brmode);
|
$newstring=dol_nl2br(htmlentities($stringtoencode),$nl2brmode);
|
||||||
// Other substitutions that htmlentities does not do
|
// Other substitutions that htmlentities does not do
|
||||||
@@ -2547,30 +2552,30 @@ function dol_htmlentitiesbr($stringtoencode,$nl2brmode=0)
|
|||||||
function dol_htmlentitiesbr_decode($stringtodecode)
|
function dol_htmlentitiesbr_decode($stringtodecode)
|
||||||
{
|
{
|
||||||
$ret=html_entity_decode($stringtodecode);
|
$ret=html_entity_decode($stringtodecode);
|
||||||
$ret=eregi_replace("\r\n".'<br ?/?>',"<br>",$ret);
|
$ret=eregi_replace("\r\n".'<br( [ a-zA-Z_="]*)?/?>',"<br>",$ret);
|
||||||
$ret=eregi_replace('<br ?/?>'."\r\n","\r\n",$ret);
|
$ret=eregi_replace('<br( [ a-zA-Z_="]*)?/?>'."\r\n","\r\n",$ret);
|
||||||
$ret=eregi_replace('<br ?/?>'."\n","\n",$ret);
|
$ret=eregi_replace('<br( [ a-zA-Z_="]*)??/?>'."\n","\n",$ret);
|
||||||
$ret=eregi_replace('<br ?/?>',"\n",$ret);
|
$ret=eregi_replace('<br( [ a-zA-Z_="]*)??/?>',"\n",$ret);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Decode le code html
|
* \brief Decode le code html
|
||||||
\param string StringHtml
|
* \param string stringhtml
|
||||||
\return string DecodeString
|
* \return string decodestring
|
||||||
*/
|
*/
|
||||||
function dol_entity_decode($StringHtml)
|
function dol_entity_decode($stringhtml)
|
||||||
{
|
{
|
||||||
$DecodeString = html_entity_decode($StringHtml);
|
$decodedstring = html_entity_decode($stringhtml);
|
||||||
return $DecodeString;
|
return $decodedstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Check if a string is a correct iso string
|
\brief Check if a string is a correct iso string
|
||||||
If not, it will we considered not HTML encoded even if it is by FPDF.
|
If not, it will we considered not HTML encoded even if it is by FPDF.
|
||||||
\remarks Example, if string contains euro symbol that has ascii code 128.
|
\remarks Example, if string contains euro symbol that has ascii code 128.
|
||||||
\param s String to check
|
\param s String to check
|
||||||
\return int 0 if bad iso, 1 if good iso
|
\return int 0 if bad iso, 1 if good iso
|
||||||
*/
|
*/
|
||||||
function dol_string_is_good_iso($s)
|
function dol_string_is_good_iso($s)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user