From 9a2f21b82c4b9f36996e04ebadc030c26e4a7f34 Mon Sep 17 00:00:00 2001 From: tofulm Date: Sun, 26 Apr 2020 00:39:52 +0200 Subject: [PATCH] Ajout champ obligatoire, attention de bien initialiser un #SET en dehors de la boucle --- formulaires/gamumail.html | 12 ++++++------ formulaires/gamumail.php | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/formulaires/gamumail.html b/formulaires/gamumail.html index a6ffe4a..08bae69 100644 --- a/formulaires/gamumail.html +++ b/formulaires/gamumail.html @@ -13,7 +13,7 @@
[(#GET{erreurs})] - +
@@ -47,7 +47,7 @@
[(#GET{erreurs})] - +
@@ -58,20 +58,20 @@
[(#GET{erreurs})] - +
+ #SET{name,Tpdfs_ok}

Fichiers PDF envoyés

- #SET{name,Tpdfs_ok} #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} #SET{obli,"obligatoire"}
- +
@@ -80,11 +80,11 @@ #SET{id_gamumail,0} + #SET{name,Tid_doc} #SET{id_gamumail,#ID_GAMUMAIL}

Autres Fichiers attachés

- #SET{name,Tid_doc} #SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}} #SET{obli,"obligatoire"}
diff --git a/formulaires/gamumail.php b/formulaires/gamumail.php index b671c91..661a515 100644 --- a/formulaires/gamumail.php +++ b/formulaires/gamumail.php @@ -71,9 +71,9 @@ function formulaires_gamumail_verifier_dist($slug, $auteur = 0, $Tclient = [], $ $erreurs = array(); //champs obligatoire - //foreach (array ('') as $obligatoire) { - //if (!_request($obligatoire)) $erreurs[$obligatoire] = 'Ce champs est obligatoire'; - //} + foreach (array ('pour', 'sujet', 'texte') as $obligatoire) { + if (!_request($obligatoire)) $erreurs[$obligatoire] = 'Ce champs est obligatoire'; + } ////autres erreurs //$erreurs[''] = "Ce champ ne convient pas.";