Sec: Fix creation of temp dir in right place.
This commit is contained in:
parent
2454b1026a
commit
8389fdc7a2
@ -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:
|
||||
|
||||
@ -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<EFBFBD>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<EFBFBD>gr<EFBFBD>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<EFBFBD>f<EFBFBD>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<EFBFBD>f<EFBFBD>rences d'affichage - @author Michel Poulain
|
||||
//affiche le document en plein <EFBFBD>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 <EFBFBD>l<EFBFBD>ments de la fen<65>tre (barres de d<>filement, contr<74>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<EFBFBD>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<EFBFBD>tre (lorsqu'elle n'est pas maximis<69>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<EFBFBD>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<EFBFBD>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 <EFBFBD> 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<EFBFBD>trage des pr<EFBFBD>f<EFBFBD>rences d'affichage.
|
||||
* @string preference liste des pr<EFBFBD>f<EFBFBD>rences d'affichage (voir la fonction _putcatalog)
|
||||
* @ex: $pdf->DisplayPreferences('HideMenubar,HideToolbar,HideWindowUI')
|
||||
* @author Michel Poulain
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user