From 1779f59b08fbfc8bfca7572360e87c22b6551783 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Jan 2011 16:57:24 +0000 Subject: [PATCH] Fix: Missing test if module supplier is on --- htdocs/lib/company.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 5a54e89253a..e9c9388ca10 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -44,7 +44,8 @@ function societe_prepare_head($object) $head[$h][2] = 'card'; $h++; - if ($object->client==2 || $object->client==3 || $object->object->client==2 || $object->object->client==3) + // TODO Remove tests on object->object. Functions must be called with a company object directly + if (($object->client==2 || $object->client==3 || $object->object->client==2 || $object->object->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$object->id; $head[$h][1] = $langs->trans("Prospect"); @@ -58,7 +59,7 @@ function societe_prepare_head($object) $head[$h][2] = 'customer'; $h++; } - if ($object->fournisseur || $object->object->fournisseur) + if ($conf->fournisseur->enabled && ($object->fournisseur || $object->object->fournisseur)) { $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$object->id; $head[$h][1] = $langs->trans("Supplier");