From 59fa5c2fe69d42ac84d545068c4b2ea2ae88590f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Apr 2017 17:38:59 +0200 Subject: [PATCH] FIX #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it Close #6680 --- htdocs/fourn/facture/card.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2a1f1dab8bc..ebe198613c2 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2135,13 +2135,17 @@ else // Reopen a standard paid invoice if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) { - if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice + if (! $facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice { print ''.$langs->trans('ReOpen').''; } else { - print ''.$langs->trans('ReOpen').''; + if ($user->rights->fournisseur->facture->creer) { + print ''.$langs->trans('ReOpen').''; + } elseif (!$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) { + print ''.$langs->trans('ReOpen').''; + } } }