fix error with lang search

This commit is contained in:
lmarcouiller 2021-08-04 15:06:08 +02:00
parent 8cbbcc01a9
commit 8c8a542127

View File

@ -89,7 +89,11 @@ $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alph
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha') !== '') {
$search[$key] = GETPOST('search_'.$key, 'alpha');
if ($key == "lang") {
$search[$key] = GETPOST('search_'.$key, 'alpha')!='0' ? GETPOST('search_'.$key, 'alpha') : '';
} else {
$search[$key] = GETPOST('search_'.$key, 'alpha');
}
}
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
@ -118,15 +122,6 @@ foreach ($object->fields as $key => $val) {
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);
} elseif ($key = 'lang') {
$visible = (int) dol_eval($val['visible'], 1);
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);
}
}
// Extra fields