diff --git a/htdocs/includes/dolibarr_changes.txt b/htdocs/includes/dolibarr_changes.txt index 92c9a73b477..fa0da3f0b45 100644 --- a/htdocs/includes/dolibarr_changes.txt +++ b/htdocs/includes/dolibarr_changes.txt @@ -6,7 +6,9 @@ in Dolibarr root. FPDF: ----- -* All changes were added in fpdf.php file and marked with tag DOLCHANGE +* All changes were added in fpdf.php file and marked with tag DOLCHANGE or DOL_CHANGE +Example: +$tmp=tempnam('.','gif') into $tmp=tempnam(DOL_DATA_ROOT,'gif') to avoid creating files in the htdocs directory. FPDFI and FPDF_TPL: diff --git a/htdocs/includes/fpdf/fpdf/fpdf.php b/htdocs/includes/fpdf/fpdf/fpdf.php index f604c62a94f..efa3680d02d 100644 --- a/htdocs/includes/fpdf/fpdf/fpdf.php +++ b/htdocs/includes/fpdf/fpdf/fpdf.php @@ -11,9 +11,9 @@ /* Begin DOLCHANGE Added by Regis */ // height of cell repect font height define("K_CELL_HEIGHT_RATIO", 1.25); -// Répertoire des documents de fckeditor +// R�pertoire des documents de fckeditor if (! empty($conf->fckeditor->dir_output)) define ("K_PATH_CACHE", $conf->fckeditor->dir_output); -// url qui sera substituer par le K_PATH_CACHE lorsqu'une image sera intégrée au pdf +// url qui sera substituer par le K_PATH_CACHE lorsqu'une image sera int�gr�e au pdf if (defined('DOL_URL_ROOT')) define ("K_PATH_URL_CACHE", DOL_URL_ROOT."/document.php?modulepart=editor&file="); /* End DOLCHANGE Added by Regis */ @@ -85,7 +85,7 @@ var $PDFVersion; //PDF version number var $prevFontFamily; //store previous font family var $prevFontStyle; //store previous style family -var $DisplayPreferences=''; //préférences d'affichage +var $DisplayPreferences=''; //pr�f�rences d'affichage // variables pour HTML PARSER @@ -1516,10 +1516,12 @@ function _parsegif($file) if(!$im) $this->Error('Missing or incorrect image file: '.$file); imageinterlace($im,0); - $tmp=tempnam('.','gif'); + // DOL_CHANGE + $tmp=tempnam(DOL_DATA_ROOT,'gif'); + //$tmp=tempnam('.','gif'); if(!$tmp) $this->Error('Unable to create a temporary file'); - if(!imagepng($im,$tmp)) + if(!imagepng($im,$tmp)) $this->Error('Error while saving to temporary file'); imagedestroy($im); $info=$this->_parsepng($tmp); @@ -1852,8 +1854,8 @@ function _putcatalog() /* Begin DOLCHANGE Added by Regis */ - //Préférences d'affichage - @author Michel Poulain - //affiche le document en plein écran (escape pour revenir en mode normal) + //Pr�f�rences d'affichage - @author Michel Poulain + //affiche le document en plein �cran (escape pour revenir en mode normal) if(is_int(strpos($this->DisplayPreferences,'FullScreen'))) $this->_out('/PageMode /FullScreen'); if($this->DisplayPreferences) { @@ -1864,16 +1866,16 @@ function _putcatalog() //masque les barres d'outils if(is_int(strpos($this->DisplayPreferences,'HideToolbar'))) $this->_out('/HideToolbar true'); - //masque tous les éléments de la fenêtre (barres de défilement, contrôles de navigation, signets...) + //masque tous les �l�ments de la fen�tre (barres de d�filement, contr�les de navigation, signets...) if(is_int(strpos($this->DisplayPreferences,'HideWindowUI'))) $this->_out('/HideWindowUI true'); //affiche le titre du document au lieu du nom du fichier if(is_int(strpos($this->DisplayPreferences,'DisplayDocTitle'))) $this->_out('/DisplayDocTitle true'); - //centre la fenêtre + //centre la fen�tre if(is_int(strpos($this->DisplayPreferences,'CenterWindow'))) $this->_out('/CenterWindow true'); - //ajuste la taille de la fenêtre (lorsqu'elle n'est pas maximisée) sur celle de la page + //ajuste la taille de la fen�tre (lorsqu'elle n'est pas maximis�e) sur celle de la page if(is_int(strpos($this->DisplayPreferences,'FitWindow'))) $this->_out('/FitWindow true'); $this->_out('>>'); @@ -1970,7 +1972,7 @@ function _enddoc() } elseif($this->tdbegin) { if((strlen(trim($element)) > 0) AND ($element != " ")) { - // Cette version ne gère pas UTF8 + // Cette version ne g�re pas UTF8 //$this->Cell($this->tdwidth, $this->tdheight, $this->unhtmlentities($element), $this->tableborder, '', $this->tdalign, $this->tdbgcolor); $this->Cell($this->tdwidth, $this->tdheight, utf8_decode($this->unhtmlentities($element)), $this->tableborder, '', $this->tdalign, $this->tdbgcolor); } @@ -1979,7 +1981,7 @@ function _enddoc() } } else { - // cette version ne gère pas UTF8 + // cette version ne g�re pas UTF8 //$this->Write($this->lasth, stripslashes($this->unhtmlentities($element)), '', $fill); $this->Write($this->lasth, stripslashes(utf8_decode($this->unhtmlentities($element))), '', $fill); } @@ -2602,7 +2604,7 @@ function _enddoc() /** * Converti les noms des polices FckEditor. - * @string string chaine à convertir + * @string string chaine � convertir * @return string chaine convertie. * @author Regis Houssin */ @@ -2636,8 +2638,8 @@ function _enddoc() } /** - * Paramétrage des préférences d'affichage. - * @string preference liste des préférences d'affichage (voir la fonction _putcatalog) + * Param�trage des pr�f�rences d'affichage. + * @string preference liste des pr�f�rences d'affichage (voir la fonction _putcatalog) * @ex: $pdf->DisplayPreferences('HideMenubar,HideToolbar,HideWindowUI') * @author Michel Poulain */