dolibarr  7.0.0-beta
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 // Loop to show all columns of extrafields for the search title line
11 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
12 {
13  foreach($extrafields->attribute_label as $key => $val)
14  {
15  if (! empty($arrayfields["ef.".$key]['checked'])) {
16  $align=$extrafields->getAlignFlag($key);
17  $typeofextrafield=$extrafields->attribute_type[$key];
18  print '<td class="liste_titre'.($align?' '.$align:'').'">';
19  if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')) && empty($extrafields->attribute_computed[$key]))
20  {
21  $crit=$val;
22  $tmpkey=preg_replace('/search_options_/','',$key);
23  $searchclass='';
24  if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
25  if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
26  print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
27  }
28  elseif (! in_array($typeofextrafield, array('datetime','timestamp')))
29  {
30  // 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')
31  echo $extrafields->showInputField($key, $search_array_options['search_options_'.$key], '', '', 'search_');
32  }
33  elseif (in_array($typeofextrafield, array('datetime','timestamp')))
34  {
35  // TODO
36  // Use showInputField in a particular manner to have input with a comparison operator, not input for a specific value date-hour-minutes
37  }
38  print '</td>';
39  }
40  }
41 }
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...
print
Draft customers invoices.
Definition: index.php:91