dolibarr 24.0.0-beta
Export Class Reference

Class to manage exports. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 load_arrays ($user, $filter='')
 Load an exportable dataset.
 
 build_sql ($indice, $array_selected, $array_filterValue)
 Build the sql export request.
 
 buildFilterQuery ($TypeField, $NameField, $ValueField)
 Build the conditional string from filter the query.
 
 conditionDate ($Field, $Value, $Sens)
 conditionDate
 
 build_filterField ($TypeField, $NameField, $ValueField)
 Build an input field used to filter the query.
 
 genDocFilter ($TypeField)
 Build an input field used to filter the query.
 
 create ($user)
 Save an export model in database.
 
 fetch ($id)
 Load an export profil from database.
 
 delete ($user, $notrigger=0)
 Delete object in database.
 
 list_export_model ()
 Output list all export models –TODO Move this into a class htmlxxx.class.php–.
 

Detailed Description

Class to manage exports.

Definition at line 34 of file export.class.php.

Constructor & Destructor Documentation

◆ __construct()

Export::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 165 of file export.class.php.

Member Function Documentation

◆ build_filterField()

Export::build_filterField ( $TypeField,
$NameField,
$ValueField )

Build an input field used to filter the query.

Parameters
string$TypeFieldType of Field to filter. Example: Text, Date, List:c_country:label:rowid, List:c_stcom:label:code, Numeric or Number, Boolean
string$NameFieldName of the field to filter
string$ValueFieldInitial value of the field to filter
Returns
string html string of the input field ex : "<input type=text name=... value=...>"

Definition at line 509 of file export.class.php.

References ajax_combobox(), dol_escape_all(), dol_print_error(), dolPrintHTML(), and dolPrintHTMLForAttribute().

◆ build_sql()

Export::build_sql ( $indice,
$array_selected,
$array_filterValue )

Build the sql export request.

Arrays this->array_export_xxx are already loaded for required datatoexport

Parameters
int$indiceIndice of export
array<string,string>$array_selected Filter fields on array of fields to export
array<string,string>$array_filterValue Filter records on array of value for fields
Returns
string SQL String. Example "select s.rowid as r_rowid, s.status as s_status from ..."

Definition at line 333 of file export.class.php.

◆ buildFilterQuery()

Export::buildFilterQuery ( $TypeField,
$NameField,
$ValueField )

Build the conditional string from filter the query.

More simple and limited function than forgeSQLFromUniversalSearchCriteria

Parameters
string$TypeFieldType of Field to filter
string$NameFieldName of the field to filter
string$ValueFieldValue of the field for filter. Must not be ''
Returns
string SQL string of the field ex : "field='xxx'"

Definition at line 404 of file export.class.php.

References dol_syslog(), and sanitizeVal().

◆ conditionDate()

Export::conditionDate ( $Field,
$Value,
$Sens )

conditionDate

Parameters
string$FieldField operand 1
string$ValueValue operand 2
string$SensComparison operator
Returns
string

Definition at line 487 of file export.class.php.

◆ create()

Export::create ( $user)

Save an export model in database.

Parameters
User$userObject user that save
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 907 of file export.class.php.

References dol_syslog().

◆ delete()

Export::delete ( $user,
$notrigger = 0 )

Delete object in database.

Parameters
User$userUser that delete
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 982 of file export.class.php.

References dol_syslog().

◆ fetch()

Export::fetch ( $id)

Load an export profil from database.

Parameters
int$idId of profil to load
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 945 of file export.class.php.

References $id, dol_print_error(), and dol_syslog().

◆ genDocFilter()

Export::genDocFilter ( $TypeField)

Build an input field used to filter the query.

Parameters
string$TypeFieldType of Field to filter
Returns
string html string of the input field ex : "<input type=text name=... value=...>"

Definition at line 642 of file export.class.php.

◆ list_export_model()

Export::list_export_model ( )

Output list all export models –TODO Move this into a class htmlxxx.class.php–.

Returns
void

Definition at line 1019 of file export.class.php.

References dol_print_error(), img_delete(), and img_object().

◆ load_arrays()

Export::load_arrays ( $user,
$filter = '' )

Load an exportable dataset.

Parameters
User$userObject user making export
string$filterLoad a particular dataset only
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 179 of file export.class.php.

References $conf, $mysoc, dol_osencode(), dol_syslog(), dolGetModulesDirs(), and verifCond().


The documentation for this class was generated from the following file: