Skip to content

Commit

Permalink
Show extrafield separator on thirdparty and contact
Browse files Browse the repository at this point in the history
  • Loading branch information
jfefe committed Mar 15, 2013
1 parent f16c9dd commit 9a57431
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 51 deletions.
47 changes: 34 additions & 13 deletions htdocs/contact/fiche.php
Expand Up @@ -521,11 +521,18 @@
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:''));
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
}
else
{
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
}
}
}

Expand Down Expand Up @@ -736,11 +743,18 @@
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print "</td></tr>\n";
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
}
else
{
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print "</td></tr>\n";
}
}
}

Expand Down Expand Up @@ -948,9 +962,16 @@
foreach($extrafields->attribute_label as $key=>$label)
{
$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">';
print $extrafields->showOutputField($key,$value);
print "</td></tr>\n";
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
}
else
{
print '<tr><td>'.$label.'</td><td colspan="3">';
print $extrafields->showOutputField($key,$value);
print "</td></tr>\n";
}
}
}

Expand Down
95 changes: 57 additions & 38 deletions htdocs/societe/soc.php
Expand Up @@ -985,20 +985,27 @@
{
$colspan='3';
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:''));
if (($e % 2) == 0)
if ($extrafields->attribute_type[$key] == 'separate')
{
print '<tr>';
$colspan='0';
}
print '<td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td>';
print '<td colspan="'.$colspan.'">';
print $extrafields->showInputField($key,$value);
print '</td>';

if (($e % 2) == 1) print '</tr>'."\n";
$e++;
print $extrafields->showSeparator($key);
}
else
{
if (($e % 2) == 0)
{
print '<tr>';
$colspan='0';
}
print '<td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td>';
print '<td colspan="'.$colspan.'">';
print $extrafields->showInputField($key,$value);
print '</td>';

if (($e % 2) == 1) print '</tr>'."\n";
$e++;
}
}
}

Expand Down Expand Up @@ -1414,25 +1421,30 @@
{
$colspan = '3';
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);

if (($e % 2) == 0)
if ($extrafields->attribute_type[$key] == 'separate')
{
print '<tr>'."\n";
$colspan = '0';
print $extrafields->showSeparator($key);
}
print '<td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td>'."\n";
print '<td colspan="'.$colspan.'">';
print $extrafields->showInputField($key,$value);
print "</td>"."\n";

if (($e % 2) == 1 )
else
{
print "</tr>\n";
if (($e % 2) == 0)
{
print '<tr>'."\n";
$colspan = '0';
}
print '<td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td>'."\n";
print '<td colspan="'.$colspan.'">';
print $extrafields->showInputField($key,$value);
print "</td>"."\n";

if (($e % 2) == 1 )
{
print "</tr>\n";
}
$e++;
}
$old_pos = $extrafields->attribute_pos[$key];
$e++;
}
}
// Logo
Expand Down Expand Up @@ -1753,18 +1765,25 @@
{
$colspan='3';
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:''));
if (($e % 2) == 0)
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
}
else
{
print '<tr>';
$colspan='0';
if (($e % 2) == 0)
{
print '<tr>';
$colspan='0';
}
print '<td>'.$label.'</td>';
print '<td colspan="'.$colspan.'">';
print $extrafields->showOutputField($key,$value);
print "</td>";

if (($e % 2) == 1) print '</tr>';
$e++;
}
print '<td>'.$label.'</td>';
print '<td colspan="'.$colspan.'">';
print $extrafields->showOutputField($key,$value);
print "</td>";

if (($e % 2) == 1) print '</tr>';
$e++;
}
}

Expand Down

0 comments on commit 9a57431

Please sign in to comment.