Skip to content
Snippets Groups Projects
Commit bd2d9cdd authored by Jean-François Ferry's avatar Jean-François Ferry
Browse files

Split extrafields display into 2 columns (thirdparty)

parent 3ef8c6e5
Branches
Tags
No related merge requests found
...@@ -998,14 +998,25 @@ else ...@@ -998,14 +998,25 @@ else
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
$e=0;
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
$colspan='3';
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:''));
print '<tr><td'; if (($e % 2) == 0)
{
print '<tr>';
$colspan='0';
}
print '<td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"'; if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">'; print '>'.$label.'</td>';
print '<td colspan="'.$colspan.'">';
print $extrafields->showInputField($key,$value); print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n"; print '</td>';
if (($e % 2) == 1) print '</tr>'."\n";
$e++;
} }
} }
...@@ -1426,23 +1437,38 @@ else ...@@ -1426,23 +1437,38 @@ else
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
$old_pos=0;
$e=0;
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
$colspan = '3';
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td';
if (($e % 2) == 0)
{
print '<tr>'."\n";
$colspan = '0';
}
print '<td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"'; if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">'; print '>'.$label.'</td>'."\n";
print '<td colspan="'.$colspan.'">';
print $extrafields->showInputField($key,$value); print $extrafields->showInputField($key,$value);
print "</td></tr>\n"; print "</td>"."\n";
if (($e % 2) == 1 )
{
print "</tr>\n";
}
$old_pos = $extrafields->attribute_pos[$key];
$e++;
} }
} }
// Logo // Logo
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("Logo").'</td>'; print '<td>'.$langs->trans("Logo").'</td>';
...@@ -1756,12 +1782,23 @@ else ...@@ -1756,12 +1782,23 @@ else
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
$e=0;
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
$colspan='3';
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:''));
print '<tr><td>'.$label.'</td><td colspan="3">'; if (($e % 2) == 0)
{
print '<tr>';
$colspan='0';
}
print '<td>'.$label.'</td>';
print '<td colspan="'.$colspan.'">';
print $extrafields->showOutputField($key,$value); print $extrafields->showOutputField($key,$value);
print "</td></tr>\n"; print "</td>";
if (($e % 2) == 1) print '</tr>';
$e++;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment