951 if (empty($elementtype)) {
955 if ($elementtype ==
'thirdparty') {
956 $elementtype =
'societe';
958 if ($elementtype ==
'contact') {
959 $elementtype =
'socpeople';
961 if ($elementtype ==
'order_supplier') {
962 $elementtype =
'commande_fournisseur';
968 $array_name_label = array();
971 $sql =
"SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help,";
972 $sql .=
" css, cssview, csslist";
973 $sql .=
" FROM ".$this->db->prefix().
"extrafields";
975 if ($elementtype && $elementtype !=
'all') {
976 $sql .=
" WHERE elementtype = '".$this->db->escape($elementtype).
"'";
978 if ($attrname && $elementtype && $elementtype !=
'all') {
979 $sql .=
" AND name = '".$this->db->escape($attrname).
"'";
981 $sql .=
" ORDER BY pos";
983 $resql = $this->db->query($sql);
986 if ($this->db->num_rows($resql)) {
987 while ($tab = $this->db->fetch_object($resql)) {
988 if ($tab->entity != 0 && $tab->entity != $conf->entity) {
990 if ($tab->fieldrequired && is_null($tab->fielddefault)) {
991 $this->attributes[$tab->elementtype][
'mandatoryfieldsofotherentities'][$tab->name] = $tab->type;
997 if ($tab->type !=
'separate') {
998 $array_name_label[$tab->name] = $tab->label;
1002 $this->attributes[$tab->elementtype][
'type'][$tab->name] = $tab->type;
1003 $this->attributes[$tab->elementtype][
'label'][$tab->name] = $tab->label;
1004 $this->attributes[$tab->elementtype][
'size'][$tab->name] = $tab->size;
1005 $this->attributes[$tab->elementtype][
'elementtype'][$tab->name] = $tab->elementtype;
1006 $this->attributes[$tab->elementtype][
'default'][$tab->name] = $tab->fielddefault;
1007 $this->attributes[$tab->elementtype][
'computed'][$tab->name] = $tab->fieldcomputed;
1008 $this->attributes[$tab->elementtype][
'unique'][$tab->name] = $tab->fieldunique;
1009 $this->attributes[$tab->elementtype][
'required'][$tab->name] = $tab->fieldrequired;
1010 $this->attributes[$tab->elementtype][
'param'][$tab->name] = ($tab->param ?
jsonOrUnserialize($tab->param) :
'');
1011 $this->attributes[$tab->elementtype][
'pos'][$tab->name] = $tab->pos;
1012 $this->attributes[$tab->elementtype][
'alwayseditable'][$tab->name] = $tab->alwayseditable;
1013 $this->attributes[$tab->elementtype][
'perms'][$tab->name] = ((is_null($tab->perms) || strlen($tab->perms) == 0) ? 1 : $tab->perms);
1014 $this->attributes[$tab->elementtype][
'langfile'][$tab->name] = $tab->langs;
1015 $this->attributes[$tab->elementtype][
'list'][$tab->name] = $tab->list;
1016 $this->attributes[$tab->elementtype][
'printable'][$tab->name] = $tab->printable;
1017 $this->attributes[$tab->elementtype][
'totalizable'][$tab->name] = ($tab->totalizable ? 1 : 0);
1018 $this->attributes[$tab->elementtype][
'entityid'][$tab->name] = $tab->entity;
1019 $this->attributes[$tab->elementtype][
'enabled'][$tab->name] = $tab->enabled;
1020 $this->attributes[$tab->elementtype][
'help'][$tab->name] = $tab->help;
1021 $this->attributes[$tab->elementtype][
'css'][$tab->name] = $tab->css;
1022 $this->attributes[$tab->elementtype][
'cssview'][$tab->name] = $tab->cssview;
1023 $this->attributes[$tab->elementtype][
'csslist'][$tab->name] = $tab->csslist;
1025 $this->attributes[$tab->elementtype][
'loaded'] = 1;
1030 $this->attributes[$elementtype][
'loaded'] = 1;
1031 $this->attributes[$elementtype][
'count'] = $count;
1034 $this->error = $this->db->lasterror();
1035 dol_syslog(get_class($this).
"::fetch_name_optionals_label ".$this->error, LOG_ERR);
1038 return $array_name_label;
1057 public function showInputField($key, $value, $moreparam =
'', $keysuffix =
'', $keyprefix =
'', $morecss =
'', $objectid = 0, $extrafieldsobjectkey =
'', $mode = 0)
1059 global $conf, $langs, $form;
1061 if (!is_object($form)) {
1062 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
1063 $form =
new Form($this->db);
1068 if (!preg_match(
'/options_$/', $keyprefix)) {
1069 $keyprefix .=
'options_';
1072 if (empty($extrafieldsobjectkey)) {
1073 dol_syslog(get_class($this).
'::showInputField extrafieldsobjectkey required', LOG_ERR);
1074 return 'BadValueForParamExtraFieldsObjectKey';
1077 $label = $this->attributes[$extrafieldsobjectkey][
'label'][$key];
1078 $type = $this->attributes[$extrafieldsobjectkey][
'type'][$key];
1079 $size = $this->attributes[$extrafieldsobjectkey][
'size'][$key];
1080 $default = $this->attributes[$extrafieldsobjectkey][
'default'][$key];
1081 $computed = $this->attributes[$extrafieldsobjectkey][
'computed'][$key];
1082 $unique = $this->attributes[$extrafieldsobjectkey][
'unique'][$key];
1083 $required = $this->attributes[$extrafieldsobjectkey][
'required'][$key];
1084 $param = $this->attributes[$extrafieldsobjectkey][
'param'][$key];
1085 $perms = (int)
dol_eval($this->attributes[$extrafieldsobjectkey][
'perms'][$key], 1, 1,
'2');
1086 $langfile = $this->attributes[$extrafieldsobjectkey][
'langfile'][$key];
1087 $list = (string)
dol_eval($this->attributes[$extrafieldsobjectkey][
'list'][$key], 1, 1,
'2');
1088 $totalizable = $this->attributes[$extrafieldsobjectkey][
'totalizable'][$key];
1089 $help = $this->attributes[$extrafieldsobjectkey][
'help'][$key];
1090 $hidden = (empty($list) ? 1 : 0);
1096 if (!preg_match(
'/^search_/', $keyprefix)) {
1097 return '<span class="opacitymedium">'.$langs->trans(
"AutomaticallyCalculated").
'</span>';
1105 if (empty($morecss)) {
1107 if ($type ==
'date') {
1108 $morecss =
'minwidth100imp';
1109 } elseif ($type ==
'datetime' || $type ==
'datetimegmt' || $type ==
'link') {
1110 $morecss =
'minwidth200imp';
1111 } elseif (in_array($type, array(
'int',
'integer',
'double',
'price'))) {
1112 $morecss =
'maxwidth75';
1113 } elseif ($type ==
'password') {
1114 $morecss =
'maxwidth100';
1115 } elseif ($type ==
'url') {
1116 $morecss =
'minwidth400';
1117 } elseif ($type ==
'boolean') {
1119 } elseif ($type ==
'radio') {
1120 $morecss =
'width25';
1122 if (empty($size) || round((
float) $size) < 12) {
1123 $morecss =
'minwidth100';
1124 } elseif (round((
float) $size) <= 48) {
1125 $morecss =
'minwidth200';
1127 $morecss =
'minwidth400';
1131 if (!empty($this->attributes[$extrafieldsobjectkey][
'css'][$key])) {
1132 $morecss = $this->attributes[$extrafieldsobjectkey][
'css'][$key];
1136 if (in_array($type, array(
'date'))) {
1137 $tmp = explode(
',', $size);
1142 if (!$required && $value ==
'') {
1149 'start' => isset($value[
'start']) ? $value[
'start'] :
'',
1150 'end' => isset($value[
'end']) ? $value[
'end'] :
''
1152 $out =
'<div ' . ($moreparam ? $moreparam :
'') .
'><div class="nowrap">';
1153 $out .= $form->selectDate($prefill[
'start'], $keyprefix.$key.$keysuffix.
'_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"));
1154 $out .=
'</div><div class="nowrap">';
1155 $out .= $form->selectDate($prefill[
'end'], $keyprefix.$key.$keysuffix.
'_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"));
1156 $out .=
'</div></div>';
1159 $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required,
'', 1, (($keyprefix !=
'search_' && $keyprefix !=
'search_options_') ? 1 : 0), 0, 1);
1161 } elseif (in_array($type, array(
'datetime',
'datetimegmt'))) {
1162 $tmp = explode(
',', $size);
1167 if (!$required && $value ==
'') {
1174 'start' => isset($value[
'start']) ? $value[
'start'] :
'',
1175 'end' => isset($value[
'end']) ? $value[
'end'] :
''
1177 $out =
'<div ' . ($moreparam ? $moreparam :
'') .
'><div class="nowrap">';
1178 $out .= $form->selectDate($prefill[
'start'], $keyprefix.$key.$keysuffix.
'_start', 1, 1, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"From"),
'tzuserrel');
1179 $out .=
'</div><div class="nowrap">';
1180 $out .= $form->selectDate($prefill[
'end'], $keyprefix.$key.$keysuffix.
'_end', 1, 1, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
"to"),
'tzuserrel');
1181 $out .=
'</div></div>';
1184 $out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required,
'', 1, (($keyprefix !=
'search_' && $keyprefix !=
'search_options_') ? 1 : 0), 0, 1,
'',
'',
'', 1,
'',
'',
'tzuserrel');
1186 } elseif (in_array($type, array(
'int',
'integer'))) {
1187 $tmp = explode(
',', $size);
1189 $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 :
'').
'>';
1190 } elseif (preg_match(
'/varchar/', $type)) {
1191 $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 :
'').
'>';
1192 } elseif (in_array($type, array(
'mail',
'ip',
'phone',
'url'))) {
1193 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1194 } elseif ($type ==
'icon') {
1200 $out .=
'<input type="text" class="form-control icp icp-auto iconpicker-element iconpicker-input flat '.$morecss.
' maxwidthonsmartphone"';
1201 $out .=
' name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1204 $options =
"{ title: '<b>".$langs->trans(
"IconFieldSelector").
"</b>', placement: 'right', showFooter: false, templates: {";
1205 $options .=
"iconpicker: '<div class=\"iconpicker\"><div style=\"background-color:#EFEFEF;\" class=\"iconpicker-items\"></div></div>',";
1206 $options .=
"iconpickerItem: '<a role=\"button\" href=\"#\" class=\"iconpicker-item\" style=\"background-color:#DDDDDD;\"><i></i></a>',";
1209 $options .=
"footer: '<div class=\"popover-footer\" style=\"background-color:#EFEFEF;\"></div>',";
1210 $options .=
"search: '<input type=\"search\" class\"form-control iconpicker-search\" placeholder=\"".$langs->trans(
"TypeToFilter").
"\" />',";
1211 $options .=
"popover: '<div class=\"iconpicker-popover popover\">";
1212 $options .=
" <div class=\"arrow\" ></div>";
1213 $options .=
" <div class=\"popover-title\" style=\"text-align:center;background-color:#EFEFEF;\"></div>";
1214 $options .=
" <div class=\"popover-content \" ></div>";
1215 $options .=
"</div>'}}";
1216 $out .=
"$('#".$keyprefix.$key.$keysuffix.
"').iconpicker(".$options.
");";
1217 $out .=
'</script>';
1219 } elseif ($type ==
'text') {
1220 if (!preg_match(
'/search_/', $keyprefix)) {
1221 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1222 $doleditor =
new DolEditor($keyprefix.$key.$keysuffix, $value,
'', 200,
'dolibarr_notes',
'In',
false,
false,
false, ROWS_5,
'90%');
1223 $out = (string) $doleditor->Create(1);
1225 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1227 } elseif ($type ==
'html') {
1228 if (!preg_match(
'/search_/', $keyprefix)) {
1229 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
1230 $doleditor =
new DolEditor($keyprefix.$key.$keysuffix, $value,
'', 200,
'dolibarr_notes',
'In',
false,
false, isModEnabled(
'fckeditor') &&
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_5,
'90%');
1231 $out = (string) $doleditor->Create(1);
1233 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.
dol_escape_htmltag($value).
'" '.($moreparam ? $moreparam :
'').
'>';
1235 } elseif ($type ==
'boolean') {
1238 if (!empty($value)) {
1239 $checked =
' checked value="1" ';
1241 $checked =
' value="1" ';
1243 $out =
'<input type="checkbox" class="flat valignmiddle'.($morecss ?
' '.$morecss :
'').
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.$checked.
' '.($moreparam ? $moreparam :
'').
'>';
1245 $out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1,
false, 1, 1,
'width75 yesno');
1247 $out .=
'<input type="hidden" name="'.$keyprefix.$key.$keysuffix.
'_boolean" value="1">';
1248 } elseif ($type ==
'price') {
1249 if (!empty($value)) {
1250 $value =
price($value);
1252 $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).
'">';
1253 } elseif ($type ==
'pricecy') {
1254 $currency = $conf->currency;
1255 if (!empty($value)) {
1257 $pricetmp = explode(
':', $value);
1258 $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency;
1259 $value =
price($pricetmp[0]);
1261 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.$value.
'" '.($moreparam ? $moreparam :
'').
'> ';
1262 $out .= $form->selectCurrency($currency, $keyprefix.$key.$keysuffix.
'currency_id');
1263 } elseif ($type ==
'double') {
1264 if (!empty($value)) {
1265 $value =
price($value);
1267 $out =
'<input type="text" class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" value="'.$value.
'" '.($moreparam ? $moreparam :
'').
'> ';
1268 } elseif ($type ==
'select') {
1272 foreach ($param[
'options'] as $okey => $val) {
1273 if ((
string) $okey ==
'') {
1277 $valarray = explode(
'|', $val);
1278 $val = $valarray[0];
1280 if ($langfile && $val) {
1281 $options[$okey] = $langs->trans($val);
1283 $options[$okey] = $val;
1286 $selected = array();
1287 if (!is_array($value)) {
1288 $selected = explode(
',', $value);
1291 $out .= $form->multiselectarray($keyprefix.$key.$keysuffix, $options, $selected, 0, 0, $morecss, 0, 0,
'',
'',
'', !empty($conf->use_javascript_ajax) && !
getDolGlobalString(
'MAIN_EXTRAFIELDS_DISABLE_SELECT2'));
1293 if (!empty($conf->use_javascript_ajax) && !
getDolGlobalString(
'MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
1294 include_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
1295 $out .=
ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
1298 $out .=
'<select class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.($moreparam ? $moreparam :
'').
'>';
1299 $out .=
'<option value="0"> </option>';
1300 foreach ($param[
'options'] as $key2 => $val2) {
1301 if ((
string) $key2 ==
'') {
1304 $valarray = explode(
'|', $val2);
1305 $val2 = $valarray[0];
1307 if (!empty($valarray[1])) {
1308 $parent = $valarray[1];
1310 $out .=
'<option value="'.$key2.
'"';
1311 $out .= (((string) $value == (
string) $key2) ?
' selected' :
'');
1312 $out .= (!empty($parent) ?
' parent="'.$parent.
'"' :
'');
1314 if ($langfile && $val2) {
1315 $out .= $langs->trans($val2);
1319 $out .=
'</option>';
1321 $out .=
'</select>';
1323 } elseif ($type ==
'sellist') {
1325 if (!empty($conf->use_javascript_ajax) && !
getDolGlobalString(
'MAIN_EXTRAFIELDS_DISABLE_SELECT2')) {
1326 include_once DOL_DOCUMENT_ROOT.
'/core/lib/ajax.lib.php';
1327 $out .=
ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
1330 $out .=
'<select class="flat '.$morecss.
' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.($moreparam ? $moreparam :
'').
'>';
1331 if (is_array($param[
'options'])) {
1332 $param_list = array_keys($param[
'options']);
1333 $InfoFieldList = explode(
":", $param_list[0]);
1344 $keyList = (empty($InfoFieldList[2]) ?
'rowid' : $InfoFieldList[2].
' as rowid');
1347 if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
1348 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1349 $keyList =
'main.'.$InfoFieldList[2].
' as rowid';
1351 $keyList = $InfoFieldList[2].
' as rowid';
1354 if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
1355 list($parentName, $parentField) = explode(
'|', $InfoFieldList[3]);
1356 $keyList .=
', '.$parentField;
1359 $filter_categorie =
false;
1360 if (count($InfoFieldList) > 5) {
1361 if ($InfoFieldList[0] ==
'categorie') {
1362 $filter_categorie =
true;
1366 if (!$filter_categorie) {
1367 $fields_label = explode(
'|', $InfoFieldList[1]);
1368 if (is_array($fields_label)) {
1370 $keyList .= implode(
', ', $fields_label);
1374 $sql =
"SELECT ".$keyList;
1375 $sql .=
' FROM '.$this->db->prefix().$InfoFieldList[0];
1376 if (!empty($InfoFieldList[4])) {
1378 if (strpos($InfoFieldList[4],
'$ENTITY$') !==
false) {
1379 $InfoFieldList[4] = str_replace(
'$ENTITY$', (
string) $conf->entity, $InfoFieldList[4]);
1382 if (strpos($InfoFieldList[4],
'$SEL$') !==
false) {
1383 $InfoFieldList[4] = str_replace(
'$SEL$',
'SELECT', $InfoFieldList[4]);
1387 if (strpos($InfoFieldList[4],
'$ID$') !==
false && !empty($objectid)) {
1388 $InfoFieldList[4] = str_replace(
'$ID$', (
string) $objectid, $InfoFieldList[4]);
1390 $InfoFieldList[4] = str_replace(
'$ID$',
'0', $InfoFieldList[4]);
1393 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1394 $sql .=
' as main, '.$this->db->prefix().$InfoFieldList[0].
'_extrafields as extra';
1395 $sqlwhere .=
" WHERE extra.fk_object=main.".$InfoFieldList[2].
" AND ".$InfoFieldList[4];
1397 $sqlwhere .=
" WHERE ".$InfoFieldList[4];
1400 $sqlwhere .=
' WHERE 1=1';
1403 if (in_array($InfoFieldList[0], array(
'tablewithentity'))) {
1404 $sqlwhere .=
' AND entity = '.((int) $conf->entity);
1409 $sql .=
' ORDER BY '.implode(
', ', $fields_label);
1411 dol_syslog(get_class($this).
'::showInputField type=sellist', LOG_DEBUG);
1412 $resql = $this->db->query($sql);
1414 $out .=
'<option value="0"> </option>';
1415 $num = $this->db->num_rows($resql);
1419 $obj = $this->db->fetch_object($resql);
1423 $fields_label = explode(
'|', $InfoFieldList[1]);
1424 if (is_array($fields_label) && count($fields_label) > 1) {
1426 foreach ($fields_label as $field_toshow) {
1427 $labeltoshow .= $obj->$field_toshow.
' ';
1430 $labeltoshow = $obj->{$InfoFieldList[1]};
1433 if ($value == $obj->rowid) {
1435 foreach ($fields_label as $field_toshow) {
1436 $translabel = $langs->trans($obj->$field_toshow);
1437 $labeltoshow = $translabel.
' ';
1440 $out .=
'<option value="'.$obj->rowid.
'" selected>'.$labeltoshow.
'</option>';
1443 $translabel = $langs->trans($obj->{$InfoFieldList[1]});
1444 $labeltoshow = $translabel;
1446 if (empty($labeltoshow)) {
1447 $labeltoshow =
'(not defined)';
1450 if (!empty($InfoFieldList[3]) && $parentField) {
1451 $parent = $parentName.
':'.$obj->{$parentField};
1454 $out .=
'<option value="'.$obj->rowid.
'"';
1455 $out .= ($value == $obj->rowid ?
' selected' :
'');
1456 $out .= (!empty($parent) ?
' parent="'.$parent.
'"' :
'');
1457 $out .=
'>'.$labeltoshow.
'</option>';
1462 $this->db->free($resql);
1464 print
'Error in request '.$sql.
' '.$this->db->lasterror().
'. Check setup of extra parameters.<br>';
1467 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1468 $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]],
'',
'parent', 64, $InfoFieldList[6], 1, 1);
1469 $out .=
'<option value="0"> </option>';
1470 if (is_array($data)) {
1471 foreach ($data as $data_key => $data_value) {
1472 $out .=
'<option value="'.$data_key.
'"';
1473 $out .= ($value == $data_key ?
' selected' :
'');
1474 $out .=
'>'.$data_value.
'</option>';
1479 $out .=
'</select>';
1480 } elseif ($type ==
'checkbox') {
1481 $value_arr = $value;
1482 if (!is_array($value)) {
1483 $value_arr = explode(
',', $value);
1485 $out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param[
'options']) ?
null : $param[
'options']), $value_arr,
'', 0,
'', 0,
'100%');
1486 } elseif ($type ==
'radio') {
1488 foreach ($param[
'options'] as $keyopt => $val) {
1489 $out .=
'<input class="flat '.$morecss.
'" type="radio" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'" '.($moreparam ? $moreparam :
'');
1490 $out .=
' value="'.$keyopt.
'"';
1491 $out .=
' id="'.$keyprefix.$key.$keysuffix.
'_'.$keyopt.
'"';
1492 $out .= ($value == $keyopt ?
'checked' :
'');
1493 $out .=
'/><label for="'.$keyprefix.$key.$keysuffix.
'_'.$keyopt.
'">'.$langs->trans($val).
'</label><br>';
1495 } elseif ($type ==
'chkbxlst') {
1496 if (is_array($value)) {
1497 $value_arr = $value;
1499 $value_arr = explode(
',', $value);
1502 if (is_array($param[
'options'])) {
1503 $param_list = array_keys($param[
'options']);
1504 $InfoFieldList = explode(
":", $param_list[0]);
1515 $keyList = (empty($InfoFieldList[2]) ?
'rowid' : $InfoFieldList[2].
' as rowid');
1517 if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) {
1518 list($parentName, $parentField) = explode(
'|', $InfoFieldList[3]);
1519 $keyList .=
', '.$parentField;
1521 if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) {
1522 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1523 $keyList =
'main.'.$InfoFieldList[2].
' as rowid';
1525 $keyList = $InfoFieldList[2].
' as rowid';
1529 $filter_categorie =
false;
1530 if (count($InfoFieldList) > 5) {
1531 if ($InfoFieldList[0] ==
'categorie') {
1532 $filter_categorie =
true;
1536 if (!$filter_categorie) {
1537 $fields_label = explode(
'|', $InfoFieldList[1]);
1538 if (is_array($fields_label)) {
1540 $keyList .= implode(
', ', $fields_label);
1544 $sql =
"SELECT ".$keyList;
1545 $sql .=
' FROM '.$this->db->prefix().$InfoFieldList[0];
1546 if (!empty($InfoFieldList[4])) {
1548 if (strpos($InfoFieldList[4],
'$ENTITY$') !==
false) {
1549 $InfoFieldList[4] = str_replace(
'$ENTITY$', (
string) $conf->entity, $InfoFieldList[4]);
1552 if (strpos($InfoFieldList[4],
'$SEL$') !==
false) {
1553 $InfoFieldList[4] = str_replace(
'$SEL$',
'SELECT', $InfoFieldList[4]);
1557 if (strpos($InfoFieldList[4],
'$ID$') !==
false && !empty($objectid)) {
1558 $InfoFieldList[4] = str_replace(
'$ID$', (
string) $objectid, $InfoFieldList[4]);
1559 } elseif (preg_match(
"#^.*list.php$#", $_SERVER[
"PHP_SELF"])) {
1561 $word =
'\b[a-zA-Z0-9-\.-_]+\b=\$ID\$';
1564 $InfoFieldList[4] = preg_replace(
'# *(=|\(|\)) *#',
'$1', $InfoFieldList[4]);
1568 while ($nbPreg != 0) {
1570 $nbPregRepl = $nbPregSel = 0;
1572 $InfoFieldList[4] = preg_replace(
'#([^=])(\([^)^(]*('.$word.
')[^)^(]*\))#',
'$1 $3 ', $InfoFieldList[4], -1, $nbPregRepl);
1574 $InfoFieldList[4] = preg_replace(
'# *(=|\(|\)) *#',
'$1', $InfoFieldList[4]);
1576 $InfoFieldList[4] = preg_replace(
'#\b[a-zA-Z0-9-\.-_]+\b=\([^)^(]*('.$word.
')[^)^(]*\)#',
'$1 ', $InfoFieldList[4], -1, $nbPregSel);
1578 $InfoFieldList[4] = preg_replace(
'# *(=|\(|\)) *#',
'$1', $InfoFieldList[4]);
1581 $nbPreg = $nbPregRepl + $nbPregSel;
1585 $matchCondition = array();
1586 preg_match(
'#(AND|OR|) *('.$word.
') *(AND|OR|)#', $InfoFieldList[4], $matchCondition);
1587 while (!empty($matchCondition[0])) {
1589 if (!empty($matchCondition[1]) && !empty($matchCondition[3]) && $matchCondition[1] != $matchCondition[3]) {
1591 $InfoFieldList[4] = str_replace(
'$ID$',
'0', $InfoFieldList[4]);
1593 if (!empty($matchCondition[1])) {
1594 $boolCond = (($matchCondition[1] ==
"AND") ?
' AND TRUE ' :
' OR FALSE ');
1595 $InfoFieldList[4] = str_replace($matchCondition[0], $boolCond.$matchCondition[3], $InfoFieldList[4]);
1596 } elseif (!empty($matchCondition[3])) {
1597 $boolCond = (($matchCondition[3] ==
"AND") ?
' TRUE AND ' :
' FALSE OR');
1598 $InfoFieldList[4] = str_replace($matchCondition[0], $boolCond, $InfoFieldList[4]);
1600 $InfoFieldList[4] =
" TRUE ";
1605 preg_match(
'#(AND|OR|) *('.$word.
') *(AND|OR|)#', $InfoFieldList[4], $matchCondition);
1608 $InfoFieldList[4] = str_replace(
'$ID$',
'0', $InfoFieldList[4]);
1612 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
1613 $sql .=
' as main, '.$this->db->prefix().$InfoFieldList[0].
'_extrafields as extra';
1614 $sqlwhere .=
" WHERE extra.fk_object=main.".$InfoFieldList[2].
" AND ".$InfoFieldList[4];
1616 $sqlwhere .=
" WHERE ".$InfoFieldList[4];
1619 $sqlwhere .=
' WHERE 1=1';
1622 if (in_array($InfoFieldList[0], array(
'tablewithentity'))) {
1623 $sqlwhere .=
" AND entity = ".((int) $conf->entity);
1629 $sql .=
' ORDER BY '.implode(
', ', $fields_label);
1631 dol_syslog(get_class($this).
'::showInputField type=chkbxlst', LOG_DEBUG);
1632 $resql = $this->db->query($sql);
1634 $num = $this->db->num_rows($resql);
1641 $obj = $this->db->fetch_object($resql);
1645 $fields_label = explode(
'|', $InfoFieldList[1]);
1646 if (is_array($fields_label)) {
1648 foreach ($fields_label as $field_toshow) {
1649 $labeltoshow .= $obj->$field_toshow.
' ';
1652 $labeltoshow = $obj->{$InfoFieldList[1]};
1654 $labeltoshow =
dol_trunc($labeltoshow, 45);
1656 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
1658 foreach ($fields_label as $field_toshow) {
1659 $translabel = $langs->trans($obj->$field_toshow);
1660 if ($translabel != $obj->$field_toshow) {
1661 $labeltoshow .=
' '.dol_trunc($translabel, 18).
' ';
1663 $labeltoshow .=
' '.dol_trunc($obj->$field_toshow, 18).
' ';
1666 $data[$obj->rowid] = $labeltoshow;
1669 $translabel = $langs->trans($obj->{$InfoFieldList[1]});
1670 if ($translabel != $obj->{$InfoFieldList[1]}) {
1671 $labeltoshow =
dol_trunc($translabel, 18);
1673 $labeltoshow =
dol_trunc($obj->{$InfoFieldList[1]}, 18);
1676 if (empty($labeltoshow)) {
1677 $labeltoshow =
'(not defined)';
1680 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
1681 $data[$obj->rowid] = $labeltoshow;
1684 if (!empty($InfoFieldList[3]) && $parentField) {
1685 $parent = $parentName.
':'.$obj->{$parentField};
1688 $data[$obj->rowid] = $labeltoshow;
1693 $this->db->free($resql);
1695 $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr,
'', 0,
'', 0,
'100%');
1697 print
'Error in request '.$sql.
' '.$this->db->lasterror().
'. Check setup of extra parameters.<br>';
1700 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1701 $data = $form->select_all_categories(Categorie::$MAP_ID_TO_CODE[$InfoFieldList[5]],
'',
'parent', 64, $InfoFieldList[6], 1, 1);
1702 $out = $form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr,
'', 0,
'', 0,
'100%');
1705 } elseif ($type ==
'link') {
1706 $param_list = array_keys($param[
'options']);
1713 $showempty = (($required && $default !=
'') ? 0 : 1);
1715 $tmparray = explode(
':', $param_list[0]);
1717 $element = $extrafieldsobjectkey;
1718 if ($element ==
'socpeople') {
1719 $element =
'contact';
1720 } elseif ($element ==
'projet') {
1721 $element =
'project';
1725 $objectdesc = $tmparray[0];
1726 $objectfield = $element.
':options_'.$key;
1728 $out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty,
'',
'', $morecss,
'', 0, 0,
'', $objectfield);
1729 } elseif (in_array($type, [
'point',
'multipts',
'linestrg',
'polygon'])) {
1730 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgeophp.class.php';
1734 if (!empty($value)) {
1735 $tmparray = $dolgeophp->parseGeoString($value);
1736 $geojson = $tmparray[
'geojson'];
1737 $centroidjson = $tmparray[
'centroidjson'];
1739 if (!preg_match(
'/search_/', $keyprefix)) {
1740 require_once DOL_DOCUMENT_ROOT.
'/core/class/geomapeditor.class.php';
1742 $out .= $geomapeditor->getHtml($keyprefix.$key.$keysuffix, $geojson, $centroidjson, $type);
1747 } elseif ($type ==
'password') {
1749 $out =
'<input style="display:none" type="text" name="fakeusernameremembered">';
1750 $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 :
'').
'>';
1752 if (!empty($hidden)) {
1753 $out =
'<input type="hidden" value="'.$value.
'" name="'.$keyprefix.$key.$keysuffix.
'" id="'.$keyprefix.$key.$keysuffix.
'"/>';
1776 public function showOutputField($key, $value, $moreparam =
'', $extrafieldsobjectkey =
'', $outputlangs =
null)
1778 global $conf, $langs;
1780 if (is_null($outputlangs) || !is_object($outputlangs)) {
1781 $outputlangs = $langs;
1784 if (empty($extrafieldsobjectkey)) {
1785 dol_syslog(get_class($this).
'::showOutputField extrafieldsobjectkey required', LOG_ERR);
1786 return 'BadValueForParamExtraFieldsObjectKey';
1789 $label = $this->attributes[$extrafieldsobjectkey][
'label'][$key];
1790 $type = $this->attributes[$extrafieldsobjectkey][
'type'][$key];
1791 $size = $this->attributes[$extrafieldsobjectkey][
'size'][$key];
1792 $default = $this->attributes[$extrafieldsobjectkey][
'default'][$key];
1793 $computed = $this->attributes[$extrafieldsobjectkey][
'computed'][$key];
1794 $unique = $this->attributes[$extrafieldsobjectkey][
'unique'][$key];
1795 $required = $this->attributes[$extrafieldsobjectkey][
'required'][$key];
1796 $param = $this->attributes[$extrafieldsobjectkey][
'param'][$key];
1797 $perms = (int)
dol_eval($this->attributes[$extrafieldsobjectkey][
'perms'][$key], 1, 1,
'2');
1798 $langfile = $this->attributes[$extrafieldsobjectkey][
'langfile'][$key];
1799 $list = (string)
dol_eval($this->attributes[$extrafieldsobjectkey][
'list'][$key], 1, 1,
'2');
1800 $help = $this->attributes[$extrafieldsobjectkey][
'help'][$key];
1801 $cssview = $this->attributes[$extrafieldsobjectkey][
'cssview'][$key];
1803 $hidden = (empty($list) ? 1 : 0);
1812 if ($type ==
'date') {
1814 if ($value !==
'') {
1817 } elseif ($type ==
'datetime') {
1819 if ($value !==
'') {
1822 } elseif ($type ==
'datetimegmt') {
1824 if ($value !==
'') {
1827 } elseif ($type ==
'int') {
1829 } elseif ($type ==
'double') {
1830 if (!empty($value)) {
1832 $sizeparts = explode(
",", $size);
1833 $number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0;
1834 $value =
price($value, 0, $outputlangs, 0, 0, $number_decimals,
'');
1836 } elseif ($type ==
'boolean') {
1838 if (!empty($value)) {
1839 $checked =
' checked ';
1842 $value =
'<input type="checkbox" '.$checked.
' '.($moreparam ? $moreparam :
'').
' readonly disabled>';
1844 $value =
yn($value ? 1 : 0);
1846 } elseif ($type ==
'mail') {
1848 } elseif ($type ==
'ip') {
1850 } elseif ($type ==
'icon') {
1851 $value =
'<span class="'.$value.
'"></span>';
1852 } elseif ($type ==
'url') {
1854 } elseif ($type ==
'phone') {
1856 } elseif ($type ==
'price') {
1858 if ($value || $value ==
'0') {
1859 $value =
price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).
' '.$outputlangs->getCurrencySymbol($conf->currency);
1861 } elseif ($type ==
'pricecy') {
1862 $currency = $conf->currency;
1863 if (!empty($value)) {
1865 $pricetmp = explode(
':', $value);
1866 $currency = !empty($pricetmp[1]) ? $pricetmp[1] : $conf->currency;
1867 $value = $pricetmp[0];
1869 if ($value || $value ==
'0') {
1870 $value =
price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1, $currency);
1872 } elseif ($type ==
'select') {
1873 $valstr = (!empty($param[
'options'][$value]) ? $param[
'options'][$value] :
'');
1874 if (($pos = strpos($valstr,
"|")) !==
false) {
1875 $valstr = substr($valstr, 0, $pos);
1877 if ($langfile && $valstr) {
1878 $value = $outputlangs->trans($valstr);
1882 } elseif ($type ==
'sellist') {
1883 $param_list = array_keys($param[
'options']);
1884 $InfoFieldList = explode(
":", $param_list[0]);
1886 $selectkey =
"rowid";
1889 if (count($InfoFieldList) >= 3) {
1890 $selectkey = $InfoFieldList[2];
1891 $keyList = $InfoFieldList[2].
' as rowid';
1894 $fields_label = explode(
'|', $InfoFieldList[1]);
1895 if (is_array($fields_label)) {
1897 $keyList .= implode(
', ', $fields_label);
1900 $filter_categorie =
false;
1901 if (count($InfoFieldList) > 5) {
1902 if ($InfoFieldList[0] ==
'categorie') {
1903 $filter_categorie =
true;
1907 $sql =
"SELECT ".$keyList;
1908 $sql .=
' FROM '.$this->db->prefix().$InfoFieldList[0];
1909 if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4],
'extra.') !==
false) {
1912 if ($selectkey ==
'rowid' && empty($value)) {
1913 $sql .=
" WHERE ".$selectkey.
" = 0";
1914 } elseif ($selectkey ==
'rowid') {
1915 $sql .=
" WHERE ".$selectkey.
" = ".((int) $value);
1917 $sql .=
" WHERE ".$selectkey.
" = '".$this->db->escape($value).
"'";
1922 dol_syslog(get_class($this).
':showOutputField:$type=sellist', LOG_DEBUG);
1923 $resql = $this->db->query($sql);
1925 if (!$filter_categorie) {
1928 $obj = $this->db->fetch_object($resql);
1931 $fields_label = explode(
'|', $InfoFieldList[1]);
1933 if (is_array($fields_label) && count($fields_label) > 1) {
1934 foreach ($fields_label as $field_toshow) {
1936 if (!empty($obj->$field_toshow)) {
1937 $translabel = $outputlangs->trans($obj->$field_toshow);
1939 if ($translabel != $obj->$field_toshow) {
1940 $value .=
dol_trunc($translabel, 24) .
' ';
1942 $value .= $obj->$field_toshow .
' ';
1948 $tmppropname = $InfoFieldList[1];
1950 if (!empty(isset($obj->$tmppropname) ? $obj->$tmppropname :
'')) {
1951 $translabel = $outputlangs->trans($obj->$tmppropname);
1953 if ($translabel != (isset($obj->$tmppropname) ? $obj->$tmppropname :
'')) {
1956 $value = isset($obj->$tmppropname) ? $obj->$tmppropname :
'';
1961 $obj = $this->db->fetch_object($resql);
1963 require_once DOL_DOCUMENT_ROOT .
'/categories/class/categorie.class.php';
1965 $result = $c->fetch($obj->rowid);
1967 $ways = $c->print_all_ways();
1968 foreach ($ways as $way) {
1969 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' .
img_object(
'',
'category') .
' ' . $way .
'</li>';
1973 $value =
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(
' ', $toprint).
'</ul></div>';
1976 dol_syslog(get_class($this).
'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
1978 } elseif ($type ==
'radio') {
1979 if (!isset($param[
'options'][$value])) {
1980 $outputlangs->load(
'errors');
1981 $value = $outputlangs->trans(
'ErrorNoValueForRadioType');
1983 $value = $outputlangs->trans($param[
'options'][$value]);
1985 } elseif ($type ==
'checkbox') {
1986 $value_arr = explode(
',', $value);
1989 if (is_array($value_arr)) {
1990 foreach ($value_arr as $keyval => $valueval) {
1991 if (!empty($valueval)) {
1992 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param[
'options'][$valueval].
'</li>';
1996 $value =
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(
' ', $toprint).
'</ul></div>';
1997 } elseif ($type ==
'chkbxlst') {
1998 $value_arr = explode(
',', $value);
2000 $param_list = array_keys($param[
'options']);
2001 $InfoFieldList = explode(
":", $param_list[0]);
2003 $selectkey =
"rowid";
2006 if (count($InfoFieldList) >= 3) {
2007 $selectkey = $InfoFieldList[2];
2008 $keyList = $InfoFieldList[2].
' as rowid';
2011 $fields_label = explode(
'|', $InfoFieldList[1]);
2012 if (is_array($fields_label)) {
2014 $keyList .= implode(
', ', $fields_label);
2017 $filter_categorie =
false;
2018 if (count($InfoFieldList) > 5) {
2019 if ($InfoFieldList[0] ==
'categorie') {
2020 $filter_categorie =
true;
2024 $sql =
"SELECT ".$keyList;
2025 $sql .=
" FROM ".$this->db->prefix().$InfoFieldList[0];
2026 if (strpos($InfoFieldList[4],
'extra.') !==
false) {
2032 dol_syslog(get_class($this).
':showOutputField:$type=chkbxlst', LOG_DEBUG);
2033 $resql = $this->db->query($sql);
2035 if (!$filter_categorie) {
2038 while ($obj = $this->db->fetch_object($resql)) {
2040 $fields_label = explode(
'|', $InfoFieldList[1]);
2041 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
2042 if (is_array($fields_label) && count($fields_label) > 1) {
2043 $label =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">';
2044 foreach ($fields_label as $field_toshow) {
2046 if (!empty($obj->$field_toshow)) {
2047 $translabel = $outputlangs->trans($obj->$field_toshow);
2049 if ($translabel != $field_toshow) {
2050 $label .=
' '.dol_trunc($translabel, 18);
2052 $label .=
' '.$obj->$field_toshow;
2056 $toprint[] = $label;
2059 if (!empty($obj->{$InfoFieldList[1]})) {
2060 $translabel = $outputlangs->trans($obj->{$InfoFieldList[1]});
2062 if ($translabel != $obj->{$InfoFieldList[1]}) {
2063 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).
'</li>';
2065 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.
'</li>';
2071 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
2074 while ($obj = $this->db->fetch_object($resql)) {
2075 if (is_array($value_arr) && in_array($obj->rowid, $value_arr)) {
2077 $c->fetch($obj->rowid);
2078 $ways = $c->print_all_ways();
2079 foreach ($ways as $way) {
2080 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ?
' style="background: #'.$c->color.
';"' :
' style="background: #bbb"').
'>'.
img_object(
'',
'category').
' '.$way.
'</li>';
2085 if (!empty($toprint)) {
2086 $value =
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(
' ', $toprint).
'</ul></div>';
2089 dol_syslog(get_class($this).
'::showOutputField error '.$this->db->lasterror(), LOG_WARNING);
2091 } elseif ($type ==
'link') {
2096 $param_list = array_keys($param[
'options']);
2098 $InfoFieldList = explode(
":", $param_list[0]);
2099 $classname = $InfoFieldList[0];
2100 $classpath = $InfoFieldList[1];
2101 if (!empty($classpath)) {
2103 if ($classname && class_exists($classname)) {
2104 $object =
new $classname($this->db);
2105 '@phan-var-force CommonObject $object';
2107 $value =
$object->getNomUrl(3);
2110 dol_syslog(
'Error bad setup of extrafield', LOG_WARNING);
2111 return 'Error bad setup of extrafield';
2114 } elseif ($type ==
'point') {
2115 if (!empty($value)) {
2116 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgeophp.class.php';
2118 $value = $dolgeophp->getXYString($value);
2122 } elseif (in_array($type, [
'multipts',
'linestrg',
'polygon'])) {
2123 if (!empty($value)) {
2124 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolgeophp.class.php';
2126 $value = $dolgeophp->getPointString($value);
2130 } elseif ($type ==
'text') {
2131 $value =
'<div class="'.($cssview ? $cssview :
'shortmessagecut').
'">'.
dol_htmlentitiesbr($value).
'</div>';
2132 } elseif ($type ==
'html') {
2134 } elseif ($type ==
'password') {
2135 $value =
dol_trunc(preg_replace(
'/./i',
'*', $value), 8,
'right',
'UTF-8', 1);
2137 $showsize = round((
float) $size);
2138 if ($showsize > 48) {