diff --git a/formidable_fonctions.php b/formidable_fonctions.php index 00a637fc42b99f9e9480739c0e7516d5bd10950a..0fa361059c444ea0e3cb39ebf3a33148ea7a6cd5 100644 --- a/formidable_fonctions.php +++ b/formidable_fonctions.php @@ -273,3 +273,18 @@ function formidable_ajouter_action_recuperer_fichier($saisie_a_modifier, $nom_sa function generer_titre_formulaires_reponse(int $id_formulaires_reponse, $champs): string { return affiche_resume_reponse($id_formulaires_reponse); } + +/** + * Afficher le status en clair si pas dans la liste $not_in + * @param string $statut + * @param array $not_in + * @return string + */ +function formidable_afficher_statut_si_different_de($statut,$not_in = array()) { + if (!in_array($statut, $not_in)) { + include_spip('inc/puce_statut'); + return statut_titre('formidable', $statut); + } + + return ''; +} diff --git a/modeles/form.html b/modeles/form.html index 40bb5a3f14395e7c1fb5233fb4afdfe2b8a82e1e..fa4d8bf751b4f7057c7556592cb400109bf05f1a 100644 --- a/modeles/form.html +++ b/modeles/form.html @@ -1,6 +1,6 @@ [(#REM|test_espace_prive|oui) -<BOUCLE_f(FORMULAIRES){identifiant=form#ENV{id,#ENV{id_form}}}{statut==.*}{0,1}>[(#STATUT|=={publie}|non) -<div class="msg-alert info"><:formidable:changer_statut:> [(#VAL{formidable}|statut_titre{#STATUT})]</div> +<BOUCLE_f(FORMULAIRES){identifiant=form#ENV{id,#ENV{id_form}}}{statut==.*}{0,1}>[ +<div class="msg-alert info"><:formidable:changer_statut:> (#STATUT|formidable_afficher_statut_si_different_de{#LISTE{publie}})</div> ]#FORMULAIRE_FORMIDABLE{#ID_FORMULAIRE} </BOUCLE_f> ][(#REM|test_espace_prive|non) diff --git a/modeles/formidable.html b/modeles/formidable.html index 6aed7b217bc81645c0be62130e0ee2cbea0aa862..37266c97c94a78755795792e3322f47ef40ed704 100644 --- a/modeles/formidable.html +++ b/modeles/formidable.html @@ -1,6 +1,6 @@ [(#REM|test_espace_prive|oui) -<BOUCLE_f(FORMULAIRES){id_formulaire=#ID}{statut==.*}{0,1}>[(#STATUT|=={publie}|non) -<div class="msg-alert info"><:formidable:changer_statut:> [(#VAL{formidable}|statut_titre{#STATUT})]</div> +<BOUCLE_f(FORMULAIRES){id_formulaire=#ID}{statut==.*}{0,1}>[ +<div class="msg-alert info"><:formidable:changer_statut:> (#STATUT|formidable_afficher_statut_si_different_de{#LISTE{publie}})</div> ]#FORMULAIRE_FORMIDABLE{#ID_FORMULAIRE} </BOUCLE_f> ][(#REM|test_espace_prive|non)