Merge pull request #12204 from dolibarr95/patch-57
NEW: Reduce the $companystatic calls
This commit is contained in:
commit
3aed55caa6
@ -769,6 +769,7 @@ if ($resql)
|
|||||||
$total=0;
|
$total=0;
|
||||||
$subtotal=0;
|
$subtotal=0;
|
||||||
$productstat_cache=array();
|
$productstat_cache=array();
|
||||||
|
$getNomUrl_cache=array();
|
||||||
|
|
||||||
$generic_commande = new Commande($db);
|
$generic_commande = new Commande($db);
|
||||||
$generic_product = new Product($db);
|
$generic_product = new Product($db);
|
||||||
@ -785,11 +786,14 @@ if ($resql)
|
|||||||
$text_warning='';
|
$text_warning='';
|
||||||
$nbprod=0;
|
$nbprod=0;
|
||||||
|
|
||||||
$companystatic->id=$obj->socid;
|
$companystatic->id = $obj->socid;
|
||||||
$companystatic->code_client = $obj->code_client;
|
$companystatic->code_client = $obj->code_client;
|
||||||
$companystatic->name=$obj->name;
|
$companystatic->name = $obj->name;
|
||||||
$companystatic->client=$obj->client;
|
$companystatic->client = $obj->client;
|
||||||
$companystatic->email=$obj->email;
|
$companystatic->email = $obj->email;
|
||||||
|
if (!isset($getNomUrl_cache[$obj->socid])) {
|
||||||
|
$getNomUrl_cache[$obj->socid] = $companystatic->getNomUrl(1, 'customer');
|
||||||
|
}
|
||||||
|
|
||||||
$generic_commande->id=$obj->rowid;
|
$generic_commande->id=$obj->rowid;
|
||||||
$generic_commande->ref=$obj->ref;
|
$generic_commande->ref=$obj->ref;
|
||||||
@ -974,7 +978,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['s.nom']['checked']))
|
if (! empty($arrayfields['s.nom']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="tdoverflowmax200">';
|
print '<td class="tdoverflowmax200">';
|
||||||
print $companystatic->getNomUrl(1, 'customer');
|
print $getNomUrl_cache[$obj->socid];
|
||||||
|
|
||||||
// If module invoices enabled and user with invoice creation permissions
|
// If module invoices enabled and user with invoice creation permissions
|
||||||
if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
|
if (! empty($conf->facture->enabled) && ! empty($conf->global->ORDER_BILLING_ALL_CUSTOMER))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user