diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 7458c80cad6..b5ea56f6c22 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -83,14 +83,14 @@ $sql.= " WHERE s.entity = ".$conf->entity; $result = $db->query($sql); if ($result) { - while ($objp = $db->fetch_object($result)) - { - if ($objp->client == 1 || $objp->client == 3) $third['customer']++; - if ($objp->client == 2 || $objp->client == 3) $third['prospect']++; - if ($objp->fournisseur) $third['supplier']++; + while ($objp = $db->fetch_object($result)) + { + if ($objp->client == 1 || $objp->client == 3) $third['customer']++; + if ($objp->client == 2 || $objp->client == 3) $third['prospect']++; + if ($objp->fournisseur) $third['supplier']++; - $total++; - } + $total++; + } } else dol_print_error($db); @@ -98,18 +98,21 @@ print ''; print ''; if ($conf->societe->enabled) { - $statProducts = ""; - $statProducts.= ''; - $statProducts.= ""; - $statProducts.= ""; - $statProducts.= ''; - $statProducts.= ""; + if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + $statProducts = ""; + $statProducts.= ''; + $statProducts.= ""; + } + $statProducts.= ""; + $statProducts.= ''; + $statProducts.= ""; } if ($conf->fournisseur->enabled) { - $statServices = ""; - $statServices.= ''; - $statServices.= ""; + $statServices = ""; + $statServices.= ''; + $statServices.= ""; } print $statProducts; print $statServices; @@ -139,71 +142,71 @@ $sql.= $db->plimit($max,0); $result = $db->query($sql) ; if ($result) { - $num = $db->num_rows($result); + $num = $db->num_rows($result); - $i = 0; + $i = 0; - if ($num > 0) - { - $transRecordedType = $langs->trans("LastModifiedThirdParties",$max); + if ($num > 0) + { + $transRecordedType = $langs->trans("LastModifiedThirdParties",$max); - print '
'.$langs->trans("Statistics").'
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'; + print '
'; - print ''; + print ''; - $var=True; + $var=True; - while ($i < $num) - { - $objp = $db->fetch_object($result); + while ($i < $num) + { + $objp = $db->fetch_object($result); - $var=!$var; - print ""; - // Name - print '\n"; - // Type - print ''; - // Last modified date - print '"; -// print '"; - print "\n"; - $i++; - } + $var=!$var; + print ""; + // Name + print '\n"; + // Type + print ''; + // Last modified date + print '"; + // print '"; + print "\n"; + $i++; + } - $db->free(); + $db->free(); - print "
'.$transRecordedType.'
'.$transRecordedType.'
'; - $thirdparty_static->id=$objp->rowid; - $thirdparty_static->nom=$objp->nom; - $thirdparty_static->client=$objp->client; - $thirdparty_static->fournisseur=$objp->fournisseur; - $thirdparty_static->datem=$db->jdate($objp->datem); - print $thirdparty_static->getNomUrl(1,'',16); - print "'; - if ($thirdparty_static->client==1 || $thirdparty_static->client==3) - { - print "id."\">".$langs->trans("Customer")."\n"; - } - if ($thirdparty_static->client == 3) print " / "; - if ($thirdparty_static->client==2 || $thirdparty_static->client==3) - { - print "id."\">".$langs->trans("Prospect")."\n"; - } - if ($thirdparty_static->fournisseur) - { - if ($thirdparty_static->client) print " / "; - print ''.$langs->trans("Supplier").''; - } - print ''; - print dol_print_date($thirdparty_static->datem,'day'); - print "'; -// print $product_static->LibStatut($objp->tobuy,5,1); -// print "
'; + $thirdparty_static->id=$objp->rowid; + $thirdparty_static->nom=$objp->nom; + $thirdparty_static->client=$objp->client; + $thirdparty_static->fournisseur=$objp->fournisseur; + $thirdparty_static->datem=$db->jdate($objp->datem); + print $thirdparty_static->getNomUrl(1,'',16); + print "'; + if ($thirdparty_static->client==1 || $thirdparty_static->client==3) + { + print "id."\">".$langs->trans("Customer")."\n"; + } + if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / "; + if (($thirdparty_static->client==2 || $thirdparty_static->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + print "id."\">".$langs->trans("Prospect")."\n"; + } + if ($conf->fournisseur->enabled && $thirdparty_static->fournisseur) + { + if ($thirdparty_static->client) print " / "; + print ''.$langs->trans("Supplier").''; + } + print ''; + print dol_print_date($thirdparty_static->datem,'day'); + print "'; + // print $product_static->LibStatut($objp->tobuy,5,1); + // print "
"; - } + print ""; + } } else { - dol_print_error($db); + dol_print_error($db); } print ''; diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 1eac9d3312e..6b53836c563 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -325,12 +325,12 @@ if ($resql) { print "rowid."\">".$langs->trans("Customer")."\n"; } - if ($obj->client == 3) print " / "; - if ($obj->client==2 || $obj->client==3) + if ($obj->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / "; + if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { print "rowid."\">".$langs->trans("Prospect")."\n"; } - if ($obj->fournisseur) + if ($conf->fournisseur->enabled && $obj->fournisseur) { if ($obj->client) print " / "; print ''.$langs->trans("Supplier").'';