dolibarr
25.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
Examples
File List
File Members
dolibarr_dev
htdocs
core
modules
export
export_csvutf8.modules.php
1
<?php
2
/* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
3
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
26
require_once DOL_DOCUMENT_ROOT.
'/core/modules/export/exportcsv.class.php'
;
27
28
// avoid timeout for big export
29
set_time_limit(0);
30
34
class
ExportCsvUtf8
extends
ExportCsv
35
{
41
public
function
__construct
($db)
42
{
43
global $langs;
44
$this->db = $db;
45
46
$this->separator =
','
;
47
if
(
getDolGlobalString
(
'EXPORT_CSV_SEPARATOR_TO_USE'
)) {
48
$this->separator =
getDolGlobalString
(
'EXPORT_CSV_SEPARATOR_TO_USE'
);
49
}
50
51
$this->escape =
'"'
;
52
$this->enclosure =
'"'
;
53
$this->
id
=
'csvutf8'
;
// Same value then xxx in file name export_xxx.modules.php
54
$this->label =
'CSV UTF-8'
;
// Label of driver
55
$this->desc = $langs->trans(
"CSVFormatDesc"
, $this->separator, $this->enclosure, $this->escape);
56
$this->extension =
'csv'
;
// Extension for generated file by this driver
57
$this->picto =
'mime/other'
;
// Picto
58
$this->
version
=
'1.32'
;
// Driver version
59
60
// If driver use an external library, put its name here
61
$this->label_lib =
'Dolibarr'
;
62
$this->version_lib = DOL_VERSION;
63
}
64
65
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
75
public
function
write_title
($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types)
76
{
77
global
$conf
;
78
$conf
->global->EXPORT_CSV_FORCE_CHARSET =
'UTF-8'
;
79
80
return
parent::write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types);
81
}
82
83
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
93
public
function
write_record
($array_selected_sorted, $objp, $outputlangs, $array_types)
94
{
95
global
$conf
;
96
97
$conf
->global->EXPORT_CSV_FORCE_CHARSET =
'UTF-8'
;
98
return
parent::write_record($array_selected_sorted, $objp, $outputlangs, $array_types);
99
}
100
}
$conf
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Definition
chat_history.php:55
ExportCsv
Class to build export files with format CSV.
Definition
exportcsv.class.php:34
ExportCsvUtf8
Class to build export files with format CSV utf-8.
Definition
export_csvutf8.modules.php:35
ExportCsvUtf8\write_record
write_record($array_selected_sorted, $objp, $outputlangs, $array_types)
Output record line into file.
Definition
export_csvutf8.modules.php:93
ExportCsvUtf8\write_title
write_title($array_export_fields_label, $array_selected_sorted, $outputlangs, $array_types)
Output title line into file.
Definition
export_csvutf8.modules.php:75
ExportCsvUtf8\__construct
__construct($db)
Constructor.
Definition
export_csvutf8.modules.php:41
getDolGlobalString
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
Definition
functions.lib.php:324
version
$conf browser version
Definition
main.inc.php:229
Generated on Sun Nov 1 2026 01:00:21 for
dolibarr
by Doxygen 1.11.0