|
dolibarr 20.0.5
|
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. | |
| build_filterQuery ($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. | |
| build_file ($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery='', $separator='') | |
| Build export file. | |
| 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–. | |
Class to manage exports.
Definition at line 31 of file export.class.php.
| Export::__construct | ( | $db | ) |
| Export::build_file | ( | $user, | |
| $model, | |||
| $datatoexport, | |||
| $array_selected, | |||
| $array_filterValue, | |||
| $sqlquery = '', | |||
| $separator = '' ) |
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
| User | $user | User that export |
| string | $model | Export format |
| string | $datatoexport | Name of dataset to export |
| array | $array_selected | Filter on array of fields to export |
| array | $array_filterValue | Filter on array of fields with a filter |
| string | $sqlquery | If set, transmit the sql request for select (otherwise, sql request is generated from arrays) |
| string | $separator | separator to fill $objmodel->separator with the new separator |
Definition at line 603 of file export.class.php.
References dol_include_once(), dol_mkdir(), dol_now(), dol_print_date(), dol_stringtotime(), dol_syslog(), getDolGlobalString(), and num_open_day().
| Export::build_filterField | ( | $TypeField, | |
| $NameField, | |||
| $ValueField ) |
Build an input field used to filter the query.
| string | $TypeField | Type of Field to filter. Example: Text, Date, List:c_country:label:rowid, List:c_stcom:label:code, Numeric or Number, Boolean |
| string | $NameField | Name of the field to filter |
| string | $ValueField | Initial value of the field to filter |
Definition at line 431 of file export.class.php.
References dol_print_error(), and dol_trunc().
| Export::build_filterQuery | ( | $TypeField, | |
| $NameField, | |||
| $ValueField ) |
Build the conditional string from filter the query.
| string | $TypeField | Type of Field to filter |
| string | $NameField | Name of the field to filter |
| string | $ValueField | Value of the field for filter. Must not be '' |
Definition at line 325 of file export.class.php.
References dol_syslog(), and sanitizeVal().
| Export::build_sql | ( | $indice, | |
| $array_selected, | |||
| $array_filterValue ) |
Build the sql export request.
Arrays this->array_export_xxx are already loaded for required datatoexport
| int | $indice | Indice of export |
| array | $array_selected | Filter fields on array of fields to export |
| array | $array_filterValue | Filter records on array of value for fields |
Definition at line 254 of file export.class.php.
| Export::conditionDate | ( | $Field, | |
| $Value, | |||
| $Sens ) |
conditionDate
| string | $Field | Field operand 1 |
| string | $Value | Value operand 2 |
| string | $Sens | Comparison operator |
Definition at line 409 of file export.class.php.
| Export::create | ( | $user | ) |
Save an export model in database.
| User | $user | Object user that save |
Definition at line 804 of file export.class.php.
References dol_syslog().
| Export::delete | ( | $user, | |
| $notrigger = 0 ) |
Delete object in database.
Definition at line 879 of file export.class.php.
References dol_syslog().
| Export::fetch | ( | $id | ) |
Load an export profil from database.
| int | $id | Id of profil to load |
Definition at line 842 of file export.class.php.
References dol_print_error(), and dol_syslog().
| Export::genDocFilter | ( | $TypeField | ) |
Build an input field used to filter the query.
| string | $TypeField | Type of Field to filter |
Definition at line 562 of file export.class.php.
| Export::list_export_model | ( | ) |
Output list all export models –TODO Move this into a class htmlxxx.class.php–.
Definition at line 917 of file export.class.php.
References dol_print_error(), img_delete(), img_object(), and newToken().
| Export::load_arrays | ( | $user, | |
| $filter = '' ) |
Load an exportable dataset.
| User | $user | Object user making export |
| string | $filter | Load a particular dataset only |
Definition at line 107 of file export.class.php.
References dol_osencode(), dol_syslog(), dolGetModulesDirs(), and verifCond().