From 980ed1a7dce5965c7714d7bbe19476ad1a09da55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jan 2011 16:25:01 +0000 Subject: [PATCH] New: Prefix on third party is not used by default. Hidden option SOCIETE_USEPREFIX can restore old feature. --- htdocs/categories/categorie.php | 7 ++-- htdocs/comm/fiche.php | 9 +++-- htdocs/comm/prospect/recap-prospect.php | 9 +++-- htdocs/comm/recap-client.php | 9 +++-- htdocs/compta/recap-compta.php | 9 +++-- htdocs/fourn/fiche.php | 5 ++- htdocs/fourn/recap-fourn.php | 9 +++-- htdocs/societe/agenda.php | 5 ++- htdocs/societe/commerciaux.php | 10 +++++- htdocs/societe/document.php | 5 ++- htdocs/societe/lien.php | 10 +++++- htdocs/societe/soc.php | 46 +++++++++++++++++-------- htdocs/societe/socnote.php | 5 ++- 13 files changed, 100 insertions(+), 38 deletions(-) diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 5e2b223df85..69b445d700c 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -206,7 +206,10 @@ if ($_GET["socid"]) print $html->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); print ''; - print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + } if ($soc->client) { @@ -424,7 +427,7 @@ function formCategory($db,$object,$typeid) print ''; print ''; print ''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 2b8c569f0cb..59e77f7906e 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -192,9 +192,12 @@ if ($socid > 0) print ''; // Prefix - print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } if ($objsoc->client) { diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 1fcf3b42fd5..b6a60aca1e0 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -69,9 +69,12 @@ if ($socid > 0) print ''; // Prefix - print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } print "
'; - print $langs->trans("ClassifyInCategory"); + print $langs->trans("ClassifyInCategory"); print $html->select_all_categories($typeid); print ''; print '
'.$langs->trans("Prefix").''; - print ($objsoc->prefix_comm?$objsoc->prefix_comm:' '); - print '
'.$langs->trans("Prefix").''; + print ($objsoc->prefix_comm?$objsoc->prefix_comm:' '); + print '
'.$langs->trans("Name").''.$societe->nom.'
'.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print '
'.$langs->trans("Prefix").''; + print ($societe->prefix_comm?$societe->prefix_comm:' '); + print '
"; diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index fb06e37a7b9..b28576c3f37 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -69,9 +69,12 @@ if ($socid > 0) print ''.$langs->trans("Name").''.$societe->nom.''; // Prefix - print ''.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans("Prefix").''; + print ($societe->prefix_comm?$societe->prefix_comm:' '); + print ''; + } print ""; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index d877e37b702..86d7eefaefb 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -68,9 +68,12 @@ if ($socid > 0) print ''.$langs->trans("Name").''.$societe->nom.''; // Prefix - print ''.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans("Prefix").''; + print ($societe->prefix_comm?$societe->prefix_comm:' '); + print ''; + } print ""; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 5fe712e7c7a..3596f4e2436 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -95,7 +95,10 @@ if ( $societe->fetch($socid) ) print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom','',''); print ''; - print ''.$langs->trans('Prefix').''.$societe->prefix_comm.''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''.$societe->prefix_comm.''; + } if ($societe->fournisseur) { diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index 506dab6307c..4d67ec05aeb 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -69,9 +69,12 @@ if ($socid > 0) print ''.$langs->trans("Name").''.$societe->nom.''; // Prefix - print ''.$langs->trans("Prefix").''; - print ($societe->prefix_comm?$societe->prefix_comm:' '); - print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans("Prefix").''; + print ($societe->prefix_comm?$societe->prefix_comm:' '); + print ''; + } print ""; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index c2a964c5ebe..1db0283d895 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -84,7 +84,10 @@ if ($_GET["socid"]) print $html->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom'); print ''; - print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + } if ($soc->client) { diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 7acc91fbe76..2dff996b236 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -109,7 +109,15 @@ if ($_GET["socid"]) print $langs->trans('CustomerCode').''; print $soc->code_client; if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); - print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + print ''; + + // Prefix + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + } + else print ' '; + print ''; print "".$langs->trans('Address')."".nl2br($soc->address).""; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index d7a8f282270..4e9fc863558 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -147,7 +147,10 @@ if ($socid > 0) print ''; // Prefix - print ''.$langs->trans('Prefix').''.$societe->prefix_comm.''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''.$societe->prefix_comm.''; + } if ($societe->client) { diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php index 747cd18d5ac..8a4e12239e0 100644 --- a/htdocs/societe/lien.php +++ b/htdocs/societe/lien.php @@ -112,7 +112,15 @@ if($_GET["socid"]) print $langs->trans('CustomerCode').''; print $soc->code_client; if ($soc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); - print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + print ''; + + + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; + } + else print ' '; + print ''; print "".$langs->trans('Address')."".nl2br($soc->address).""; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index d3f675ce609..00ba088e0db 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -666,12 +666,22 @@ else if ($soc->particulier) { print ''.$langs->trans('LastName').''; - print ''.$langs->trans('Prefix').''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''; + } + else print ' '; + print ''; } else { print ''.$langs->trans('Name').''; - print ''.$langs->trans('Prefix').''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans('Prefix').''; + } + else print ' '; + print ''; } // If javascript on, we show option individual if ($conf->use_javascript_ajax) @@ -1057,18 +1067,21 @@ else print ''.$langs->trans('Name').''; // Prefix - print ''.$langs->trans("Prefix").''; - // It does not change the prefix mode using the auto numbering prefix - if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $soc->prefix_comm) - { - print ''; - print $soc->prefix_comm; - } - else - { - print ''; - } - print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''.$langs->trans("Prefix").''; + // It does not change the prefix mode using the auto numbering prefix + if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $soc->prefix_comm) + { + print ''; + print $soc->prefix_comm; + } + else + { + print ''; + } + print ''; + } // Prospect/Customer print ''.$langs->trans('ProspectCustomer').'