From 285e60e9f10ed83ac83edc684ea1363fcc81f666 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 5 Apr 2019 10:57:50 +0200 Subject: [PATCH] Fix default filter --- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index 6a9d32bc226..b4a98946f94 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -23,10 +23,10 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $align=$extrafields->getAlignFlag($key); $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; print ''; + $tmpkey=preg_replace('/'.$search_options_pattern.'/', '', $key); if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) { $crit=$val; - $tmpkey=preg_replace('/'.$search_options_pattern.'/', '', $key); $searchclass=''; if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; @@ -37,7 +37,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ // 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=''; if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; - echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$key], '', '', 'search_', $morecss); + echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $search_options_pattern, $morecss); } elseif (in_array($typeofextrafield, array('datetime','timestamp'))) {