dolibarr  9.0.0
extrafields_list_search_input.tpl.php
1 <?php
2 
3 // Protection to avoid direct call of template
4 if (empty($conf) || ! is_object($conf))
5 {
6  print "Error, template page can't be called as URL";
7  exit;
8 }
9 
10 if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element;
11 
12 // Loop to show all columns of extrafields for the search title line
13 if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
14 {
15  if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
16  {
17  foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val)
18  {
19  if (! empty($arrayfields["ef.".$key]['checked'])) {
20  $align=$extrafields->getAlignFlag($key);
21  $typeofextrafield=$extrafields->attributes[$extrafieldsobjectkey]['type'][$key];
22  print '<td class="liste_titre'.($align?' '.$align:'').'">';
23  if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]))
24  {
25  $crit=$val;
26  $tmpkey=preg_replace('/search_options_/','',$key);
27  $searchclass='';
28  if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
29  if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
30  print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
31  }
32  elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
33  {
34  // 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')
35  $morecss='';
36  if ($typeofextrafield == 'sellist') $morecss='maxwidth200';
37  echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_', $morecss);
38  }
39  elseif (in_array($typeofextrafield, array('datetime','timestamp')))
40  {
41  // TODO
42  // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes
43  }
44  print '</td>';
45  }
46  }
47  }
48 }
print
Draft customers invoices.
Definition: index.php:91
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...