From d11d5c780de4b287194196fce30a3a12ddb3b51f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Wed, 23 May 2007 22:39:14 +0000 Subject: [PATCH] Meilleure gestion erreur --- htdocs/compta/paiement/fiche.php | 7 ++++++- htdocs/fourn/facture/paiement.php | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 33f22e8aaa1..85e0436e5d0 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -110,7 +110,12 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user- llxHeader(); $paiement = new Paiement($db); -$paiement->fetch($_GET['id']); +$result=$paiement->fetch($_GET['id']); +if ($result <= 0) +{ + dolibarr_print_error($db,'Payement '.$_GET['id'].' not found in database'); + exit; +} $html = new Form($db); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 22ba0e56357..7aac6e0a01c 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -164,6 +164,7 @@ if ($action == 'add_paiement') } else { + $fiche_erreur_message = '<div class="error">'.$langs->trans("Error").'</div>'; $error++; } -- GitLab