49 public $array_export_icon;
54 public $array_export_perms;
73 public $array_export_code = array();
77 public $array_export_code_for_sort = array();
81 public $array_export_module = array();
85 public $array_export_label = array();
89 public $array_export_sql_start = array();
93 public $array_export_sql_end = array();
97 public $array_export_sql_order = array();
102 public $array_export_fields = array();
106 public $array_export_TypeFields = array();
110 public $array_export_FilterValue = array();
114 public $array_export_entities = array();
118 public $array_export_dependencies = array();
122 public $array_export_special = array();
126 public $array_export_examplevalues = array();
130 public $array_export_help = array();
140 public $hexafiltervalue;
144 public $datatoexport;
157 public $sqlusedforexport;
184 dol_syslog(get_class($this).
"::load_arrays user=".$user->id.
" filter=".$filter);
189 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
193 foreach ($modulesdir as $dir) {
196 if (is_resource($handle)) {
198 while (($file = readdir($handle)) !==
false) {
200 if (preg_match(
'/\.back$/i', $file)) {
205 if (is_readable($dir.$file) && preg_match(
"/^(mod.*)\.class\.php$/i", $file, $reg)) {
206 $modulename = $reg[1];
210 $part = strtolower(preg_replace(
'/^mod/i',
'', $modulename));
211 if ($part ==
'propale') {
214 if (empty(
$conf->$part->enabled)) {
220 $file = $dir.$modulename.
".class.php";
221 $classname = $modulename;
223 $module =
new $classname($this->db);
224 '@phan-var-force DolibarrModules $module';
226 if (isset($module->export_code) && is_array($module->export_code)) {
227 foreach ($module->export_code as $r => $value) {
229 if ($filter && ($filter != $module->export_code[$r])) {
234 if (!empty($module->export_enabled[$r]) && !
verifCond($module->export_enabled[$r])) {
240 if (isset($module->export_permission)) {
241 foreach ($module->export_permission[$r] as $val) {
244 if (!empty($perm[2])) {
245 $bool = isset($user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]}) ? $user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]} :
false;
246 } elseif (!empty($perm[1])) {
247 $bool = isset($user->rights->{$perm[0]}->{$perm[1]}) ? $user->rights->{$perm[0]}->{$perm[1]} :
false;
251 if ($perm[0] ==
'user' && $user->admin) {
265 $langtoload = $module->getLangFilesArray();
266 if (is_array($langtoload)) {
267 foreach ($langtoload as $key) {
274 $this->array_export_module[$i] = $module;
276 $this->array_export_perms[$i] = $bool;
278 $this->array_export_icon[$i] = (isset($module->export_icon[$r]) ? $module->export_icon[$r] : $module->picto);
280 $this->array_export_code[$i] = $module->export_code[$r];
282 $this->array_export_code_for_sort[$i] = $module->module_position.
'_'.$module->export_code[$r];
284 $this->array_export_label[$i] = $module->getExportDatasetLabel($r);
286 $this->array_export_fields[$i] = (isset($module->export_fields_array[$r]) ? $module->export_fields_array[$r] : []);
288 $this->array_export_TypeFields[$i] = (isset($module->export_TypeFields_array[$r]) ? $module->export_TypeFields_array[$r] :
'');
290 $this->array_export_entities[$i] = (isset($module->export_entities_array[$r]) ? $module->export_entities_array[$r] :
'');
292 $this->array_export_dependencies[$i] = (!empty($module->export_dependencies_array[$r]) ? $module->export_dependencies_array[$r] :
'');
294 $this->array_export_special[$i] = (!empty($module->export_special_array[$r]) ? $module->export_special_array[$r] :
'');
296 $this->array_export_examplevalues[$i] = (!empty($module->export_examplevalues_array[$r]) ? $module->export_examplevalues_array[$r] :
null);
298 $this->array_export_help[$i] = (!empty($module->export_help_array[$r]) ? $module->export_help_array[$r] :
'');
301 $this->array_export_sql_start[$i] = $module->export_sql_start[$r];
302 $this->array_export_sql_end[$i] = $module->export_sql_end[$r];
303 $this->array_export_sql_order[$i] = (!empty($module->export_sql_order[$r]) ? $module->export_sql_order[$r] :
null);
307 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]) :
''));
333 public function build_sql($indice, $array_selected, $array_filterValue)
337 $sql = $this->array_export_sql_start[$indice];
341 foreach ($this->array_export_fields[$indice] as $key => $value) {
342 if (!array_key_exists($key, $array_selected)) {
345 if (preg_match(
'/^none\./', $key)) {
354 if (strpos($key,
' as ') ===
false) {
355 $newfield = $key.
' as '.str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
362 $sql .= $this->array_export_sql_end[$indice];
365 if (is_array($array_filterValue) && !empty($array_filterValue)) {
368 foreach ($array_filterValue as $key => $value) {
369 if (preg_match(
'/GROUP_CONCAT/i', $key)) {
373 $sqlWhere .=
" AND ".$this->buildFilterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
380 $sql .= $this->array_export_sql_order[$indice];
383 if (is_array($array_filterValue) && !empty($array_filterValue)) {
385 foreach ($array_filterValue as $key => $value) {
386 if (preg_match(
'/GROUP_CONCAT/i', $key) and $value !=
'') {
387 $sql .=
" HAVING ".$this->buildFilterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]);
410 $InfoFieldList = explode(
":", $TypeField);
412 switch ($InfoFieldList[0]) {
414 if (!(strpos($ValueField,
'%') ===
false)) {
415 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" LIKE '".$this->db->escape($ValueField).
"'";
417 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" = '".$this->db->escape($ValueField).
"'";
421 if (strpos($ValueField,
"+") > 0) {
423 $ValueArray = explode(
"+", $ValueField);
424 $szFilterQuery =
"(".$this->conditionDate($NameField, trim($ValueArray[0]),
">=");
425 $szFilterQuery .=
" AND ".$this->conditionDate($NameField, trim($ValueArray[1]),
"<=").
")";
427 if (is_numeric(substr($ValueField, 0, 1))) {
428 $szFilterQuery = $this->conditionDate($NameField, trim($ValueField),
"=");
430 $szFilterQuery = $this->conditionDate($NameField, trim(substr($ValueField, 1)), substr($ValueField, 0, 1));
437 if (strpos($ValueField,
"+") > 0) {
439 $ValueArray = explode(
"+", $ValueField);
440 $szFilterQuery =
"(".$this->db->sanitize($NameField).
" >= ".((float) $ValueArray[0]);
441 $szFilterQuery .=
" AND ".$this->db->sanitize($NameField).
" <= ".((float) $ValueArray[1]).
")";
443 if (is_numeric(substr($ValueField, 0, 1))) {
444 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" = ".((float) $ValueField);
446 $szFilterQuery =
" ".$this->db->sanitize($NameField).substr($ValueField, 0, 1).((float) substr($ValueField, 1));
451 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" = ".(is_numeric($ValueField) ? $ValueField : ($ValueField ==
'yes' ? 1 : 0));
454 if (is_numeric($ValueField) && $ValueField > 0) {
455 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" = ".((float) $ValueField);
457 $szFilterQuery =
" 1=1";
462 if (is_numeric($ValueField)) {
463 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" = ".((float) $ValueField);
465 if (!(strpos($ValueField,
'%') ===
false)) {
466 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" LIKE '".$this->db->escape($ValueField).
"'";
468 $szFilterQuery =
" ".$this->db->sanitize($NameField).
" = '".$this->db->escape($ValueField).
"'";
473 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);
476 return $szFilterQuery;
490 if (strlen($Value) == 4) {
491 $Condition =
" date_format(".$Field.
",'%Y') ".$Sens.
" '".$this->db->escape($Value).
"'";
492 } elseif (strlen($Value) == 6) {
493 $Condition =
" date_format(".$Field.
",'%Y%m') ".$Sens.
" '".$this->db->escape($Value).
"'";
495 $Condition =
" date_format(".$Field.
",'%Y%m%d') ".$Sens.
" '".$this->db->escape($Value).
"'";
512 global $langs, $form;
515 $InfoFieldList = explode(
":", $TypeField);
518 switch ($InfoFieldList[0]) {
521 $szFilterField =
'<input type="text" name="'.$NameField.
'" value="'.$ValueField.
'">';
527 $szFilterField =
'<input type="text" size="6" name="'.$NameField.
'" value="'.$ValueField.
'">';
530 $szFilterField =
'<input type="number" size="6" name="'.$NameField.
'" value="'.$ValueField.
'">';
533 $szFilterField =
'<select name="'.$NameField.
'" id="'.
dol_escape_all($NameField).
'" class="flat width75 maxwidth75">';
534 $szFilterField .=
'<option ';
535 if ($ValueField ==
'') {
536 $szFilterField .=
' selected ';
538 $szFilterField .=
' value=""> </option>';
540 $szFilterField .=
'<option ';
541 if ($ValueField ==
'yes' || $ValueField ==
'1') {
542 $szFilterField .=
' selected ';
544 $szFilterField .=
' value="1">'.yn(1).
'</option>';
546 $szFilterField .=
'<option ';
547 if ($ValueField ==
'no' || $ValueField ==
'0') {
548 $szFilterField .=
' selected ';
550 $szFilterField .=
' value="0">'.yn(0).
'</option>';
551 $szFilterField .=
"</select>";
556 if ($InfoFieldList[1] ==
'select_company') {
557 $szFilterField .= $form->select_company(
'', $NameField,
'', 1, 0, 0, [], 0,
'maxwidth200');
558 } elseif ($InfoFieldList[1] ==
'selectcontacts') {
560 $szFilterField .= $form->select_contact(0,
'', $NameField,
' ',
'',
'', 0,
'minwidth100imp maxwidth200',
true);
561 } elseif ($InfoFieldList[1] ==
'select_dolusers') {
562 $szFilterField .= $form->select_dolusers(
'', $NameField, 1,
null, 0,
'',
'',
'', 0, 0,
"", 0,
"",
"maxwidth200");
572 if (!empty($InfoFieldList[3])) {
573 $keyList = $InfoFieldList[3];
577 $sql =
"SELECT ".$this->db->sanitize($keyList).
" as rowid, ".$this->db->sanitize($InfoFieldList[2]).
" as label".(empty($InfoFieldList[3]) ?
"" :
", ".$this->db->sanitize($InfoFieldList[3]).
" as code");
578 if ($InfoFieldList[1] ==
'c_stcomm') {
579 $sql =
"SELECT id as id, ".$this->db->sanitize($keyList).
" as rowid, ".$InfoFieldList[2].
" as label".(empty($InfoFieldList[3]) ?
"" :
", ".$this->db->sanitize($InfoFieldList[3]).
' as code');
581 if ($InfoFieldList[1] ==
'c_country') {
582 $sql =
"SELECT ".$this->db->sanitize($keyList).
" as rowid, ".$this->db->sanitize($InfoFieldList[2]).
" as label, code as code";
584 $sql .=
" FROM ".MAIN_DB_PREFIX.$this->db->sanitize($InfoFieldList[1]);
585 if (!empty($InfoFieldList[4])) {
586 $sql .=
' WHERE entity IN ('.getEntity($InfoFieldList[4]).
')';
589 $resql = $this->db->query($sql);
591 $szFilterField =
'<select class="minwidth300 maxwidth500" name="'.$NameField.
'" id="'.
dol_escape_all($NameField).
'">';
592 $szFilterField .=
'<option value="0"> </option>';
593 $num = $this->db->num_rows($resql);
598 $obj = $this->db->fetch_object($resql);
599 if ($obj->label ==
'-') {
605 $labeltoshow = $obj->label;
606 if ($InfoFieldList[1] ==
'c_stcomm') {
607 $langs->load(
"companies");
608 $labeltoshow = (($langs->trans(
"StatusProspect".$obj->id) !=
"StatusProspect".$obj->id) ? $langs->trans(
"StatusProspect".$obj->id) : $obj->label);
610 if ($InfoFieldList[1] ==
'c_country') {
612 $langs->load(
"dict");
613 $labeltoshow = (($langs->trans(
"Country".$obj->code) !=
"Country".$obj->code) ? $langs->trans(
"Country".$obj->code) : $obj->label);
615 if (!empty($ValueField) && $ValueField == $obj->rowid) {
618 $szFilterField .=
'<option value="'.$obj->rowid.
'" data-html="'.
dolPrintHTMLForAttribute($labeltoshow).
'">'.$labeltoshow.
'</option>';
623 $szFilterField .=
"</select>";
626 $this->db->free($resql);
633 return $szFilterField;
647 $InfoFieldList = explode(
":", $TypeField);
649 switch ($InfoFieldList[0]) {
651 $szMsg = $langs->trans(
'ExportStringFilter');
654 $szMsg = $langs->trans(
'ExportDateFilter');
658 $szMsg = $langs->trans(
'ExportNumericFilter');
683 public function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery =
'', $separator =
'')
689 asort($array_selected);
691 dol_syslog(__METHOD__.
" ".$model.
", ".$datatoexport.
", ".implode(
",", $array_selected));
694 if (empty($this->array_export_fields) || !is_array($this->array_export_fields)) {
695 $this->error =
"ErrorBadParameter";
701 $dir = DOL_DOCUMENT_ROOT.
"/core/modules/export/";
702 $file =
"export_".$model.
".modules.php";
703 $classname =
"Export".$model;
704 require_once $dir.$file;
705 $objmodel =
new $classname($this->db);
707 '@phan-var-force ModeleExports $objmodel';
709 if (in_array($model, array(
'csvutf8',
'csviso')) && !empty($separator) && empty($objmodel->separator)) {
710 $objmodel->separator = $separator;
713 if (!empty($sqlquery)) {
718 foreach ($this->array_export_code as $key => $dataset) {
719 if ($datatoexport == $dataset) {
726 if (empty($foundindice)) {
727 $this->error =
"ErrorBadParameter can't find dataset ".$datatoexport.
" into preload arrays this->array_export_code";
730 $sql = $this->build_sql($indice, $array_selected, $array_filterValue);
734 $this->sqlusedforexport = $sql;
736 $resql = $this->db->query($sql);
742 $filename =
"export_".$datatoexport;
747 $filename .=
'.'.$objmodel->getDriverExtension();
748 $dirname =
$conf->export->dir_temp.
'/'.$user->id;
750 $outputlangs = clone $langs;
754 $result = $objmodel->open_file($dirname.
"/".$filename, $outputlangs);
758 $objmodel->write_header($outputlangs);
761 $objmodel->write_title($this->array_export_fields[$indice], $array_selected, $outputlangs, isset($this->array_export_TypeFields[$indice]) ? $this->array_export_TypeFields[$indice] : null);
764 $counterlineexported = 0;
765 while ($obj = $this->db->fetch_object($resql)) {
766 $counterlineexported++;
772 if (!empty($this->array_export_special[$indice])) {
773 foreach ($this->array_export_special[$indice] as $key => $value) {
774 if (!array_key_exists($key, $array_selected)) {
779 $item = $this->array_export_special[$indice][$key];
781 if (is_string($item) && $item ==
'NULLIFNEG') {
783 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
784 if ($obj->$alias < 0) {
787 } elseif (is_string($item) && $item ==
'ZEROIFNEG') {
790 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
791 if ($obj->$alias < 0) {
794 } elseif (is_string($item) && $item ==
'getNumOpenDays') {
796 include_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
799 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
800 $country_id =
$mysoc->country_id;
801 if ($obj->u_fk_country > 0) {
802 $country_id = $obj->u_fk_country;
806 } elseif (is_string($item) && $item ==
'getRemainToPay') {
809 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
811 if ($obj->f_rowid > 0) {
812 global $tmpobjforcomputecall;
813 if (!is_object($tmpobjforcomputecall)) {
814 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
815 $tmpobjforcomputecall =
new Facture($this->db);
817 $tmpobjforcomputecall->id = $obj->f_rowid;
818 $tmpobjforcomputecall->total_ttc = $obj->f_total_ttc;
819 $tmpobjforcomputecall->close_code = $obj->f_close_code;
820 $remaintopay = $tmpobjforcomputecall->getRemainToPay();
822 $obj->$alias = $remaintopay;
823 } elseif (is_array($item) && array_key_exists(
'rule', $item) && $item[
'rule'] ==
'compute') {
825 $alias = str_replace(array(
'.',
'-',
'(',
')'),
'_', $key);
827 if (!empty($item[
'class']) &&
828 !empty($item[
'classfile']) &&
829 !empty($item[
'method'])
832 $this->error =
"Computed field bad configuration: {$item['classfile']} not found";
836 if (!class_exists($item[
'class'])) {
837 $this->error =
"Computed field bad configuration: {$item['class']} class doesn't exist";
841 $className = $item[
'class'];
842 $tmpObject =
new $className($this->db);
843 '@phan-var-force CommonObject $tmpObject';
845 if (!method_exists($tmpObject, $item[
'method'])) {
846 $this->error =
"Computed field bad configuration: {$item['method']} method doesn't exist";
852 if (!empty($item[
'method_params'])) {
854 foreach ($item[
'method_params'] as $paramName) {
855 if (property_exists($obj, $paramName)) {
856 $params[] = $obj->$paramName;
858 $params[] = $paramName;
863 $value = $tmpObject->$methodName(...$params);
865 $obj->$alias = $value;
874 $this->error =
"ERRORNOTSUPPORTED. Operation not supported. Export of ".var_export($key,
true).
' '.var_export($item,
true).
" computed extrafields is not yet supported, please remove field.";
880 $objmodel->write_record($array_selected, $obj, $outputlangs, isset($this->array_export_TypeFields[$indice]) ? $this->array_export_TypeFields[$indice] : null);
884 $objmodel->write_footer($outputlangs);
887 $objmodel->close_file();
891 $this->error = $objmodel->error;
892 dol_syslog(
"Export::build_file Error: ".$this->error, LOG_ERR);
896 $this->error = $this->db->error().
" - sql=".$sql;
913 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.
'export_model (';
919 $sql .=
') VALUES (';
920 $sql .=
"'".$this->db->escape($this->model_name).
"',";
921 $sql .=
" '".$this->db->escape($this->datatoexport).
"',";
922 $sql .=
" '".$this->db->escape($this->hexa).
"',";
923 $sql .=
' '.(isset($this->fk_user) ? (int) $this->fk_user :
'null').
",";
924 $sql .=
" '".$this->db->escape($this->hexafiltervalue).
"'";
927 $resql = $this->db->query($sql);
932 $this->error = $this->db->lasterror();
933 $this->errno = $this->db->lasterrno();
934 $this->db->rollback();
947 $sql =
'SELECT em.rowid, em.label, em.type, em.field, em.filter';
948 $sql .=
' FROM '.MAIN_DB_PREFIX.
'export_model as em';
949 $sql .=
' WHERE em.rowid = '.((int)
$id);
952 $result = $this->db->query($sql);
954 $obj = $this->db->fetch_object($result);
956 $this->
id = $obj->rowid;
957 $this->model_name = $obj->label;
958 $this->datatoexport = $obj->type;
960 $this->hexa = $obj->field;
961 $this->hexafiltervalue = $obj->filter;
965 $this->error =
"ModelNotFound";
982 public function delete($user, $notrigger = 0)
986 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"export_model";
987 $sql .=
" WHERE rowid=".((int) $this->
id);
991 dol_syslog(get_class($this).
"::delete", LOG_DEBUG);
992 $resql = $this->db->query($sql);
995 $this->errors[] =
"Error ".$this->db->lasterror();
1000 foreach ($this->errors as $errmsg) {
1001 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
1002 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
1004 $this->db->rollback();
1007 $this->db->commit();
1024 $sql =
"SELECT em.rowid, em.field, em.label, em.type, em.filter";
1025 $sql .=
" FROM ".MAIN_DB_PREFIX.
"export_model as em";
1026 $sql .=
" ORDER BY rowid";
1028 $result = $this->db->query($sql);
1030 $num = $this->db->num_rows($result);
1033 $obj = $this->db->fetch_object($result);
1034 $keyModel = array_search($obj->type, $this->array_export_code);
1036 print
'<td><a href=export.php?step=2&action=select_model&exportmodelid='.$obj->rowid.
'&datatoexport='.$obj->type.
'>'.$obj->label.
'</a></td>';
1038 print
img_object($this->array_export_module[$keyModel]->getName(), $this->array_export_icon[$keyModel]).
' ';
1039 print $this->array_export_module[$keyModel]->getName().
' - ';
1042 $string = $langs->trans($this->array_export_label[$keyModel]);
1043 print($string != $this->array_export_label[$keyModel] ? $string : $this->array_export_label[$keyModel]);
1046 print
'<td>'.str_replace(
',',
' , ', $obj->field).
'</td>';
1047 if (!empty($obj->filter)) {
1048 $filter = json_decode($obj->filter,
true);
1049 print
'<td>'.str_replace(
',',
' , ', $filter[
'field']).
'</td>';
1050 print
'<td>'.str_replace(
',',
' , ', $filter[
'value']).
'</td>';
1053 print
'<td class="right">';
1054 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=deleteprof&token='.newToken().
'&id='.$obj->rowid.
'">';
$id
Support class for third parties, contacts, members, users or resources.
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
fetch($id)
Load an export profil from database.
buildFilterQuery($TypeField, $NameField, $ValueField)
Build the conditional string from filter the query.
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.
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.
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, $countryCodeOrId='', $user_id=0)
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.
dol_now($mode='gmt')
Return date for now.
verifCond($strToEvaluate, $onlysimplestring='1')
Verify if condition in string is ok or not.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
dolPrintHTMLForAttribute($s, $escapeonlyhtmltags=0, $allowothertags=array())
Return a string ready to be output into an HTML attribute (alt, title, data-html, ....
dol_escape_all($stringtoescape)
Returns text escaped for all protocols (so only alpha chars and numbers)
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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)