forked from Wavyzz/dolibarr
Export modules support UTF8
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/includes/modules/export/export_csv.modules.php
|
||||
* \ingroup export
|
||||
* \brief Fichier de la classe permettant de g<>n<EFBFBD>rer les export au format CSV
|
||||
* \brief Fichier de la classe permettant de g<>n<EFBFBD>rer les export au format CSV
|
||||
* \author Laurent Destailleur
|
||||
* \version $Id$
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/export/modules_export.php");
|
||||
|
||||
/**
|
||||
* \class ExportCsv
|
||||
* \brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Crabe
|
||||
* \brief Classe permettant de g<>n<EFBFBD>rer les factures au mod<6F>le Crabe
|
||||
*/
|
||||
class ExportCsv extends ModeleExports
|
||||
{
|
||||
@@ -49,11 +49,11 @@ class ExportCsv extends ModeleExports
|
||||
|
||||
/**
|
||||
\brief Constructeur
|
||||
\param db Handler acc<63>s base de donn<6E>e
|
||||
\param db Handler acc<63>s base de donn<6E>e
|
||||
*/
|
||||
function ExportCsv($db)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf;
|
||||
$this->db = $db;
|
||||
|
||||
$this->id='csv'; // Same value then xxx in file name export_xxx.modules.php
|
||||
@@ -103,14 +103,15 @@ class ExportCsv extends ModeleExports
|
||||
* \param file Path of filename
|
||||
* \return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function open_file($file)
|
||||
function open_file($file,$outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
global $langs;
|
||||
|
||||
dolibarr_syslog("ExportCsv::open_file file=".$file);
|
||||
|
||||
$ret=1;
|
||||
|
||||
$langs->load("exports");
|
||||
$outputlangs->load("exports");
|
||||
$this->handle = fopen($file, "wt");
|
||||
if (! $this->handle)
|
||||
{
|
||||
@@ -126,9 +127,9 @@ class ExportCsv extends ModeleExports
|
||||
* \brief Output header into file
|
||||
* \param langs Output language
|
||||
*/
|
||||
function write_header($langs)
|
||||
function write_header($outputlangs)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,11 +137,11 @@ class ExportCsv extends ModeleExports
|
||||
* \brief Output title line into file
|
||||
* \param langs Output language
|
||||
*/
|
||||
function write_title($array_export_fields_label,$array_selected_sorted,$langs)
|
||||
function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs)
|
||||
{
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
$newvalue=$langs->transnoentities($array_export_fields_label[$code]);
|
||||
$newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]);
|
||||
$newvalue=$this->csv_clean($newvalue);
|
||||
|
||||
fwrite($this->handle,$newvalue.$this->separator);
|
||||
@@ -153,10 +154,8 @@ class ExportCsv extends ModeleExports
|
||||
/**
|
||||
* \brief Output record line into file
|
||||
*/
|
||||
function write_record($array_alias,$array_selected_sorted,$objp)
|
||||
function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$this->col=0;
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
@@ -167,7 +166,7 @@ class ExportCsv extends ModeleExports
|
||||
// Translation newvalue
|
||||
if (eregi('^\((.*)\)$',$newvalue,$reg))
|
||||
{
|
||||
$newvalue=$langs->transnoentities($reg[1]);
|
||||
$newvalue=$outputlangs->transnoentities($reg[1]);
|
||||
}
|
||||
|
||||
$newvalue=$this->csv_clean($newvalue);
|
||||
@@ -181,11 +180,11 @@ class ExportCsv extends ModeleExports
|
||||
|
||||
/**
|
||||
* \brief Output footer into file
|
||||
* \param langs Output language
|
||||
* \param outputlangs Output language
|
||||
*/
|
||||
function write_footer($langs)
|
||||
function write_footer($outputlangs)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user