diff --git a/paquet.xml b/paquet.xml index d673b07bb6164b9905d6c7ec3138a9e9bcdbedb2..fd52994ca12b3405c81046a53c45fa9e465800a7 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@ <paquet prefix="formidable" categorie="communication" - version="3.22.4" + version="3.23.0" etat="stable" compatibilite="[3.0.0;3.2.*]" logo="images/formidable-64.png" diff --git a/saisies/champ.html b/saisies/champ.html index 324e1573911c9168307daa28d669f70083b29eab..75991a3d23dec872964c764ca833eb606e810e41 100644 --- a/saisies/champ.html +++ b/saisies/champ.html @@ -1,44 +1,26 @@ -[(#ENV{multiple}|?{ - #SET{nom,#ENV{nom}\[\]}, - #SET{nom,#ENV{nom}} - } -)] -<select name="#GET{nom}" id="champ_#ENV{nom}"[ (#ENV{multiple}|oui)multiple="multiple"]> - <option value=""><:formidable:traitements_champ_aucun:></option> +[(#ENV{type_choix}|=={checkbox}|?{ + #SET{data,#ARRAY}, + #SET{data,#ARRAY{'',#VAL{formidable:traitements_champ_aucun}|_T}} +})] + [(#ENV{forcer_type}|non) #SET{tab,#ENV{formulaire}} ] [(#ENV{forcer_type}|oui) [(#SET{tab,[(#ENV{formulaire}|saisies_lister_par_nom{0})]})] ] - #SET{padding,0} <BOUCLE_parcours(POUR){tableau #GET{tab}}> - #SET{saisie,#VALEUR} - <BOUCLE_test_enfants(CONDITION){si #GET{saisie}|table_valeur{saisies}|is_array}> - <optgroup style="padding-left:#GET{padding}px" label="[(#GET{saisie}|table_valeur{options}|table_valeur{label}|sinon{#GET{saisie}|table_valeur{options}|table_valeur{nom}})]"> - #SET{tab,#GET{saisie}|table_valeur{saisies}} - #SET{padding,#GET{padding}|plus{20}} - <BOUCLE_parcours_recursif(BOUCLE_parcours)/> - #SET{padding,#GET{padding}|moins{20}} - </optgroup> - </BOUCLE_test_enfants> - <BOUCLE_test_type(CONDITION){si #ENV{forcer_type}|non|ou{#GET{saisie}|table_valeur{saisie}|in_array{#ENV{forcer_type}}}}> - #SET{saisie_currente_nom,#GET{saisie}|table_valeur{options}|table_valeur{nom}} - #SET{selected,''} - [(#ENV{multiple}|oui) - [(#GET{saisie_currente_nom}|in_array{#ENV{valeur,#ENV{saisie_a_positionner,#ARRAY{}}}}|oui) - #SET{selected,'selected="selected"'} - )] - ] - [(#ENV{multiple}|non) - [(#GET{saisie_currente_nom}|=={#ENV{valeur,#ENV{saisie_a_positionner}}}|oui) - #SET{selected,'selected="selected"'} - )] - ] - <option value="[(#GET{saisie}|table_valeur{options}|table_valeur{nom})]" style="padding-left:#GET{padding}px" #GET{selected}> - [(#GET{saisie}|table_valeur{options}|table_valeur{label}|sinon{#GET{saisie}|table_valeur{options}|table_valeur{nom}})] - </option> - </BOUCLE_test_type> - <//B_test_enfants> + #SET{enfants,#ARRAY} + <BOUCLE_enfants(POUR){tableau #VALEUR|table_valeur{'saisies'}}> + #SET{enfant,#ARRAY{#VALEUR|table_valeur{options}|table_valeur{nom},#VALEUR|table_valeur{options}|table_valeur{label}}} + #SET{enfants,#GET{enfants}|array_merge{#GET{enfant}}} + </BOUCLE_enfants> + #SET{saisie,#ARRAY{#VALEUR|table_valeur{options}|table_valeur{label},#GET{enfants}} + </B_enfants> + #SET{saisie,#ARRAY{#VALEUR|table_valeur{options}|table_valeur{nom},#VALEUR|table_valeur{options}|table_valeur{label}}} + <//B_enfants> + #SET{data,#GET{data}|array_merge{#GET{saisie}}} </BOUCLE_parcours> </select> + +#INCLURE{fond=saisies/#ENV{type_choix,selection},data=#GET{data},env,cacher_option_intro='oui',defaut=''}