From f201e31b938c909ef1074563a60bcf3c7dde86d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Fri, 22 Oct 2010 17:52:02 +0000 Subject: [PATCH] Fix: Show grey button if not allowed --- htdocs/fourn/facture/fiche.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index b9fb99830cc..0d1dc33b997 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1283,12 +1283,20 @@ else //print '<a class="butAction" href="fiche.php?facid='.$fac->id.'&action=paid">'.$langs->trans('ClassifyPaid').'</a>'; } - if ($_GET['action'] != 'edit' && $fac->statut == 0 && $user->rights->fournisseur->facture->valider) + if ($_GET['action'] != 'edit' && $fac->statut == 0) { if (sizeof($fac->lignes)) { - print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&action=valid"'; - print '>'.$langs->trans('Validate').'</a>'; + if ($user->rights->fournisseur->facture->valider) + { + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&action=valid"'; + print '>'.$langs->trans('Validate').'</a>'; + } + else + { + print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"'; + print '>'.$langs->trans('Validate').'</a>'; + } } } -- GitLab