Fix alignement on extrafields

This commit is contained in:
Laurent Destailleur 2016-03-10 16:00:44 +01:00
parent 2e1a63a1f3
commit a8602dbec2
2 changed files with 19 additions and 7 deletions

View File

@ -322,10 +322,22 @@ if ($resql)
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
foreach($extrafields->attribute_label as $key => $val) foreach($extrafields->attribute_label as $key => $val)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) print '<td class="liste_titre"></td>'; if (! empty($arrayfields["ef.".$key]['checked']))
} {
$align=$extrafields->getAlignFlag($key);
$typeofextrafield=$extrafields->attribute_type[$key];
print '<td class="liste_titre'.($align?' '.$align:'').'">';
if (in_array($typeofextrafield, array('varchar', 'int', 'select')))
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/','',$key);
print '<input class="flat" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
}
print '</td>';
}
}
} }
// Fields from hook // Fields from hook
$parameters=array('arrayfields'=>$arrayfields); $parameters=array('arrayfields'=>$arrayfields);

View File

@ -778,9 +778,9 @@ if ($resql)
{ {
if (! empty($arrayfields["ef.".$key]['checked'])) if (! empty($arrayfields["ef.".$key]['checked']))
{ {
$typeofextrafield=$extrafields->attribute_type[$key]; $align=$extrafields->getAlignFlag($key);
if (in_array($typeofextrafield, array('int'))) print '<td class="liste_titre right">'; $typeofextrafield=$extrafields->attribute_type[$key];
else print '<td class="liste_titre">'; print '<td class="liste_titre'.($align?' '.$align:'').'">';
if (in_array($typeofextrafield, array('varchar', 'int', 'select'))) if (in_array($typeofextrafield, array('varchar', 'int', 'select')))
{ {
$crit=$val; $crit=$val;