Fix bad condition to show tabs

This commit is contained in:
Laurent Destailleur 2016-01-07 00:05:28 +01:00
parent d6c5a73264
commit 2945d2d171

View File

@ -45,21 +45,27 @@ function product_prepare_head($object)
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
$head[$h][1] = $langs->trans("SellingPrices");
$head[$h][2] = 'price';
$h++;
if ((! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
|| (! empty($conf->margin->enabled) && $user->rights->margin->liretous)
)
if (! empty($object->status))
{
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
$head[$h][1] = $langs->trans("BuyingPrices");
$head[$h][2] = 'suppliers';
$h++;
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
$head[$h][1] = $langs->trans("SellingPrices");
$head[$h][2] = 'price';
$h++;
}
if (! empty($object->status_buy) || (! empty($conf->margin->enabled) && ! empty($object->status))) // If margin is on and product on sell, we may need the cost price even if product os not on purchase
{
if ((! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
|| (! empty($conf->margin->enabled) && $user->rights->margin->liretous)
)
{
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
$head[$h][1] = $langs->trans("BuyingPrices");
$head[$h][2] = 'suppliers';
$h++;
}
}
// Show category tab
/* No more required. Replaced with new multiselect component
if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire)