Try hidden feature SOCIETE_PROSPECTANDCUSTOMER

This commit is contained in:
Laurent Destailleur 2009-12-15 22:13:43 +00:00
parent 1a24cfc603
commit 680472c095
3 changed files with 15 additions and 13 deletions

View File

@ -43,14 +43,14 @@ function societe_prepare_head($objsoc)
$head[$h][2] = 'company';
$h++;
if ($objsoc->client==1)
if ($objsoc->client==1 || $objsoc->client==3)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Customer");;
$head[$h][2] = 'customer';
$h++;
}
if ($objsoc->client==2)
if ($objsoc->client==2 || $objsoc->client==3)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Prospect");

View File

@ -345,10 +345,7 @@ function dol_fiche_head($links, $active='0', $title='', $notab=0, $picto='')
$limittitle=30;
print '<a class="tabTitle">';
if ($picto) print img_object('',$picto).' ';
print
((!defined('MAIN_USE_SHORT_TITLE')) || (defined('MAIN_USE_SHORT_TITLE') && MAIN_USE_SHORT_TITLE))
? dol_trunc($title,$limittitle)
: $title;
print dol_trunc($title,$limittitle);
print '</a>';
}
@ -990,14 +987,14 @@ function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='')
* \param trunc Where to trunc: right, left, middle
* \param stringencoding Tell what is source string encoding
* \return string Truncated string
* \remarks USE_SHORT_TITLE=0 can disable all truncings
* \remarks MAIN_DISABLE_TRUNC=1 can disable all truncings
*/
function dol_trunc($string,$size=40,$trunc='right',$stringencoding='')
{
global $conf;
if ($size==0) return $string;
if (! defined('USE_SHORT_TITLE') || USE_SHORT_TITLE)
if (empty($conf->global->MAIN_DISABLE_TRUNC))
{
// We go always here
if ($trunc == 'right')

View File

@ -308,9 +308,10 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create')
/*
* Fiche societe en mode creation
*/
if ($_GET["type"]=='f') { $soc->fournisseur=1; }
if ($_GET["type"]=='c') { $soc->client=1; }
if ($_GET["type"]=='p') { $soc->client=2; }
if ($_GET["type"]=='f') { $soc->fournisseur=1; }
if ($_GET["type"]=='c') { $soc->client=1; }
if ($_GET["type"]=='p') { $soc->client=2; }
if ($_GET["type"]=='cp') { $soc->client=3; }
if ($_REQUEST["private"]==1) { $soc->particulier=1; }
$soc->nom=$_POST["nom"];
@ -407,9 +408,10 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create')
print '<td>'.$langs->trans('Prefix').'</td><td><input type="text" size="5" maxlength="5" name="prefix_comm" value="'.$soc->prefix_comm.'"></td></tr>';
}
// Client / Prospect
// Prospect/Customer
print '<tr><td width="25%">'.$langs->trans('ProspectCustomer').'</td><td width="25%"><select class="flat" name="client">';
print '<option value="2"'.($soc->client==2?' selected="true"':'').'>'.$langs->trans('Prospect').'</option>';
if ($conf->global->SOCIETE_PROSPECTANDCUSTOMER) print '<option value="3"'.($soc->client==3?' selected="true"':'').'>'.$langs->trans('ProspectAndCustomer').'</option>';
print '<option value="1"'.($soc->client==1?' selected="true"':'').'>'.$langs->trans('Customer').'</option>';
print '<option value="0"'.($soc->client==0?' selected="true"':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
print '</select></td>';
@ -719,8 +721,10 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
print '<table class="border" width="100%">';
// Name
print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="nom" value="'.$soc->nom.'"></td></tr>';
// Prefix
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
// On ne permet pas la modification du prefix en mode de numerotation auto utilisant le prefix
if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $soc->prefix_comm)
@ -734,9 +738,10 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
}
print '</td>';
// Client / Prospect
// Prospect/Customer
print '<tr><td width="25%">'.$langs->trans('ProspectCustomer').'</td><td width="25%"><select class="flat" name="client">';
print '<option value="2"'.($soc->client==2?' selected="true"':'').'>'.$langs->trans('Prospect').'</option>';
if ($conf->global->SOCIETE_PROSPECTANDCUSTOMER) print '<option value="3"'.($soc->client==3?' selected="true"':'').'>'.$langs->trans('ProspectAndCustomer').'</option>';
print '<option value="1"'.($soc->client==1?' selected="true"':'').'>'.$langs->trans('Customer').'</option>';
print '<option value="0"'.($soc->client==0?' selected="true"':'').'>'.$langs->trans('NorProspectNorCustomer').'</option>';
print '</select></td>';