dolibarr  7.0.0-beta
Public Member Functions | List of all members
Export Class Reference

Class to manage exports. More...

Public Member Functions

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

Detailed Description

Class to manage exports.

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

Constructor & Destructor Documentation

Export::__construct (   $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

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

Member Function Documentation

Export::build_file (   $user,
  $model,
  $datatoexport,
  $array_selected,
  $array_filterValue,
  $sqlquery = '' 
)

Build export file.

File is built into directory $conf->export->dir_temp.'/'.$user->id Arrays this->array_export_xxx are already loaded for required datatoexport

Parameters
User$userUser that export
string$modelExport format
string$datatoexportName of dataset to export
array$array_selectedFilter on array of fields to export
array$array_filterValueFilter on array of fields with a filter
string$sqlqueryIf set, transmit the sql request for select (otherwise, sql request is generated from arrays)
Returns
int <0 if KO, >0 if OK

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

References $resql, dol_eval(), dol_mkdir(), and dol_syslog().

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 371 of file export.class.php.

References $resql, dol_print_error(), and dol_trunc().

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

Build the conditionnal string from filter the query.

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 then field ex : "field='xxx'>"

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

References dol_syslog(), and if.

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$array_selectedFilter fields on array of fields to export
array$array_filterValueFilter 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 217 of file export.class.php.

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

conditionDate

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

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

Export::create (   $user)

Save an export model in database.

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

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

References $resql, and dol_syslog().

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

Delete object in database.

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

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

References $resql, and dol_syslog().

Export::fetch (   $id)

Load an export profil from database.

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

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

References dol_print_error(), and dol_syslog().

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 484 of file export.class.php.

Export::list_export_model ( )

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

Returns
void

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

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

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

Load an exportable dataset.

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

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

References dol_osencode(), dol_syslog(), dolGetModulesDirs(), and verifCond().


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