From 9013dd7372126a9807be64832a9563cab67c0212 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 21 Oct 2003 11:44:01 +0000 Subject: [PATCH] Demande de confirmation pour la suppression et la validation --- htdocs/compta/facture.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4c1d11ccf83..26601ac22da 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -163,7 +163,7 @@ if ($action == 'del_paiement' && $user->rights->facture->paiement) * */ -if ($action == 'valid' && $user->rights->facture->valider) +if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] == yes && $user->rights->facture->valider) { $fac = new Facture($db); $fac->fetch($facid); @@ -200,7 +200,7 @@ if ($action == 'addligne' && $user->rights->facture->creer) $HTTP_POST_VARS["pu"], $HTTP_POST_VARS["qty"], $HTTP_POST_VARS["tva_tx"], - "NULL", + 0, $HTTP_POST_VARS["remise_percent"]); } @@ -222,11 +222,14 @@ if ($action == 'deleteline' && $user->rights->facture->creer) $result = $fac->deleteline($rowid); } -if ($action == 'delete' && $user->rights->facture->supprimer) +if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) { - $fac = new Facture($db); - $fac->delete($facid); - $facid = 0 ; + if ($user->rights->facture->supprimer ) + { + $fac = new Facture($db); + $fac->delete($facid); + $facid = 0 ; + } } /* @@ -576,7 +579,26 @@ else $author->fetch(); print_titre("Facture : ".$fac->ref); + + /* + * Confirmation de la suppression de la facture + * + */ + if ($action == 'delete') + { + $html->form_confirm("$PHP_SELF?facid=$facid","Supprimer la facture","Etes-vous sûr de vouloir supprimer cette facture ?","confirm_delete"); + } + /* + * Confirmation de la validation + * + */ + if ($action == 'valid') + { + $numfa = facture_get_num($soc); + $html->form_confirm("$PHP_SELF?facid=$facid","Valider la facture","Etes-vous sûr de vouloir valider cette facture avec le numéro $numfa ?","confirm_valid"); + } + /* * Facture */