From e222701adf08a1166006474a59f6ad9a83fa8221 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 11 Apr 2005 08:21:44 +0000 Subject: [PATCH] Ajout confirmation de la validation --- htdocs/fourn/facture/fiche.php | 36 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 0cda3774f04..00353678624 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -49,15 +49,17 @@ $html = new Form($db); $mesg=''; $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; - -if ($_GET["action"] == 'valid') +if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == yes && $user->rights->fournisseur->facture->valider) { $facturefourn=new FactureFournisseur($db); $facturefourn->fetch($_GET["facid"]); $facturefourn->set_valid($user->id); + + Header("Location: fiche.php?facid=".$_GET["facid"]); } + if ($_GET["action"] == 'payed') { $facturefourn=new FactureFournisseur($db); @@ -410,6 +412,17 @@ else dolibarr_fiche_head($head, $hselected); + + /* + * Confirmation de la validation + * + */ + if ($_GET["action"] == 'valid') + { + $html->form_confirm("fiche.php?facid=$fac->id","Valider la facture","Etes-vous sūr de vouloir valider cette facture ?","confirm_valid"); + print '
'; + } + print ""; print '
'; /* @@ -578,17 +591,16 @@ else print "id&action=payed\">".$langs->trans('ClassifyPayed').""; } - if ($user->societe_id == 0) + if ($fac->statut == 0 && $user->rights->fournisseur->facture->valider) { - if ($fac->statut == 0) - { - if ($_GET["action"] <> "edit") - print "id&action=valid\">".$langs->trans('Valid').""; - } - else - { - print "id&action=copy&socid=$fac->socidp\">".$langs->trans('Copy').""; - } + if ($_GET["action"] <> "edit") + print "id&action=valid\">".$langs->trans('Valid').""; + } + else + + if ($user->rights->fournisseur->facture->creer) + { + print "id&action=copy&socid=$fac->socidp\">".$langs->trans('Copy').""; } if ($fac->statut == 0 && $user->societe_id == 0)