26'@phan-var-force DolibarrModules $this';
32if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) {
34 dol_print_error(
null,
'include of file extrafieldsinimport.inc.php was done but var $keyforselect or $keyforelement or $keyforaliasextra was not set');
39$sql =
"SELECT name, label, type, param, fieldcomputed, fielddefault, fieldrequired FROM ".MAIN_DB_PREFIX.
"extrafields";
40$sql .=
" WHERE elementtype = '".$this->db->escape($keyforselect).
"' AND type <> 'separate' AND entity IN (0, ".((int)
$conf->entity).
') ORDER BY pos ASC';
42$resql = $this->db->query($sql);
44 while ($obj = $this->db->fetch_object($resql)) {
45 $fieldname = $keyforaliasextra.
'.'.$obj->name;
46 $fieldlabel = ucfirst($obj->label);
48 $typefield = preg_replace(
'/\(.*$/',
'', $obj->type);
54 $typeFilter =
"Numeric";
62 $typeFilter =
"Boolean";
67 $tmpparam = jsonOrUnserialize($obj->param);
68 if ($tmpparam[
'options'] && is_array($tmpparam[
'options'])) {
69 $typeFilter =
"Select:".$obj->param;
75 $tmpparam = jsonOrUnserialize($obj->param);
76 if (is_array($tmpparam) && array_key_exists(
'options', $tmpparam) && $tmpparam[
'options'] && is_array($tmpparam[
'options'])) {
77 $tmpkeys = array_keys($tmpparam[
'options']);
78 $tmp = (
string) array_shift($tmpkeys);
80 if (preg_match(
'/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) {
81 $typeFilter =
"List:".$tmp;
85 if ($obj->type !=
'separate') {
87 if (empty($obj->fieldcomputed)) {
88 $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ?
'*' :
'');
89 $this->import_TypeFields_array[$r][$fieldname] = $typeFilter;
90 $this->import_entities_array[$r][$fieldname] = $keyforelement;
93 $this->import_fields_array[$r][$fieldname] = $fieldlabel.($obj->fieldrequired ?
'*' :
'');
94 $this->import_TypeFields_array[$r][$fieldname] = $typeFilter.
'Compute';
95 $this->import_entities_array[$r][$fieldname] = $keyforelement;
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.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php