Dbut ajout de la fonction clean_html qui permettra de nettoyer le code html lors de l'exportation au format XLS ou CVS pour les accents ou lorsqu'on utilise Fckeditor
This commit is contained in:
parent
56d8c76de8
commit
67fa1f3d00
@ -131,7 +131,7 @@ class ExportCsv extends ModeleExports
|
||||
{
|
||||
$alias=$array_alias[$code];
|
||||
//print "dd".$alias;
|
||||
$newvalue=ereg_replace(';',',',$objp->$alias);
|
||||
$newvalue=ereg_replace(';',',',clean_html($objp->$alias));
|
||||
$newvalue=ereg_replace("\r",'',$newvalue);
|
||||
$newvalue=ereg_replace("\n",'\n',$newvalue);
|
||||
fwrite($this->handle,$newvalue.";");
|
||||
|
||||
@ -148,7 +148,7 @@ class ExportExcel extends ModeleExports
|
||||
{
|
||||
$alias=$array_alias[$code];
|
||||
//print "dd".$alias;
|
||||
$this->worksheet->write($this->row, $this->col, $objp->$alias);
|
||||
$this->worksheet->write($this->row, $this->col, clean_html($objp->$alias));
|
||||
$this->col++;
|
||||
}
|
||||
$this->row++;
|
||||
|
||||
@ -2295,4 +2295,17 @@ function weight_units_string($unit)
|
||||
|
||||
return $weight_string[$unit];
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Nettoie le code HTML
|
||||
\param string StringHtml
|
||||
\return string CleanString
|
||||
\todo nettoyer les balises html
|
||||
*/
|
||||
function clean_html($StringHtml)
|
||||
{
|
||||
$CleanString = html_entity_decode($StringHtml);
|
||||
return $CleanString;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user