47 public $array_export_icon;
52 public $array_export_perms;
71 public $array_export_code = array();
75 public $array_export_code_for_sort = array();
79 public $array_export_module = array();
83 public $array_export_label = array();
87 public $array_export_sql_start = array();
91 public $array_export_sql_end = array();
95 public $array_export_sql_order = array();
100 public $array_export_fields = array();
104 public $array_export_TypeFields = array();
108 public $array_export_FilterValue = array();
112 public $array_export_entities = array();
116 public $array_export_dependencies = array();
120 public $array_export_special = array();
124 public $array_export_examplevalues = array();
128 public $array_export_help = array();
138 public $hexafiltervalue;
142 public $datatoexport;
155 public $sqlusedforexport;
180 global $langs, $conf, $mysoc;
182 dol_syslog(get_class($this).
"::load_arrays user=".$user->id.
" filter=".$filter);
187 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
191 foreach ($modulesdir as $dir) {
194 if (is_resource($handle)) {
196 while (($file = readdir($handle)) !==
false) {
198 if (is_readable($dir.$file) && preg_match(
"/^(mod.*)\.class\.php$/i", $file, $reg)) {
199 $modulename = $reg[1];
203 $part = strtolower(preg_replace(
'/^mod/i',
'', $modulename));
204 if ($part ==
'propale') {
207 if (empty($conf->$part->enabled)) {
213 $file = $dir.$modulename.
".class.php";
214 $classname = $modulename;
216 $module =
new $classname($this->db);
217 '@phan-var-force DolibarrModules $module';
219 if (isset($module->export_code) && is_array($module->export_code)) {
220 foreach ($module->export_code as $r => $value) {
222 if ($filter && ($filter != $module->export_code[$r])) {
227 if (!empty($module->export_enabled[$r]) && !
verifCond($module->export_enabled[$r])) {
233 if (isset($module->export_permission)) {
234 foreach ($module->export_permission[$r] as $val) {
237 if (!empty($perm[2])) {
238 $bool = isset($user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]}) ? $user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]} :
false;
239 } elseif (!empty($perm[1])) {
240 $bool = isset($user->rights->{$perm[0]}->{$perm[1]}) ? $user->rights->{$perm[0]}->{$perm[1]} :
false;
244 if ($perm[0] ==
'user' && $user->admin) {
258 $langtoload = $module->getLangFilesArray();
259 if (is_array($langtoload)) {
260 foreach ($langtoload as $key) {
267 $this->array_export_module[$i] = $module;
269 $this->array_export_perms[$i] = $bool;
271 $this->array_export_icon[$i] = (isset($module->export_icon[$r]) ? $module->export_icon[$r] : $module->picto);
273 $this->array_export_code[$i] = $module->export_code[$r];
275 $this->array_export_code_for_sort[$i] = $module->module_position.
'_'.$module->export_code[$r];
277 $this->array_export_label[$i] = $module->getExportDatasetLabel($r);
279 $this->array_export_fields[$i] = $module->export_fields_array[$r];
281 $this->array_export_TypeFields[$i] = (isset($module->export_TypeFields_array[$r]) ? $module->export_TypeFields_array[$r] :
'');
283 $this->array_export_entities[$i] = $module->export_entities_array[$r];
285 $this->array_export_dependencies[$i] = (!empty($module->export_dependencies_array[$r]) ? $module->export_dependencies_array[$r] :
'');
287 $this->array_export_special[$i] = (!empty($module->export_special_array[$r]) ? $module->export_special_array[$r] :
'');
289 $this->array_export_examplevalues[$i] = (!empty($module->export_examplevalues_array[$r]) ? $module->export_examplevalues_array[$r] :
null);
291 $this->array_export_help[$i] = (!empty($module->export_help_array[$r]) ? $module->export_help_array[$r] :
'');
294 $this->array_export_sql_start[$i] = $module->export_sql_start[$r];
295 $this->array_export_sql_end[$i] = $module->export_sql_end[$r];
296 $this->array_export_sql_order[$i] = (!empty($module->export_sql_order[$r]) ? $module->export_sql_order[$r] :
null);
300 dol_syslog(get_class($this).
"::load_arrays loaded for module ".$modulename.
" with index ".$i.
", dataset=".$module->export_code[$r].
", nb of fields=".(property_exists($module,
'export_fields_code') && !empty($module->export_fields_code[$r]) ? count($module->export_fields_code[$r]) :
''));
326 public function build_sql($indice, $array_selected, $array_filterValue)
330 $sql = $this->array_export_sql_start[$indice];
334 foreach ($this->array_export_fields[$indice] as $key => $value) {
335 if (!array_key_exists($key, $array_selected)) {
338 if (preg_match(
'/^none\./', $key)) {
347 if (strpos($key,
' as ') ===
false) {
348 $newfield = $key.
' as '.str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
355 $sql .= $this->array_export_sql_end[$indice];
358 if (is_array($array_filterValue) && !empty($array_filterValue)) {
361 foreach ($array_filterValue as $key => $value) {
362 if (preg_match(
'/GROUP_CONCAT/i', $key)) {
366 $sqlWhere .=
" AND ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
373 $sql .= $this->array_export_sql_order[$indice];
376 if (is_array($array_filterValue) && !empty($array_filterValue)) {
378 foreach ($array_filterValue as $key => $value) {
379 if (preg_match(
'/GROUP_CONCAT/i', $key) and $value !=
'') {
380 $sql .=
" HAVING ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
404 $InfoFieldList = explode(
":", $TypeField);
406 switch ($InfoFieldList[0]) {
408 if (!(strpos($ValueField,
'%') ===
false)) {
409 $szFilterQuery =
" ".$NameField.
" LIKE '".$this->db->escape($ValueField).
"'";
411 $szFilterQuery =
" ".$NameField.
" = '".$this->db->escape($ValueField).
"'";
415 if (strpos($ValueField,
"+") > 0) {
417 $ValueArray = explode(
"+", $ValueField);
418 $szFilterQuery =
"(".$this->conditionDate($NameField, trim($ValueArray[0]),
">=");
419 $szFilterQuery .=
" AND ".$this->conditionDate($NameField, trim($ValueArray[1]),
"<=").
")";
421 if (is_numeric(substr($ValueField, 0, 1))) {
422 $szFilterQuery = $this->conditionDate($NameField, trim($ValueField),
"=");
424 $szFilterQuery = $this->conditionDate($NameField, trim(substr($ValueField, 1)), substr($ValueField, 0, 1));
432 if (strpos($ValueField,
"+") > 0) {
434 $ValueArray = explode(
"+", $ValueField);
435 $szFilterQuery =
"(".$NameField.
" >= ".((float) $ValueArray[0]);
436 $szFilterQuery .=
" AND ".$NameField.
" <= ".((float) $ValueArray[1]).
")";
438 if (is_numeric(substr($ValueField, 0, 1))) {
439 $szFilterQuery =
" ".$NameField.
" = ".((float) $ValueField);
441 $szFilterQuery =
" ".$NameField.substr($ValueField, 0, 1).((float) substr($ValueField, 1));
446 $szFilterQuery =
" ".$NameField.
"=".(is_numeric($ValueField) ? $ValueField : ($ValueField ==
'yes' ? 1 : 0));
449 if (is_numeric($ValueField) && $ValueField > 0) {
450 $szFilterQuery =
" ".$NameField.
" = ".((float) $ValueField);
452 $szFilterQuery =
" 1=1";
457 if (is_numeric($ValueField)) {
458 $szFilterQuery =
" ".$NameField.
" = ".((float) $ValueField);
460 if (!(strpos($ValueField,
'%') ===
false)) {
461 $szFilterQuery =
" ".$NameField.
" LIKE '".$this->db->escape($ValueField).
"'";
463 $szFilterQuery =
" ".$NameField.
" = '".$this->db->escape($ValueField).
"'";
468 dol_syslog(
"Error we try to forge an sql export request with a condition on a field with type ".$InfoFieldList[0].
" (defined into module descriptor) but this type is unknown/not supported. It looks like a bug into module descriptor.", LOG_ERR);
471 return $szFilterQuery;
485 if (strlen($Value) == 4) {
486 $Condition =
" date_format(".$Field.
",'%Y') ".$Sens.
" '".$this->db->escape($Value).
"'";
487 } elseif (strlen($Value) == 6) {
488 $Condition =
" date_format(".$Field.
",'%Y%m') ".$Sens.
" '".$this->db->escape($Value).
"'";
490 $Condition =
" date_format(".$Field.
",'%Y%m%d') ".$Sens.
" '".$this->db->escape($Value).
"'";
507 global $conf, $langs, $form;
510 $InfoFieldList = explode(
":", $TypeField);
513 switch ($InfoFieldList[0]) {
516 $szFilterField =
'<input type="text" name="'.$NameField.
'" value="'.$ValueField.
'">';
522 $szFilterField =
'<input type="text" size="6" name="'.$NameField.
'" value="'.$ValueField.
'">';
525 $szFilterField =
'<input type="number" size="6" name="'.$NameField.
'" value="'.$ValueField.
'">';
528 $szFilterField =
'<select name="'.$NameField.
'" class="flat">';
529 $szFilterField .=
'<option ';
530 if ($ValueField ==
'') {
531 $szFilterField .=
' selected ';
533 $szFilterField .=
' value=""> </option>';
535 $szFilterField .=
'<option ';
536 if ($ValueField ==
'yes' || $ValueField ==
'1') {
537 $szFilterField .=
' selected ';
539 $szFilterField .=
' value="1">'.yn(1).
'</option>';
541 $szFilterField .=
'<option ';
542 if ($ValueField ==
'no' || $ValueField ==
'0') {
543 $szFilterField .=
' selected ';
545 $szFilterField .=
' value="0">'.yn(0).
'</option>';
546 $szFilterField .=
"</select>";
550 if ($InfoFieldList[1] ==
'select_company') {
551 $szFilterField .= $form->select_company(
'', $NameField,
'', 1, 0, 0, [], 0,
'maxwidth200');
552 } elseif ($InfoFieldList[1] ==
'selectcontacts') {
554 $szFilterField .= $form->select_contact(0,
'', $NameField,
' ',
'',
'', 0,
'minwidth100imp maxwidth200',
true);
555 } elseif ($InfoFieldList[1] ==
'select_dolusers') {
556 $szFilterField .= $form->select_dolusers(
'', $NameField, 1,
null, 0,
'',
'',
'', 0, 0,
"", 0,
"",
"maxwidth200");
566 if (!empty($InfoFieldList[3])) {
567 $keyList = $InfoFieldList[3];
571 $sql =
"SELECT ".$keyList.
" as rowid, ".$InfoFieldList[2].
" as label".(empty($InfoFieldList[3]) ?
"" :
", ".$InfoFieldList[3].
" as code");
572 if ($InfoFieldList[1] ==
'c_stcomm') {
573 $sql =
"SELECT id as id, ".$keyList.
" as rowid, ".$InfoFieldList[2].
" as label".(empty($InfoFieldList[3]) ?
"" :
", ".$InfoFieldList[3].
' as code');
575 if ($InfoFieldList[1] ==
'c_country') {
576 $sql =
"SELECT ".$keyList.
" as rowid, ".$InfoFieldList[2].
" as label, code as code";
578 $sql .=
" FROM ".MAIN_DB_PREFIX.$InfoFieldList[1];
579 if (!empty($InfoFieldList[4])) {
580 $sql .=
' WHERE entity IN ('.getEntity($InfoFieldList[4]).
')';
583 $resql = $this->db->query($sql);
585 $szFilterField =
'<select class="flat" name="'.$NameField.
'">';
586 $szFilterField .=
'<option value="0"> </option>';
587 $num = $this->db->num_rows($resql);
592 $obj = $this->db->fetch_object($resql);
593 if ($obj->label ==
'-') {
599 $labeltoshow =
dol_trunc($obj->label, 18);
600 if ($InfoFieldList[1] ==
'c_stcomm') {
601 $langs->load(
"companies");
602 $labeltoshow = (($langs->trans(
"StatusProspect".$obj->id) !=
"StatusProspect".$obj->id) ? $langs->trans(
"StatusProspect".$obj->id) : $obj->label);
604 if ($InfoFieldList[1] ==
'c_country') {
606 $langs->load(
"dict");
607 $labeltoshow = (($langs->trans(
"Country".$obj->code) !=
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label);
609 if (!empty($ValueField) && $ValueField == $obj->rowid) {
610 $szFilterField .=
'<option value="'.$obj->rowid.
'" selected>'.$labeltoshow.
'</option>';
612 $szFilterField .=
'<option value="'.$obj->rowid.
'" >'.$labeltoshow.
'</option>';
617 $szFilterField .=
"</select>";
619 $this->db->free($resql);
626 return $szFilterField;
640 $InfoFieldList = explode(
":", $TypeField);
642 switch ($InfoFieldList[0]) {
644 $szMsg = $langs->trans(
'ExportStringFilter');
647 $szMsg = $langs->trans(
'ExportDateFilter');
652 $szMsg = $langs->trans(
'ExportNumericFilter');
677 public function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery =
'', $separator =
'')
680 global $conf, $langs, $mysoc;
683 asort($array_selected);
685 dol_syslog(__METHOD__.
" ".$model.
", ".$datatoexport.
", ".implode(
",", $array_selected));
688 if (empty($this->array_export_fields) || !is_array($this->array_export_fields)) {
689 $this->error =
"ErrorBadParameter";
695 $dir = DOL_DOCUMENT_ROOT.
"/core/modules/export/";
696 $file =
"export_".$model.
".modules.php";
697 $classname =
"Export".$model;
698 require_once $dir.$file;
699 $objmodel =
new $classname($this->db);
700 '@phan-var-force ModeleExports $objmodel';
702 if (in_array($model, array(
'csvutf8',
'csviso')) && !empty($separator) && property_exists($objmodel,
'separator')) {
704 $objmodel->separator = $separator;
707 if (!empty($sqlquery)) {
712 foreach ($this->array_export_code as $key => $dataset) {
713 if ($datatoexport == $dataset) {
720 if (empty($foundindice)) {
721 $this->error =
"ErrorBadParameter can't find dataset ".$datatoexport.
" into preload arrays this->array_export_code";
724 $sql = $this->build_sql($indice, $array_selected, $array_filterValue);
728 $this->sqlusedforexport = $sql;
730 $resql = $this->db->query($sql);
736 $filename =
"export_".$datatoexport;
741 $filename .=
'.'.$objmodel->getDriverExtension();
742 $dirname = $conf->export->dir_temp.
'/'.$user->id;
744 $outputlangs = clone $langs;
748 $result = $objmodel->open_file($dirname.
"/".$filename, $outputlangs);
752 $objmodel->write_header($outputlangs);
755 $objmodel->write_title($this->array_export_fields[$indice], $array_selected, $outputlangs, isset($this->array_export_TypeFields[$indice]) ? $this->array_export_TypeFields[$indice] :
null);
757 while ($obj = $this->db->fetch_object($resql)) {
759 if (!empty($this->array_export_special[$indice])) {
760 foreach ($this->array_export_special[$indice] as $key => $value) {
761 if (!array_key_exists($key, $array_selected)) {
766 $item = $this->array_export_special[$indice][$key];
768 if (is_string($item) && $item ==
'NULLIFNEG') {
770 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
771 if ($obj->$alias < 0) {
774 } elseif (is_string($item) && $item ==
'ZEROIFNEG') {
777 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
778 if ($obj->$alias < 0) {
781 } elseif (is_string($item) && $item ==
'getNumOpenDays') {
783 include_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
785 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
787 } elseif (is_string($item) && $item ==
'getRemainToPay') {
790 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
792 if ($obj->f_rowid > 0) {
793 global $tmpobjforcomputecall;
794 if (!is_object($tmpobjforcomputecall)) {
795 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
796 $tmpobjforcomputecall =
new Facture($this->db);
798 $tmpobjforcomputecall->id = $obj->f_rowid;
799 $tmpobjforcomputecall->total_ttc = $obj->f_total_ttc;
800 $tmpobjforcomputecall->close_code = $obj->f_close_code;
801 $remaintopay = $tmpobjforcomputecall->getRemainToPay();
803 $obj->$alias = $remaintopay;
804 } elseif (is_array($item) &&
805 array_key_exists(
'rule', $item) &&
806 $item[
'rule'] ==
'compute'
809 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
811 if (!empty($item[
'class']) &&
812 !empty($item[
'classfile']) &&
813 !empty($item[
'method'])
816 $this->error =
"Computed field bad configuration: {$item['classfile']} not found";
820 if (!class_exists($item[
'class'])) {
821 $this->error =
"Computed field bad configuration: {$item['class']} class doesn't exist";
825 $className = $item[
'class'];
826 $tmpObject =
new $className($this->db);
827 '@phan-var-force CommonObject $tmpObject';
829 if (!method_exists($tmpObject, $item[
'method'])) {
830 $this->error =
"Computed field bad configuration: {$item['method']} method doesn't exist";
834 $methodName = $item[
'method'];
836 if (!empty($item[
'method_params'])) {
837 foreach ($item[
'method_params'] as $paramName) {
838 $params[] = $obj->$paramName ??
null;
841 $value = $tmpObject->$methodName(...$params);
843 $obj->$alias = $value;
848 $computestring = is_string($item) ? $item : json_encode($item);
852 $this->error =
"ERROPNOTSUPPORTED. Operation ".$computestring.
" not supported. Export of 'computed' extrafields is not yet supported, please remove field.";
858 $objmodel->write_record($array_selected, $obj, $outputlangs, isset($this->array_export_TypeFields[$indice]) ? $this->array_export_TypeFields[$indice] :
null);
862 $objmodel->write_footer($outputlangs);
865 $objmodel->close_file();
869 $this->error = $objmodel->error;
870 dol_syslog(
"Export::build_file Error: ".$this->error, LOG_ERR);
874 $this->error = $this->db->error().
" - sql=".$sql;
891 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.
'export_model (';
897 $sql .=
') VALUES (';
898 $sql .=
"'".$this->db->escape($this->model_name).
"',";
899 $sql .=
" '".$this->db->escape($this->datatoexport).
"',";
900 $sql .=
" '".$this->db->escape($this->hexa).
"',";
901 $sql .=
' '.(isset($this->fk_user) ? (int) $this->fk_user :
'null').
",";
902 $sql .=
" '".$this->db->escape($this->hexafiltervalue).
"'";
905 $resql = $this->db->query($sql);
910 $this->error = $this->db->lasterror();
911 $this->errno = $this->db->lasterrno();
912 $this->db->rollback();
925 $sql =
'SELECT em.rowid, em.label, em.type, em.field, em.filter';
926 $sql .=
' FROM '.MAIN_DB_PREFIX.
'export_model as em';
927 $sql .=
' WHERE em.rowid = '.((int)
$id);
930 $result = $this->db->query($sql);
932 $obj = $this->db->fetch_object($result);
934 $this->
id = $obj->rowid;
935 $this->model_name = $obj->label;
936 $this->datatoexport = $obj->type;
938 $this->hexa = $obj->field;
939 $this->hexafiltervalue = $obj->filter;
943 $this->error =
"ModelNotFound";
960 public function delete($user, $notrigger = 0)
962 global $conf, $langs;
965 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"export_model";
966 $sql .=
" WHERE rowid=".((int) $this->
id);
970 dol_syslog(get_class($this).
"::delete", LOG_DEBUG);
971 $resql = $this->db->query($sql);
974 $this->errors[] =
"Error ".$this->db->lasterror();
979 foreach ($this->errors as $errmsg) {
980 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
981 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
983 $this->db->rollback();
1001 global $conf, $langs;
1003 $sql =
"SELECT em.rowid, em.field, em.label, em.type, em.filter";
1004 $sql .=
" FROM ".MAIN_DB_PREFIX.
"export_model as em";
1005 $sql .=
" ORDER BY rowid";
1007 $result = $this->db->query($sql);
1009 $num = $this->db->num_rows($result);
1012 $obj = $this->db->fetch_object($result);
1013 $keyModel = array_search($obj->type, $this->array_export_code);
1015 print
'<td><a href=export.php?step=2&action=select_model&exportmodelid='.$obj->rowid.
'&datatoexport='.$obj->type.
'>'.$obj->label.
'</a></td>';
1017 print
img_object($this->array_export_module[$keyModel]->getName(), $this->array_export_icon[$keyModel]).
' ';
1018 print $this->array_export_module[$keyModel]->getName().
' - ';
1021 $string = $langs->trans($this->array_export_label[$keyModel]);
1022 print($string != $this->array_export_label[$keyModel] ? $string : $this->array_export_label[$keyModel]);
1025 print
'<td>'.str_replace(
',',
' , ', $obj->field).
'</td>';
1026 if (!empty($obj->filter)) {
1027 $filter = json_decode($obj->filter,
true);
1028 print
'<td>'.str_replace(
',',
' , ', $filter[
'field']).
'</td>';
1029 print
'<td>'.str_replace(
',',
' , ', $filter[
'value']).
'</td>';
1032 print
'<td class="right">';
1033 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=deleteprof&token='.
newToken().
'&id='.$obj->rowid.
'">';
fetch($id)
Load an export profil from database.
build_sql($indice, $array_selected, $array_filterValue)
Build the sql export request.
build_filterField($TypeField, $NameField, $ValueField)
Build an input field used to filter the query.
build_filterQuery($TypeField, $NameField, $ValueField)
Build the conditional string from filter the query.
conditionDate($Field, $Value, $Sens)
conditionDate
list_export_model()
Output list all export models –TODO Move this into a class htmlxxx.class.php–.
create($user)
Save an export model in database.
__construct($db)
Constructor.
load_arrays($user, $filter='')
Load an exportable dataset.
build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery='', $separator='')
Build export file.
genDocFilter($TypeField)
Build an input field used to filter the query.
Class to manage invoices.
num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $halfday=0, $country_code='')
Function to return number of working days (and text of units) between two dates (working days)
dol_stringtotime($string, $gm=1)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
dolGetModulesDirs($subdir='')
Return list of directories that contain modules.
verifCond($strToEvaluate, $onlysimplestring='1')
Verify if condition in string is ok or not.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
dol_now($mode='auto')
Return date for now.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
sanitizeVal($out='', $check='alphanohtml', $filter=null, $options=null)
Return a sanitized or empty value after checking value against a rule.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)