Merge pull request #16842 from hregis/fix_avoid_warning_php8
FIX avoid php8 warning in products list
This commit is contained in:
commit
2da85a9ca2
@ -1597,7 +1597,7 @@ class ExtraFields
|
|||||||
if (!empty($extrafieldsobjectkey)) {
|
if (!empty($extrafieldsobjectkey)) {
|
||||||
$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
|
$label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
|
||||||
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
|
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
|
||||||
$size = $this->attributes[$extrafieldsobjectkey]['size'][$key];
|
$size = (int) $this->attributes[$extrafieldsobjectkey]['size'][$key];
|
||||||
$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
|
$default = $this->attributes[$extrafieldsobjectkey]['default'][$key];
|
||||||
$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
|
$computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key];
|
||||||
$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
|
$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
|
||||||
@ -1666,7 +1666,7 @@ class ExtraFields
|
|||||||
$value = price($value, 0, $langs, 0, 0, -1);
|
$value = price($value, 0, $langs, 0, 0, -1);
|
||||||
}
|
}
|
||||||
} elseif ($type == 'select') {
|
} elseif ($type == 'select') {
|
||||||
$valstr = $param['options'][$value];
|
$valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : '');
|
||||||
if (($pos = strpos($valstr, "|")) !== false) {
|
if (($pos = strpos($valstr, "|")) !== false) {
|
||||||
$valstr = substr($valstr, 0, $pos);
|
$valstr = substr($valstr, 0, $pos);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6684,7 +6684,7 @@ class Form
|
|||||||
if (!dol_eval($val['enabled'], 1, 1)) {
|
if (!dol_eval($val['enabled'], 1, 1)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($val['showoncombobox']) {
|
if (!empty($val['showoncombobox'])) {
|
||||||
$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
|
$tmpfieldstoshow .= ($tmpfieldstoshow ? ',' : '').'t.'.$key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6817,7 +6817,7 @@ class Form
|
|||||||
|
|
||||||
if (!$forcecombo) {
|
if (!$forcecombo) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||||
$out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode);
|
$out .= ajax_combobox($htmlname, null, (!empty($conf->global->$confkeyforautocompletemode) ? $conf->global->$confkeyforautocompletemode : 0));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
|
|||||||
@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
|
|||||||
}
|
}
|
||||||
$value = $datenotinstring;
|
$value = $datenotinstring;
|
||||||
} else {
|
} else {
|
||||||
$value = $obj->$tmpkey;
|
$value = (!empty($obj->$tmpkey) ? $obj->$tmpkey : '');
|
||||||
}
|
}
|
||||||
// If field is a computed field, we make computation to get value
|
// If field is a computed field, we make computation to get value
|
||||||
if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) {
|
if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) {
|
||||||
|
|||||||
@ -37,17 +37,17 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
|
|||||||
if (in_array($typeofextrafield, array('int', 'double'))) {
|
if (in_array($typeofextrafield, array('int', 'double'))) {
|
||||||
$searchclass = 'searchnum';
|
$searchclass = 'searchnum';
|
||||||
}
|
}
|
||||||
print '<input class="flat'.($searchclass ? ' '.$searchclass : '').'" size="4" type="text" name="'.$search_options_pattern.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options[$search_options_pattern.$tmpkey]).'">';
|
print '<input class="flat'.($searchclass ? ' '.$searchclass : '').'" size="4" type="text" name="'.$search_options_pattern.$tmpkey.'" value="'.dol_escape_htmltag((empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey])).'">';
|
||||||
} elseif (in_array($typeofextrafield, array('datetime', 'timestamp'))) {
|
} elseif (in_array($typeofextrafield, array('datetime', 'timestamp'))) {
|
||||||
$morecss = '';
|
$morecss = '';
|
||||||
echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
|
echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
|
||||||
} else {
|
} else {
|
||||||
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
|
// for the type as 'checkbox', 'chkbxlst', 'sellist' we should use code instead of id (example: I declare a 'chkbxlst' to have a link with dictionnairy, I have to extend it with the 'code' instead 'rowid')
|
||||||
$morecss = '';
|
$morecss = '';
|
||||||
if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) {
|
if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) {
|
||||||
$morecss = 'maxwidth200';
|
$morecss = 'maxwidth200';
|
||||||
}
|
}
|
||||||
echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
|
echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user