944 if (empty($elementtype)) {
948 if ($elementtype ==
'thirdparty') {
949 $elementtype =
'societe';
951 if ($elementtype ==
'contact') {
952 $elementtype =
'socpeople';
954 if ($elementtype ==
'order_supplier') {
955 $elementtype =
'commande_fournisseur';
961 $array_name_label = array();
964 $sql =
"SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help,";
965 $sql .=
" css, cssview, csslist";
966 $sql .=
" FROM ".$this->db->prefix().
"extrafields";
968 if ($elementtype && $elementtype !=
'all') {
969 $sql .=
" WHERE elementtype = '".$this->db->escape($elementtype).
"'";
971 if ($attrname && $elementtype && $elementtype !=
'all') {
972 $sql .=
" AND name = '".$this->db->escape($attrname).
"'";
974 $sql .=
" ORDER BY pos";
976 $resql = $this->db->query($sql);
979 if ($this->db->num_rows($resql)) {
980 while ($tab = $this->db->fetch_object($resql)) {
981 if ($tab->entity != 0 && $tab->entity != $conf->entity) {
983 if ($tab->fieldrequired && is_null($tab->fielddefault)) {
984 $this->attributes[$tab->elementtype][
'mandatoryfieldsofotherentities'][$tab->name] = $tab->type;
990 if ($tab->type !=
'separate') {
991 $array_name_label[$tab->name] = $tab->label;
995 $this->attributes[$tab->elementtype][
'type'][$tab->name] = $tab->type;
996 $this->attributes[$tab->elementtype][
'label'][$tab->name] = $tab->label;
997 $this->attributes[$tab->elementtype][
'size'][$tab->name] = $tab->size;
998 $this->attributes[$tab->elementtype][
'elementtype'][$tab->name] = $tab->elementtype;
999 $this->attributes[$tab->elementtype][
'default'][$tab->name] = $tab->fielddefault;
1000 $this->attributes[$tab->elementtype][
'computed'][$tab->name] = $tab->fieldcomputed;
1001 $this->attributes[$tab->elementtype][
'unique'][$tab->name] = $tab->fieldunique;
1002 $this->attributes[$tab->elementtype][
'required'][$tab->name] = $tab->fieldrequired;
1003 $this->attributes[$tab->elementtype][
'param'][$tab->name] = ($tab->param ?
jsonOrUnserialize($tab->param) :
'');
1004 $this->attributes[$tab->elementtype][
'pos'][$tab->name] = $tab->pos;
1005 $this->attributes[$tab->elementtype][
'alwayseditable'][$tab->name] = $tab->alwayseditable;
1006 $this->attributes[$tab->elementtype][
'perms'][$tab->name] = ((is_null($tab->perms) || strlen($tab->perms) == 0) ? 1 : $tab->perms);
1007 $this->attributes[$tab->elementtype][
'langfile'][$tab->name] = $tab->langs;
1008 $this->attributes[$tab->elementtype][
'list'][$tab->name] = $tab->list;
1009 $this->attributes[$tab->elementtype][
'printable'][$tab->name] = $tab->printable;
1010 $this->attributes[$tab->elementtype][
'totalizable'][$tab->name] = ($tab->totalizable ? 1 : 0);
1011 $this->attributes[$tab->elementtype][
'entityid'][$tab->name] = $tab->entity;
1012 $this->attributes[$tab->elementtype][
'enabled'][$tab->name] = $tab->enabled;
1013 $this->attributes[$tab->elementtype][
'help'][$tab->name] = $tab->help;
1014 $this->attributes[$tab->elementtype][
'css'][$tab->name] = $tab->css;
1015 $this->attributes[$tab->elementtype][
'cssview'][$tab->name] = $tab->cssview;
1016 $this->attributes[$tab->elementtype][
'csslist'][$tab->name] = $tab->csslist;
1018 $this->attributes[$tab->elementtype][
'loaded'] = 1;
1023 $this->attributes[$elementtype][
'loaded'] = 1;
1024 $this->attributes[$elementtype][
'count'] = $count;
1027 $this->error = $this->db->lasterror();
1028 dol_syslog(get_class($this).
"::fetch_name_optionals_label ".$this->error, LOG_ERR);
1031 return $array_name_label;
1050 public function showInputField($key, $value, $moreparam =
'', $keysuffix =
'', $keyprefix =
'', $morecss =
'', $objectid = 0, $extrafieldsobjectkey =
'', $mode = 0)
1052 global $conf, $langs, $form;
1054 if (!is_object($form)) {
1055 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
1056 $form =
new Form($this->db);
1061 if (!preg_match(
'/options_$/', $keyprefix)) {
1062 $keyprefix = $keyprefix.
'options_';
1065 if (empty($extrafieldsobjectkey)) {
1066 dol_syslog(get_class($this).
'::showInputField extrafieldsobjectkey required', LOG_ERR);
1067 return 'BadValueForParamExtraFieldsObjectKey';
1070 $label = $this->attributes[$extrafieldsobjectkey][
'label'][$key];
1071 $type = $this->attributes[$extrafieldsobjectkey][
'type'][$key];
1072 $size = $this->attributes[$extrafieldsobjectkey][
'size'][$key];
1073 $default = $this->attributes[$extrafieldsobjectkey][
'default'][$key];
1074 $computed = $this->attributes[$extrafieldsobjectkey][
'computed'][$key];
1075 $unique = $this->attributes[$extrafieldsobjectkey][
'unique'][$key];
1076 $required = $this->attributes[$extrafieldsobjectkey][
'required'][$key];
1077 $param = $this->attributes[$extrafieldsobjectkey][
'param'][$key];
1078 $perms = (int)
dol_eval($this->attributes[$extrafieldsobjectkey][
'perms'][$key], 1, 1,
'2');
1079 $langfile = $this->attributes[$extrafieldsobjectkey][
'langfile'][$key];
1080 $list = (string)
dol_eval($this->attributes[$extrafieldsobjectkey][
'list'][$key], 1, 1,
'2');
1081 $totalizable = $this->attributes[$extrafieldsobjectkey][
'totalizable'][$key];
1082 $help = $this->attributes[$extrafieldsobjectkey][
'help'][$key];
1083 $hidden = (empty($list) ? 1 : 0);
1089 if (!preg_match(
'/^search_/', $keyprefix)) {
1090 return '<span class="opacitymedium">'.$langs->trans(
"AutomaticallyCalculated").
'</span>';
1098 if (empty($morecss)) {
1100 if ($type ==
'date') {
1101 $morecss =
'minwidth100imp';
1102 } elseif ($type ==
'datetime' || $type ==
'datetimegmt' || $type ==
'link') {
1103 $morecss =
'minwidth200imp';
1104 } elseif (in_array($type, array(
'int',
'integer',
'double',
'price'))) {
1105 $morecss =
'maxwidth75';
1106 } elseif ($type ==
'password') {
1107 $morecss =
'maxwidth100';
1108 } elseif ($type ==
'url') {
1109 $morecss =
'minwidth400';
1110 } elseif ($type ==
'boolean') {
1112 } elseif ($type ==
'radio') {
1113 $morecss =
'width25';
1115 if (empty($size) || round((
float) $size) < 12) {
1116 $morecss =
'minwidth100';
1117 } elseif (round((
float) $size) <= 48) {
1118 $morecss =
'minwidth200';
1120 $morecss =
'minwidth400';
1124 if (!empty($this->attributes[$extrafieldsobjectkey][
'css'][$key])) {
1125 $morecss = $this->attributes[$extrafieldsobjectkey][
'css'][$key];
1129 if (in_array($type, array(
'date'))) {
1130 $tmp = explode(
',', $size);
1135 if (!$required && $value ==
'') {
1142 'start' => isset($value[
'start']) ? $value[
'start'] :
'',
1143 'end' => isset($value[
'end']) ? $value[
'end'] :
''
1145 $out =
'<div ' . ($moreparam ? $moreparam :
'') .
'><div class="nowrap">';
1146 $out .= $form->selectDate($prefill[
'start'], $keyprefix.$key.$keysuffix.
'_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1147 $out .=
'</div><div class="nowrap">';
1148 $out .= $form->selectDate($prefill[
'end'], $keyprefix.$key.$keysuffix.
'_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1149 $out .=
'</div></div>';
1152 $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required,
'', 1, (($keyprefix !=
'search_' && $keyprefix !=
'search_options_') ? 1 : 0), 0, 1);
1154 } elseif (in_array($type, array(
'datetime',
'datetimegmt'))) {
1155 $tmp = explode(
',', $size);
1160 if (!$required && $value ==
'') {
1167 'start' => isset($value[
'start']) ? $value[
'start'] :
'',
1168 'end' => isset($value[
'end']) ? $value[
'end'] :
''
1170 $out =
'<div ' . ($moreparam ? $moreparam :
'') .
'><div class="nowrap">';
1171 $out .= $form->selectDate($prefill[
'start'], $keyprefix.$key.$keysuffix.
'_start', 1, 1, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"),
'tzuserrel');
1172 $out .=
'</div><div class="nowrap">';
1173 $out .= $form->selectDate($prefill[
'end'], $keyprefix.$key.$keysuffix.
'_end', 1, 1, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"),
'tzuserrel');
1174 $out .=
'</div></div>';
1177 $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required,
'', 1, (($keyprefix !=
'search_' && $keyprefix !=
'search_options_') ? 1 : 0), 0, 1,
'',
'',
'', 1,
'',
'',
'tzuserrel');
1179 } elseif (in_array($type, array(
'int',
'integer'))) {
1180 $tmp = explode(
',', $size);
1182 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" maxlength="'.$newsize.
'" value="'.
dol_escape_htmltag($value).
'"'.($moreparam ? $moreparam :
'').
'>';
1183 } elseif (preg_match(
'/varchar/', $type)) {
1184 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" maxlength="'.$size.
'" value="'.
dol_escape_htmltag($value).
'"'.($moreparam ? $moreparam :
'').
'>';
1185 } elseif (in_array($type, array(
'mail',
'ip',
'phone',
'url'))) {
1186 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1187 } elseif ($type ==
'icon') {
1193 $out .=
'<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.
' maxwidthonsmartphone"';
1194 $out .=
' name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1197 $options =
"{ title: '<b>".$langs->trans(
"IconFieldSelector").
"</b>', placement: 'right', showFooter: false, templates: {";
1198 $options .=
"iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',";
1199 $options .=
"iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',";
1202 $options .=
"footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',";
1203 $options .=
"search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans(
"TypeToFilter").
"\" />',";
1204 $options .=
"popover: '<div class=\"iconpicker-popover popover\">";
1205 $options .=
" <div class=\"arrow\" ></div>";
1206 $options .=
" <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>";
1207 $options .=
" <div class=\"popover-content \" ></div>";
1208 $options .=
"</div>'}}";
1209 $out .=
"$('#".$keyprefix.$key.$keysuffix.
"').iconpicker(".$options.
");";
1210 $out .=
'</script>';
1212 } elseif ($type ==
'text') {
1213 if (!preg_match(
'/search_/', $keyprefix)) {
1214 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1215 $doleditor =
new DolEditor($keyprefix.$key.$keysuffix, $value,
'', 200,
'dolibarr_notes',
'In',
false,
false,
false, ROWS_5,
'90%');
1216 $out = (string) $doleditor->Create(1);
1218 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1220 } elseif ($type ==
'html') {
1221 if (!preg_match(
'/search_/', $keyprefix)) {
1222 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1223 $doleditor =
new DolEditor($keyprefix.$key.$keysuffix, $value,
'', 200,
'dolibarr_notes',
'In',
false,
false, isModEnabled(
'fckeditor') &&
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_5,
'90%');
1224 $out = (string) $doleditor->Create(1);
1226 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1228 } elseif ($type ==
'boolean') {
1231 if (!empty($value)) {
1232 $checked =
' checked value="1" ';
1234 $checked =
' value="1" ';
1236 $out =
'<input type="checkbox" class="flat valignmiddle'.($morecss ?
' '.$morecss :
'').
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.$checked.
' '.($moreparam ? $moreparam :
'').
'>';
1238 $out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1,
false, 1);
1240 $out .=
'<input type="hidden" name="'.$keyprefix.$key.$keysuffix.
'_boolean" value="1">';
1241 } elseif ($type ==
'price') {
1242 if (!empty($value)) {
1243 $value =
price($value);
1245 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone right" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.$value.
'" '.($moreparam ? $moreparam :
'').
' placeholder="'.$langs->getCurrencySymbol($conf->currency).
'">';
1246 } elseif ($type ==
'pricecy') {
1247 $currency = $conf->currency;
1248 if (!empty($value)) {
1250 $pricetmp = explode(
':', $value);
1251 $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency;
1252 $value =
price($pricetmp[0]);
1254 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.$value.
'" '.($moreparam ? $moreparam :
'').
'> ';
1255 $out .= $form->selectCurrency($currency, $keyprefix.$key.$keysuffix.
'currency_id');
1256 } elseif ($type ==
'double') {
1257 if (!empty($value)) {
1258 $value =
price($value);
1260 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.$value.
'" '.($moreparam ? $moreparam :
'').
'> ';
1261 } elseif ($type ==
'select') {
1265 foreach ($param[
'options'] as $okey => $val) {
1266 if ((
string) $okey ==
'') {
1270 $valarray = explode(
'|', $val);
1271 $val = $valarray[0];
1273 if ($langfile && $val) {
1274 $options[$okey] = $langs->trans($val);
1276 $options[$okey] = $val;
1279 $selected = array();
1280 if (!is_array($value)) {
1281 $selected = explode(
',', $value);
1284 $out .= $form->multiselectarray($keyprefix.$key.$keysuffix, $options, $selected, 0, 0, $morecss, 0, 0,
'',
'',
'', !empty($conf->use_javascript_ajax) && !
getDolGlobalString(
'MAIN_EXTRAFIELDS_DISABLE_SELECT2'));
1286 if (!empty($conf->use_javascript_ajax) && !
getDolGlobalString(
'MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
1287 include_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
1288 $out .=
ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
1291 $out .=
'<select class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.($moreparam ? $moreparam :
'').
'>';
1292 $out .=
'<option value="0"> </option>';
1293 foreach ($param[
'options'] as $key2 => $val2) {
1294 if ((
string) $key2 ==
'') {
1297 $valarray = explode(
'|', $val2);
1298 $val2 = $valarray[0];
1300 if (!empty($valarray[1])) {
1301 $parent = $valarray[1];
1303 $out .=
'<option value="'.$key2.
'"';
1304 $out .= (((string) $value == (
string) $key2) ?
' selected' :
'');
1305 $out .= (!empty($parent) ?
' parent="'.$parent.
'"' :
'');
1307 if ($langfile && $val2) {
1308 $out .= $langs->trans($val2);
1312 $out .=
'</option>';
1314 $out .=
'</select>';
1316 } elseif ($type ==
'sellist') {
1318 if (!empty($conf->use_javascript_ajax) && !
getDolGlobalString(
'MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
1319 include_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
1320 $out .=
ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
1323 $out .=
'<select class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.($moreparam ? $moreparam :
'').
'>';
1324 if (is_array($param[
'options'])) {
1325 $param_list = array_keys($param[
'options']);
1326 $InfoFieldList = explode(
":", $param_list[0]);
1337 $keyList = (empty($InfoFieldList[2]) ?
'rowid' : $InfoFieldList[2].
' as rowid');
1340 if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
1341 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1342 $keyList =
'main.'.$InfoFieldList[2].
' as rowid';
1344 $keyList = $InfoFieldList[2].
' as rowid';
1347 if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
1348 list($parentName, $parentField) = explode(
'|', $InfoFieldList[3]);
1349 $keyList .=
', '.$parentField;
1352 $filter_categorie =
false;
1353 if (count($InfoFieldList) > 5) {
1354 if ($InfoFieldList[0] ==
'categorie') {
1355 $filter_categorie =
true;
1359 if ($filter_categorie ===
false) {
1360 $fields_label = explode(
'|', $InfoFieldList[1]);
1361 if (is_array($fields_label)) {
1363 $keyList .= implode(
', ', $fields_label);
1367 $sql =
"SELECT ".$keyList;
1368 $sql .=
' FROM '.$this->db->prefix().$InfoFieldList[0];
1369 if (!empty($InfoFieldList[4])) {
1371 if (strpos($InfoFieldList[4],
'$ENTITY$') !==
false) {
1372 $InfoFieldList[4] = str_replace(
'$ENTITY$', (
string) $conf->entity, $InfoFieldList[4]);
1375 if (strpos($InfoFieldList[4],
'$SEL$') !==
false) {
1376 $InfoFieldList[4] = str_replace(
'$SEL$',
'SELECT', $InfoFieldList[4]);
1380 if (strpos($InfoFieldList[4],
'$ID$') !==
false && !empty($objectid)) {
1381 $InfoFieldList[4] = str_replace(
'$ID$', (
string) $objectid, $InfoFieldList[4]);
1383 $InfoFieldList[4] = str_replace(
'$ID$',
'0', $InfoFieldList[4]);
1386 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1387 $sql .=
' as main, '.$this->db->prefix().$InfoFieldList[0].
'_extrafields as extra';
1388 $sqlwhere .=
" WHERE extra.fk_object=main.".$InfoFieldList[2].
" AND ".$InfoFieldList[4];
1390 $sqlwhere .=
" WHERE ".$InfoFieldList[4];
1393 $sqlwhere .=
' WHERE 1=1';
1396 if (in_array($InfoFieldList[0], array(
'tablewithentity'))) {
1397 $sqlwhere .=
' AND entity = '.((int) $conf->entity);
1402 $sql .=
' ORDER BY '.implode(
', ', $fields_label);
1404 dol_syslog(get_class($this).
'::showInputField type=sellist', LOG_DEBUG);
1405 $resql = $this->db->query($sql);
1407 $out .=
'<option value="0"> </option>';
1408 $num = $this->db->num_rows($resql);
1412 $obj = $this->db->fetch_object($resql);
1416 $fields_label = explode(
'|', $InfoFieldList[1]);
1417 if (is_array($fields_label) && count($fields_label) > 1) {
1419 foreach ($fields_label as $field_toshow) {
1420 $labeltoshow .= $obj->$field_toshow.
' ';
1423 $labeltoshow = $obj->{$InfoFieldList[1]};
1426 if ($value == $obj->rowid) {
1428 foreach ($fields_label as $field_toshow) {
1429 $translabel = $langs->trans($obj->$field_toshow);
1430 $labeltoshow = $translabel.
' ';
1433 $out .=
'<option value="'.$obj->rowid.
'" selected>'.$labeltoshow.
'</option>';
1436 $translabel = $langs->trans($obj->{$InfoFieldList[1]});
1437 $labeltoshow = $translabel;
1439 if (empty($labeltoshow)) {
1440 $labeltoshow =
'(not defined)';
1443 if (!empty($InfoFieldList[3]) && $parentField) {
1444 $parent = $parentName.
':'.$obj->{$parentField};
1447 $out .=
'<option value="'.$obj->rowid.
'"';
1448 $out .= ($value == $obj->rowid ?
' selected' :
'');
1449 $out .= (!empty($parent) ?
' parent="'.$parent.
'"' :
'');
1450 $out .=
'>'.$labeltoshow.
'</option>';
1455 $this->db->free($resql);
1457 print
'Error in request '.$sql.
' '.$this->db->lasterror().
'. Check setup of extra parameters.<br>';
1460 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1461 $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]],
'',
'parent', 64, $InfoFieldList[6], 1, 1);
1462 $out .=
'<option value="0"> </option>';
1463 if (is_array($data)) {
1464 foreach ($data as $data_key => $data_value) {
1465 $out .=
'<option value="'.$data_key.
'"';
1466 $out .= ($value == $data_key ?
' selected' :
'');
1467 $out .=
'>'.$data_value.
'</option>';
1472 $out .=
'</select>';
1473 } elseif ($type ==
'checkbox') {
1474 $value_arr = $value;
1475 if (!is_array($value)) {
1476 $value_arr = explode(
',', $value);
1478 $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param[
'options']) ?
null : $param[
'options']), $value_arr,
'', 0,
'', 0,
'100%');
1479 } elseif ($type ==
'radio') {
1481 foreach ($param[
'options'] as $keyopt => $val) {
1482 $out .=
'<input class="flat '.$morecss.
'" type="radio" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.($moreparam ? $moreparam :
'');
1483 $out .=
' value="'.$keyopt.
'"';
1484 $out .=
' id="'.$keyprefix.$key.$keysuffix.
'_'.$keyopt.
'"';
1485 $out .= ($value == $keyopt ?
'checked' :
'');
1486 $out .=
'/><label for="'.$keyprefix.$key.$keysuffix.
'_'.$keyopt.
'">'.$langs->trans($val).
'</label><br>';
1488 } elseif ($type ==
'chkbxlst') {
1489 if (is_array($value)) {
1490 $value_arr = $value;
1492 $value_arr = explode(
',', $value);
1495 if (is_array($param[
'options'])) {
1496 $param_list = array_keys($param[
'options']);
1497 $InfoFieldList = explode(
":", $param_list[0]);
1508 $keyList = (empty($InfoFieldList[2]) ?
'rowid' : $InfoFieldList[2].
' as rowid');
1510 if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
1511 list($parentName, $parentField) = explode(
'|', $InfoFieldList[3]);
1512 $keyList .=
', '.$parentField;
1514 if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
1515 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1516 $keyList =
'main.'.$InfoFieldList[2].
' as rowid';
1518 $keyList = $InfoFieldList[2].
' as rowid';
1522 $filter_categorie =
false;
1523 if (count($InfoFieldList) > 5) {
1524 if ($InfoFieldList[0] ==
'categorie') {
1525 $filter_categorie =
true;
1529 if ($filter_categorie ===
false) {
1530 $fields_label = explode(
'|', $InfoFieldList[1]);
1531 if (is_array($fields_label)) {
1533 $keyList .= implode(
', ', $fields_label);
1537 $sql =
"SELECT ".$keyList;
1538 $sql .=
' FROM '.$this->db->prefix().$InfoFieldList[0];
1539 if (!empty($InfoFieldList[4])) {
1541 if (strpos($InfoFieldList[4],
'$ENTITY$') !==
false) {
1542 $InfoFieldList[4] = str_replace(
'$ENTITY$', (
string) $conf->entity, $InfoFieldList[4]);
1545 if (strpos($InfoFieldList[4],
'$SEL$') !==
false) {
1546 $InfoFieldList[4] = str_replace(
'$SEL$',
'SELECT', $InfoFieldList[4]);
1550 if (strpos($InfoFieldList[4],
'$ID$') !==
false && !empty($objectid)) {
1551 $InfoFieldList[4] = str_replace(
'$ID$', (
string) $objectid, $InfoFieldList[4]);
1552 } elseif (preg_match(
"#^.*list.php$#", $_SERVER[
"PHP_SELF"])) {
1554 $word =
'\b[a-zA-Z0-9-\.-_]+\b=\$ID\$';
1557 $InfoFieldList[4] = preg_replace(
'# *(=|\(|\)) *#',
'$1', $InfoFieldList[4]);
1561 while ($nbPreg != 0) {
1563 $nbPregRepl = $nbPregSel = 0;
1565 $InfoFieldList[4] = preg_replace(
'#([^=])(\([^)^(]*('.$word.
')[^)^(]*\))#',
'$1 $3 ', $InfoFieldList[4], -1, $nbPregRepl);
1567 $InfoFieldList[4] = preg_replace(
'# *(=|\(|\)) *#',
'$1', $InfoFieldList[4]);
1569 $InfoFieldList[4] = preg_replace(
'#\b[a-zA-Z0-9-\.-_]+\b=\([^)^(]*('.$word.
')[^)^(]*\)#',
'$1 ', $InfoFieldList[4], -1, $nbPregSel);
1571 $InfoFieldList[4] = preg_replace(
'# *(=|\(|\)) *#',
'$1', $InfoFieldList[4]);
1574 $nbPreg = $nbPregRepl + $nbPregSel;
1578 $matchCondition = array();
1579 preg_match(
'#(AND|OR|) *('.$word.
') *(AND|OR|)#', $InfoFieldList[4], $matchCondition);
1580 while (!empty($matchCondition[0])) {
1582 if (!empty($matchCondition[1]) && !empty($matchCondition[3]) && $matchCondition[1] != $matchCondition[3]) {
1584 $InfoFieldList[4] = str_replace(
'$ID$',
'0', $InfoFieldList[4]);
1586 if (!empty($matchCondition[1])) {
1587 $boolCond = (($matchCondition[1] ==
"AND") ?
' AND TRUE ' :
' OR FALSE ');
1588 $InfoFieldList[4] = str_replace($matchCondition[0], $boolCond.$matchCondition[3], $InfoFieldList[4]);
1589 } elseif (!empty($matchCondition[3])) {
1590 $boolCond = (($matchCondition[3] ==
"AND") ?
' TRUE AND ' :
' FALSE OR');
1591 $InfoFieldList[4] = str_replace($matchCondition[0], $boolCond, $InfoFieldList[4]);
1593 $InfoFieldList[4] =
" TRUE ";
1598 preg_match(
'#(AND|OR|) *('.$word.
') *(AND|OR|)#', $InfoFieldList[4], $matchCondition);
1601 $InfoFieldList[4] = str_replace(
'$ID$',
'0', $InfoFieldList[4]);
1605 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1606 $sql .=
' as main, '.$this->db->prefix().$InfoFieldList[0].
'_extrafields as extra';
1607 $sqlwhere .=
" WHERE extra.fk_object=main.".$InfoFieldList[2].
" AND ".$InfoFieldList[4];
1609 $sqlwhere .=
" WHERE ".$InfoFieldList[4];
1612 $sqlwhere .=
' WHERE 1=1';
1615 if (in_array($InfoFieldList[0], array(
'tablewithentity'))) {
1616 $sqlwhere .=
" AND entity = ".((int) $conf->entity);
1622 $sql .=
' ORDER BY '.implode(
', ', $fields_label);
1624 dol_syslog(get_class($this).
'::showInputField type=chkbxlst', LOG_DEBUG);
1625 $resql = $this->db->query($sql);
1627 $num = $this->db->num_rows($resql);
1634 $obj = $this->db->fetch_object($resql);
1638 $fields_label = explode(
'|', $InfoFieldList[1]);
1639 if (is_array($fields_label)) {
1641 foreach ($fields_label as $field_toshow) {
1642 $labeltoshow .= $obj->$field_toshow.
' ';
1645 $labeltoshow = $obj->{$InfoFieldList[1]};
1647 $labeltoshow =
dol_trunc($labeltoshow, 45);
1649 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
1651 foreach ($fields_label as $field_toshow) {
1652 $translabel = $langs->trans($obj->$field_toshow);
1653 if ($translabel != $obj->$field_toshow) {
1654 $labeltoshow .=
' '.dol_trunc($translabel, 18).
' ';
1656 $labeltoshow .=
' '.dol_trunc($obj->$field_toshow, 18).
' ';
1659 $data[$obj->rowid] = $labeltoshow;
1662 $translabel = $langs->trans($obj->{$InfoFieldList[1]});
1663 if ($translabel != $obj->{$InfoFieldList[1]}) {
1664 $labeltoshow =
dol_trunc($translabel, 18);
1666 $labeltoshow =
dol_trunc($obj->{$InfoFieldList[1]}, 18);
1669 if (empty($labeltoshow)) {
1670 $labeltoshow =
'(not defined)';
1673 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
1674 $data[$obj->rowid] = $labeltoshow;
1677 if (!empty($InfoFieldList[3]) && $parentField) {
1678 $parent = $parentName.
':'.$obj->{$parentField};
1681 $data[$obj->rowid] = $labeltoshow;
1686 $this->db->free($resql);
1688 $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr,
'', 0,
'', 0,
'100%');
1690 print
'Error in request '.$sql.
' '.$this->db->lasterror().
'. Check setup of extra parameters.<br>';
1693 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1694 $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]],
'',
'parent', 64, $InfoFieldList[6], 1, 1);
1695 $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr,
'', 0,
'', 0,
'100%');
1698 } elseif ($type ==
'link') {
1699 $param_list = array_keys($param[
'options']);
1706 $showempty = (($required && $default !=
'') ? 0 : 1);
1708 $tmparray = explode(
':', $param_list[0]);
1710 $element = $extrafieldsobjectkey;
1711 if ($element ==
'socpeople') {
1712 $element =
'contact';
1713 } elseif ($element ==
'projet') {
1714 $element =
'project';
1718 $objectdesc = $tmparray[0];
1719 $objectfield = $element.
':options_'.$key;
1721 $out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty,
'',
'', $morecss,
'', 0, 0,
'', $objectfield);
1722 } elseif (in_array($type, [
'point',
'multipts',
'linestrg',
'polygon'])) {
1723 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgeophp.class.php';
1727 if (!empty($value)) {
1728 $tmparray = $dolgeophp->parseGeoString($value);
1729 $geojson = $tmparray[
'geojson'];
1730 $centroidjson = $tmparray[
'centroidjson'];
1732 if (!preg_match(
'/search_/', $keyprefix)) {
1733 require_once DOL_DOCUMENT_ROOT.
'/core/class/geomapeditor.class.php';
1735 $out .= $geomapeditor->getHtml($keyprefix.$key.$keysuffix, $geojson, $centroidjson, $type);
1740 } elseif ($type ==
'password') {
1742 $out =
'<input style="display:none" type="text" name="fakeusernameremembered">';
1743 $out .=
'<input autocomplete="new-password" type="'.($keyprefix ==
'search_' ?
'text' :
'password').
'" class="flat '.$morecss.
'" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.$value.
'" '.($moreparam ? $moreparam :
'').
'>';
1745 if (!empty($hidden)) {
1746 $out =
'<input type="hidden" value="'.$value.
'" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'"/>';
1769 public function showOutputField($key, $value, $moreparam =
'', $extrafieldsobjectkey =
'', $outputlangs =
null)
1771 global $conf, $langs;
1773 if (is_null($outputlangs) || !is_object($outputlangs)) {
1774 $outputlangs = $langs;
1777 if (empty($extrafieldsobjectkey)) {
1778 dol_syslog(get_class($this).
'::showOutputField extrafieldsobjectkey required', LOG_ERR);
1779 return 'BadValueForParamExtraFieldsObjectKey';
1782 $label = $this->attributes[$extrafieldsobjectkey][
'label'][$key];
1783 $type = $this->attributes[$extrafieldsobjectkey][
'type'][$key];
1784 $size = $this->attributes[$extrafieldsobjectkey][
'size'][$key];
1785 $default = $this->attributes[$extrafieldsobjectkey][
'default'][$key];
1786 $computed = $this->attributes[$extrafieldsobjectkey][
'computed'][$key];
1787 $unique = $this->attributes[$extrafieldsobjectkey][
'unique'][$key];
1788 $required = $this->attributes[$extrafieldsobjectkey][
'required'][$key];
1789 $param = $this->attributes[$extrafieldsobjectkey][
'param'][$key];
1790 $perms = (int)
dol_eval($this->attributes[$extrafieldsobjectkey][
'perms'][$key], 1, 1,
'2');
1791 $langfile = $this->attributes[$extrafieldsobjectkey][
'langfile'][$key];
1792 $list = (string)
dol_eval($this->attributes[$extrafieldsobjectkey][
'list'][$key], 1, 1,
'2');
1793 $help = $this->attributes[$extrafieldsobjectkey][
'help'][$key];
1794 $cssview = $this->attributes[$extrafieldsobjectkey][
'cssview'][$key];
1796 $hidden = (empty($list) ? 1 : 0);
1805 if ($type ==
'date') {
1807 if ($value !==
'') {
1810 } elseif ($type ==
'datetime') {
1812 if ($value !==
'') {
1815 } elseif ($type ==
'datetimegmt') {
1817 if ($value !==
'') {
1820 } elseif ($type ==
'int') {
1822 } elseif ($type ==
'double') {
1823 if (!empty($value)) {
1825 $sizeparts = explode(
",", $size);
1826 $number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0;
1827 $value =
price($value, 0, $outputlangs, 0, 0, $number_decimals,
'');
1829 } elseif ($type ==
'boolean') {
1831 if (!empty($value)) {
1832 $checked =
' checked ';
1835 $value =
'<input type="checkbox" '.$checked.
' '.($moreparam ? $moreparam :
'').
' readonly disabled>';
1837 $value =
yn($value ? 1 : 0);
1839 } elseif ($type ==
'mail') {
1841 } elseif ($type ==
'ip') {
1843 } elseif ($type ==
'icon') {
1844 $value =
'<span class="'.$value.
'"></span>';
1845 } elseif ($type ==
'url') {
1847 } elseif ($type ==
'phone') {
1849 } elseif ($type ==
'price') {
1851 if ($value || $value ==
'0') {
1852 $value =
price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).
' '.$outputlangs->getCurrencySymbol($conf->currency);
1854 } elseif ($type ==
'pricecy') {
1855 $currency = $conf->currency;
1856 if (!empty($value)) {
1858 $pricetmp = explode(
':', $value);
1859 $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency;
1860 $value = $pricetmp[0];
1862 if ($value || $value ==
'0') {
1863 $value =
price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1, $currency);
1865 } elseif ($type ==
'select') {
1866 $valstr = (!empty($param[
'options'][$value]) ? $param[
'options'][$value] :
'');
1867 if (($pos = strpos($valstr,
"|")) !==
false) {
1868 $valstr = substr($valstr, 0, $pos);
1870 if ($langfile && $valstr) {
1871 $value = $outputlangs->trans($valstr);
1875 } elseif ($type ==
'sellist') {
1876 $param_list = array_keys($param[
'options']);
1877 $InfoFieldList = explode(
":", $param_list[0]);
1879 $selectkey =
"rowid";
1882 if (count($InfoFieldList) >= 3) {
1883 $selectkey = $InfoFieldList[2];
1884 $keyList = $InfoFieldList[2].
' as rowid';
1887 $fields_label = explode(
'|', $InfoFieldList[1]);
1888 if (is_array($fields_label)) {
1890 $keyList .= implode(
', ', $fields_label);
1893 $filter_categorie =
false;
1894 if (count($InfoFieldList) > 5) {
1895 if ($InfoFieldList[0] ==
'categorie') {
1896 $filter_categorie =
true;
1900 $sql =
"SELECT ".$keyList;
1901 $sql .=
' FROM '.$this->db->prefix().$InfoFieldList[0];
1902 if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4],
'extra.') !==
false) {
1905 if ($selectkey ==
'rowid' && empty($value)) {
1906 $sql .=
" WHERE ".$selectkey.
" = 0";
1907 } elseif ($selectkey ==
'rowid') {
1908 $sql .=
" WHERE ".$selectkey.
" = ".((int) $value);
1910 $sql .=
" WHERE ".$selectkey.
" = '".$this->db->escape($value).
"'";
1915 dol_syslog(get_class($this).
':showOutputField:$type=sellist', LOG_DEBUG);
1916 $resql = $this->db->query($sql);
1918 if ($filter_categorie ===
false) {
1921 $obj = $this->db->fetch_object($resql);
1924 $fields_label = explode(
'|', $InfoFieldList[1]);
1926 if (is_array($fields_label) && count($fields_label) > 1) {
1927 foreach ($fields_label as $field_toshow) {
1929 if (!empty($obj->$field_toshow)) {
1930 $translabel = $outputlangs->trans($obj->$field_toshow);
1932 if ($translabel != $obj->$field_toshow) {
1933 $value .=
dol_trunc($translabel, 24) .
' ';
1935 $value .= $obj->$field_toshow .
' ';
1941 $tmppropname = $InfoFieldList[1];
1943 if (!empty(isset($obj->$tmppropname) ? $obj->$tmppropname :
'')) {
1944 $translabel = $outputlangs->trans($obj->$tmppropname);
1946 if ($translabel != (isset($obj->$tmppropname) ? $obj->$tmppropname :
'')) {
1949 $value = isset($obj->$tmppropname) ? $obj->$tmppropname :
'';
1954 $obj = $this->db->fetch_object($resql);
1956 require_once DOL_DOCUMENT_ROOT .
'/categories/class/categorie.class.php';
1958 $result = $c->fetch($obj->rowid);
1960 $ways = $c->print_all_ways();
1961 foreach ($ways as $way) {
1962 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' .
img_object(
'',
'category') .
' ' . $way .
'</li>';
1966 $value =
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(
' ', $toprint).
'</ul></div>';
1969 dol_syslog(get_class($this).
'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
1971 } elseif ($type ==
'radio') {
1972 if (!isset($param[
'options'][$value])) {
1973 $outputlangs->load(
'errors');
1974 $value = $outputlangs->trans(
'ErrorNoValueForRadioType');
1976 $value = $outputlangs->trans($param[
'options'][$value]);
1978 } elseif ($type ==
'checkbox') {
1979 $value_arr = explode(
',', $value);
1982 if (is_array($value_arr)) {
1983 foreach ($value_arr as $keyval => $valueval) {
1984 if (!empty($valueval)) {
1985 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param[
'options'][$valueval].
'</li>';
1989 $value =
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(
' ', $toprint).
'</ul></div>';
1990 } elseif ($type ==
'chkbxlst') {
1991 $value_arr = explode(
',', $value);
1993 $param_list = array_keys($param[
'options']);
1994 $InfoFieldList = explode(
":", $param_list[0]);
1996 $selectkey =
"rowid";
1999 if (count($InfoFieldList) >= 3) {
2000 $selectkey = $InfoFieldList[2];
2001 $keyList = $InfoFieldList[2].
' as rowid';
2004 $fields_label = explode(
'|', $InfoFieldList[1]);
2005 if (is_array($fields_label)) {
2007 $keyList .= implode(
', ', $fields_label);
2010 $filter_categorie =
false;
2011 if (count($InfoFieldList) > 5) {
2012 if ($InfoFieldList[0] ==
'categorie') {
2013 $filter_categorie =
true;
2017 $sql =
"SELECT ".$keyList;
2018 $sql .=
" FROM ".$this->db->prefix().$InfoFieldList[0];
2019 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
2025 dol_syslog(get_class($this).
':showOutputField:$type=chkbxlst', LOG_DEBUG);
2026 $resql = $this->db->query($sql);
2028 if ($filter_categorie ===
false) {
2031 while ($obj = $this->db->fetch_object($resql)) {
2033 $fields_label = explode(
'|', $InfoFieldList[1]);
2034 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
2035 if (is_array($fields_label) && count($fields_label) > 1) {
2036 $label =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">';
2037 foreach ($fields_label as $field_toshow) {
2039 if (!empty($obj->$field_toshow)) {
2040 $translabel = $outputlangs->trans($obj->$field_toshow);
2042 if ($translabel != $field_toshow) {
2043 $label .=
' '.dol_trunc($translabel, 18);
2045 $label .=
' '.$obj->$field_toshow;
2049 $toprint[] = $label;
2052 if (!empty($obj->{$InfoFieldList[1]})) {
2053 $translabel = $outputlangs->trans($obj->{$InfoFieldList[1]});
2055 if ($translabel != $obj->{$InfoFieldList[1]}) {
2056 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).
'</li>';
2058 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.
'</li>';
2064 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
2067 while ($obj = $this->db->fetch_object($resql)) {
2068 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
2070 $c->fetch($obj->rowid);
2071 $ways = $c->print_all_ways();
2072 foreach ($ways as $way) {
2073 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ?
' style="background: #'.$c->color.
';"' :
' style="background: #bbb"').
'>'.
img_object(
'',
'category').
' '.$way.
'</li>';
2078 if (!empty($toprint)) {
2079 $value =
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(
' ', $toprint).
'</ul></div>';
2082 dol_syslog(get_class($this).
'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
2084 } elseif ($type ==
'link') {
2089 $param_list = array_keys($param[
'options']);
2091 $InfoFieldList = explode(
":", $param_list[0]);
2092 $classname = $InfoFieldList[0];
2093 $classpath = $InfoFieldList[1];
2094 if (!empty($classpath)) {
2096 if ($classname && class_exists($classname)) {
2097 $object =
new $classname($this->db);
2099 $value =
$object->getNomUrl(3);
2102 dol_syslog(
'Error bad setup of extrafield', LOG_WARNING);
2103 return 'Error bad setup of extrafield';
2106 } elseif ($type ==
'point') {
2107 if (!empty($value)) {
2108 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgeophp.class.php';
2110 $value = $dolgeophp->getXYString($value);
2114 } elseif (in_array($type, [
'multipts',
'linestrg',
'polygon'])) {
2115 if (!empty($value)) {
2116 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgeophp.class.php';
2118 $value = $dolgeophp->getPointString($value);
2122 } elseif ($type ==
'text') {
2123 $value =
'<div class="'.($cssview ? $cssview :
'shortmessagecut').
'">'.
dol_htmlentitiesbr($value).
'</div>';
2124 } elseif ($type ==
'html') {
2126 } elseif ($type ==
'password') {
2127 $value =
dol_trunc(preg_replace(
'/./i',
'*', $value), 8,
'right',
'UTF-8', 1);
2129 $showsize = round((
float) $size);
2130 if ($showsize > 48) {