Mutualized common code

This commit is contained in:
Raphaël Doursenaud 2014-07-11 20:04:18 +02:00
parent 78ce6c0b1c
commit 8a3fbf9533

View File

@ -802,30 +802,23 @@ else
print '<table class="border" width="100%">';
// Name, firstname
print '<tr><td>';
if ($object->particulier || $private)
{
print '<tr><td>';
print '<label for="name"><span id="TypeName" class="fieldrequired">'.$langs->trans('LastName').'</span></label>';
print '</td><td'.(empty($conf->global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>';
print '<input type="text" size="30" maxlength="60" name="nom" id="name" value="'.$object->name.'"></td>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$object->prefix_comm.'"></td>';
}
print '</tr>';
}
else
{
print '<tr><td>';
print '<label for="name"><span span id="TypeName" class="fieldrequired">'.$langs->trans('ThirdPartyName').'</span></label>';
print '</td><td'.(empty($conf->global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>';
print '<input type="text" size="30" maxlength="60" name="nom" id="nom" value="'.$object->name.'"></td>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field1
{
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$object->prefix_comm.'"></td>';
}
print '</tr>';
}
print '</td><td'.(empty($conf->global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>';
print '<input type="text" size="30" maxlength="60" name="nom" id="nom" value="'.$object->name.'"></td>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$object->prefix_comm.'"></td>';
}
print '</tr>';
// If javascript on, we show option individual
if ($conf->use_javascript_ajax)
{