';
+ if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]))
+ {
+ $crit=$val;
+ $tmpkey=preg_replace('/search_options_/','',$key);
+ $searchclass='';
+ if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
+ if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
+ print '';
+ }
+ elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
+ {
+ // 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_'.$key], '', '', 'search_', $morecss);
+ }
+ elseif (in_array($typeofextrafield, array('datetime','timestamp')))
+ {
+ // TODO
+ // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes
+ }
+ print '
';
}
- elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
- {
- // 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_'.$key], '', '', 'search_', $morecss);
- }
- elseif (in_array($typeofextrafield, array('datetime','timestamp')))
- {
- // TODO
- // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes
- }
- print '';
}
}
}
\ No newline at end of file
diff --git a/htdocs/core/tpl/extrafields_list_search_title.tpl.php b/htdocs/core/tpl/extrafields_list_search_title.tpl.php
index 8e126820bf9..8020739d5cb 100644
--- a/htdocs/core/tpl/extrafields_list_search_title.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_search_title.tpl.php
@@ -7,18 +7,23 @@ if (empty($conf) || ! is_object($conf))
exit;
}
+if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element;
+
// Loop to show all columns of extrafields for the title line
-if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']))
+if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
{
- foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
+ if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
{
- if (! empty($arrayfields["ef.".$key]['checked']))
+ foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val)
{
- $align=$extrafields->getAlignFlag($key);
- $sortonfield = "ef.".$key;
- if (! empty($extrafields->attributes[$object->table_element]['computed'][$key])) $sortonfield='';
- if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') print '