From c133f0fde8a06cc7c9613e05ccaf3dd2445d83c3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 30 May 2006 09:04:07 +0000 Subject: [PATCH] Ajout confirmation de suppression --- htdocs/fourn/facture/fiche.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index ca2f681814f..66316dd0440 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -60,6 +60,17 @@ if ($_POST['action'] == 'confirm_valid' && $_POST['confirm'] == 'yes' && $user-> exit; } +if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes') +{ + if ($user->rights->fournisseur->facture->supprimer ) + { + $facturefourn = new FactureFournisseur($db); + $factfournid = $_GET['facid']; + $facturefourn->delete($factfournid); + Header('Location: index.php'); + exit; + } +} if ($_GET['action'] == 'payed') { @@ -359,6 +370,15 @@ else llxHeader('','', $addons); if ($mesg) { print $mesg.'
'; } + + /* + * Confirmation de la suppression de la facture fournisseur + */ + if ($_GET['action'] == 'delete') + { + $html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete'); + print '
'; + } if ($_GET['action'] == 'edit') { @@ -707,7 +727,7 @@ else print ''.$langs->trans('Copy').''; } - if ($_GET['action'] != 'edit' && $fac->statut == 0 && $user->rights->fournisseur->facture->creer) + if ($_GET['action'] != 'edit' && $fac->statut == 0 && $user->rights->fournisseur->facture->supprimer) { print ''.$langs->trans('Delete').''; }