Fix: Hide supplier info if permission to read suppliers not on
This commit is contained in:
parent
33b0ea80e9
commit
c517ae071d
@ -59,7 +59,7 @@ function societe_prepare_head($object)
|
||||
$head[$h][2] = 'customer';
|
||||
$h++;
|
||||
}
|
||||
if (! empty($conf->fournisseur->enabled) && ($object->fournisseur || (isset($object->object) && $object->object->fournisseur)))
|
||||
if (! empty($conf->fournisseur->enabled) && ($object->fournisseur || (isset($object->object) && $object->object->fournisseur)) && ! empty($user->rights->fournisseur->lire))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Supplier");
|
||||
|
||||
@ -208,10 +208,10 @@ if ($_GET["id"] || $_GET["ref"])
|
||||
{
|
||||
if (! $graphfiles[$key]['file']) continue;
|
||||
|
||||
if ($graphfiles == 'propal' && ! $user->right->propale->lire) continue;
|
||||
if ($graphfiles == 'order' && ! $user->right->commande->lire) continue;
|
||||
if ($graphfiles == 'invoices' && ! $user->right->facture->lire) continue;
|
||||
if ($graphfiles == 'invoices_suppliers' && ! $user->right->fournisseur->facture->lire) continue;
|
||||
if ($graphfiles == 'propal' && ! $user->rights->propale->lire) continue;
|
||||
if ($graphfiles == 'order' && ! $user->rights->commande->lire) continue;
|
||||
if ($graphfiles == 'invoices' && ! $user->rights->facture->lire) continue;
|
||||
if ($graphfiles == 'invoices_suppliers' && ! $user->rights->fournisseur->facture->lire) continue;
|
||||
|
||||
|
||||
if ($i % 2 == 0) print '<tr>';
|
||||
|
||||
@ -795,7 +795,7 @@ else
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
if ($conf->fournisseur->enabled)
|
||||
if ($conf->fournisseur->enabled && ! empty($user->rights->fournisseur->lire))
|
||||
{
|
||||
// Supplier
|
||||
print '<tr>';
|
||||
@ -1223,7 +1223,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Supplier
|
||||
if ($conf->fournisseur->enabled)
|
||||
if ($conf->fournisseur->enabled && ! empty($user->rights->fournisseur->lire))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>';
|
||||
@ -1566,7 +1566,7 @@ else
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if ($conf->fournisseur->enabled && $object->fournisseur)
|
||||
if ($conf->fournisseur->enabled && $object->fournisseur && ! empty($user->rights->fournisseur->lire))
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $langs->trans('SupplierCode').'</td><td colspan="'.(2+($object->logo?0:1)).'">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user