From 1e087b68e131885d71afe65d629209ba6fefe590 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 17 Apr 2019 16:29:48 +0200 Subject: [PATCH 1/2] New show html list instead input text for extrafields typed as list --- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index b4a98946f94..c0a7ecbb437 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -24,11 +24,11 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $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])) + if (in_array($typeofextrafield, array('varchar', 'int', 'double')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) { $crit=$val; $searchclass=''; - if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('varchar'))) $searchclass='searchstring'; if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; print ''; } @@ -37,7 +37,9 @@ 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.$tmpkey], '', '', $search_options_pattern, $morecss); + $keyprefix=$search_options_pattern; + if (substr($search_options_pattern, -8) === 'options_') $keyprefix = substr($search_options_pattern, 0,-8); + echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $keyprefix, $morecss); } elseif (in_array($typeofextrafield, array('datetime','timestamp'))) { From 8765e7648e1354e6b2bf13ea395f409f2d330811 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 31 Oct 2019 11:03:46 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 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 0ba2385eda2..fb0a0dea3aa 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -38,9 +38,8 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $morecss=''; if ($typeofextrafield == 'sellist') $morecss='maxwidth200'; $keyprefix=$search_options_pattern; - if (substr($search_options_pattern, -8) === 'options_') $keyprefix = substr($search_options_pattern, 0,-8); + if (substr($search_options_pattern, -8) === 'options_') $keyprefix = substr($search_options_pattern, 0, -8); echo $extrafields->showInputField($key, $search_array_options[$search_options_pattern.$tmpkey], '', '', $keyprefix, $morecss); - } else {