New: Prefix on third party is not used by default. Hidden option SOCIETE_USEPREFIX can restore old feature.

This commit is contained in:
Laurent Destailleur 2011-01-29 16:25:01 +00:00
parent c9cc9e7ec2
commit 980ed1a7dc
13 changed files with 100 additions and 38 deletions

View File

@ -206,7 +206,10 @@ if ($_GET["socid"])
print $html->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); print $html->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>';
}
if ($soc->client) if ($soc->client)
{ {

View File

@ -192,9 +192,12 @@ if ($socid > 0)
print '</td></tr>'; print '</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print ($objsoc->prefix_comm?$objsoc->prefix_comm:'&nbsp;'); print ($objsoc->prefix_comm?$objsoc->prefix_comm:'&nbsp;');
print '</td></tr>'; print '</td></tr>';
}
if ($objsoc->client) if ($objsoc->client)
{ {

View File

@ -69,9 +69,12 @@ if ($socid > 0)
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;'); print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;');
print '</td></tr>'; print '</td></tr>';
}
print "</table>"; print "</table>";

View File

@ -69,9 +69,12 @@ if ($socid > 0)
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;'); print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;');
print '</td></tr>'; print '</td></tr>';
}
print "</table>"; print "</table>";

View File

@ -68,9 +68,12 @@ if ($socid > 0)
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;'); print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;');
print '</td></tr>'; print '</td></tr>';
}
print "</table>"; print "</table>";

View File

@ -95,7 +95,10 @@ if ( $societe->fetch($socid) )
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom','',''); print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';
}
if ($societe->fournisseur) if ($societe->fournisseur)
{ {

View File

@ -69,9 +69,12 @@ if ($socid > 0)
print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;'); print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;');
print '</td></tr>'; print '</td></tr>';
}
print "</table>"; print "</table>";

View File

@ -84,7 +84,10 @@ if ($_GET["socid"])
print $html->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); print $html->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>';
}
if ($soc->client) if ($soc->client)
{ {

View File

@ -109,7 +109,15 @@ if ($_GET["socid"])
print $langs->trans('CustomerCode').'</td><td width="20%">'; print $langs->trans('CustomerCode').'</td><td width="20%">';
print $soc->code_client; print $soc->code_client;
if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
print '</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>'; print '</td>';
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td>';
}
else print '<td>&nbsp;</td>';
print '</tr>';
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->address)."</td></tr>"; print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->address)."</td></tr>";

View File

@ -147,7 +147,10 @@ if ($socid > 0)
print '</td></tr>'; print '</td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';
}
if ($societe->client) if ($societe->client)
{ {

View File

@ -112,7 +112,15 @@ if($_GET["socid"])
print $langs->trans('CustomerCode').'</td><td width="20%">'; print $langs->trans('CustomerCode').'</td><td width="20%">';
print $soc->code_client; print $soc->code_client;
if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode");
print '</td><td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td></tr>'; print '</td>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<td>'.$langs->trans('Prefix').'</td><td>'.$soc->prefix_comm.'</td>';
}
else print '<td>&nbsp;</td>';
print '</tr>';
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->address)."</td></tr>"; print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->address)."</td></tr>";

View File

@ -666,12 +666,22 @@ else
if ($soc->particulier) if ($soc->particulier)
{ {
print '<tr><td><span class="fieldrequired">'.$langs->trans('LastName').'</span></td><td><input type="text" size="30" maxlength="60" name="nom" value="'.$soc->nom.'"></td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans('LastName').'</span></td><td><input type="text" size="30" maxlength="60" name="nom" value="'.$soc->nom.'"></td>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>'; 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="'.$soc->prefix_comm.'"></td>';
}
else print '<td>&nbsp;</td>';
print '</tr>';
} }
else else
{ {
print '<tr><td><span class="fieldrequired">'.$langs->trans('Name').'</span></td><td><input type="text" size="30" maxlength="60" name="nom" value="'.$soc->nom.'"></td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans('Name').'</span></td><td><input type="text" size="30" maxlength="60" name="nom" value="'.$soc->nom.'"></td>';
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>'; 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="'.$soc->prefix_comm.'"></td>';
}
else print '<td>&nbsp;</td>';
print '</tr>';
} }
// If javascript on, we show option individual // If javascript on, we show option individual
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
@ -1057,6 +1067,8 @@ else
print '<tr><td><span class="fieldrequired">'.$langs->trans('Name').'</span></td><td colspan="3"><input type="text" size="40" maxlength="60" name="nom" value="'.$soc->nom.'"></td></tr>'; print '<tr><td><span class="fieldrequired">'.$langs->trans('Name').'</span></td><td colspan="3"><input type="text" size="40" maxlength="60" name="nom" value="'.$soc->nom.'"></td></tr>';
// Prefix // Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
// It does not change the prefix mode using the auto numbering prefix // It does not change the prefix mode using the auto numbering prefix
if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $soc->prefix_comm) if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $soc->prefix_comm)
@ -1069,6 +1081,7 @@ else
print '<input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'">'; print '<input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'">';
} }
print '</td>'; print '</td>';
}
// Prospect/Customer // Prospect/Customer
print '<tr><td width="25%"><span class="fieldrequired">'.$langs->trans('ProspectCustomer').'</span></td><td width="25%"><select class="flat" name="client">'; print '<tr><td width="25%"><span class="fieldrequired">'.$langs->trans('ProspectCustomer').'</span></td><td width="25%"><select class="flat" name="client">';
@ -1367,7 +1380,10 @@ else
print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>';
}
if ($soc->client) if ($soc->client)
{ {

View File

@ -85,7 +85,10 @@ if ($socid > 0)
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom'); print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';
}
if ($societe->client) if ($societe->client)
{ {