Commit 3d5e7d1b authored by Matthieu FAURE's avatar Matthieu FAURE

Merge branch...

Merge branch '9-formulaire-adhesion-ne-pas-afficher-le-cadre-chorus-pro-pour-les-asso' into 'master'

Resolve "Formulaire adhésion: ne pas afficher le cadre Chorus Pro pour les asso"

Closes #9

See merge request !4
parents 40edf3ab 53994384
//liste des blocs qui peuvent être affichés / cachés
var blocks = ["link", "paraSecondSelection", "cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer"];
var blocks = ["link", "paraSecondSelection", "cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer","chorus_pro"];
var maxCotisation = 12000;
......@@ -59,14 +59,17 @@ function firstAction() {
else if (strUser === "Association") {
setCotisation("Association");
displayMask(["cotisation", "informationsCollectivite", "boutonEnvoyer"]);
document.getElementById("secondSelection").required = false;
setEPCIRequired(false);
setChorusProRequired(false);
} else if (strUser === "EPCIMutualisant") {
//formulaire contenant la formule spécifique à EPCI mutualisant
displayMask(["formulaireEPCIMutualisant"]);
setEPCIRequired(true);
setChorusProRequired(true);
} else if (strUser === "none") {
//premier choix avec des tirets
......@@ -80,6 +83,7 @@ function firstAction() {
displayMask(["paraSecondSelection"]);
setEPCIRequired(false);
setChorusProRequired(true);
}
}
......@@ -166,7 +170,7 @@ function secondAction() {
setCotisation(selectedTranch);
displayMask(["paraSecondSelection", "cotisation", "informationsCollectivite", "boutonEnvoyer"]);
displayMask(["paraSecondSelection", "cotisation", "informationsCollectivite", "boutonEnvoyer","chorus_pro"]);
} else {
displayMask(["paraSecondSelection"]);
}
......@@ -196,6 +200,12 @@ function setCotisation(id, x = 0) {
}
}
function setChorusProRequired(boolean){
document.getElementById("siretCollectivite").required = boolean;
document.getElementById("numeroEngagementCollectivite").required = boolean;
document.getElementById("codeCollectivite").required = boolean;
}
function setEPCIRequired(boolean) {
//le formulaire EPCI est il requis ? cela varie selon les choix faits par l'utilisateur
document.getElementById("nombreHabitantsEPCI").required = boolean;
......@@ -221,12 +231,12 @@ function traitementEPCIMutualisant() {
if (resultat > maxCotisation) {
//valeur fixée en haut du document
//valeur fixée en haut du code
resultat = maxCotisation;
}
setCotisation("EPCIMutualisant", resultat);
displayMask(["cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer"]);
displayMask(["cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer","chorus_pro"]);
}
}
}
......
......@@ -404,13 +404,13 @@ get_header();
<?php tryToShowError("ville"); ?>
<label for="telCollectivite">Téléphone :</label>
<input type="tel" name="telCollectivite" id="telCollectivite" required=""
<input type="tel" name="telCollectivite" id="telCollectivite"
value="<?php tryToEcho("telCollectivite"); ?>"><br>
<?php tryToShowError("tel"); ?>
<label for="siteCollectivite">Site internet :</label>
<input type="url" name="siteCollectivite" id="siteCollectivite" required=""
<input type="url" name="siteCollectivite" id="siteCollectivite"
value="<?php tryToEcho("siteCollectivite"); ?>"><br>
<?php tryToShowError("site"); ?>
......@@ -420,6 +420,9 @@ get_header();
<?php generateDates(); ?>
</select>
</div>
<div id="chorus_pro">
<h3>Informations relatives à Chorus Pro</h3>
......
......@@ -21,8 +21,8 @@ function childrens_of_member_category($category)
foreach ($childrens as $c) {
$temp_category = get_category($c); //objet contenant les infos de la catégorie enfant
$my_link = "<a href=\"?cat=";
$my_link .= $c ;
$my_link = "<a href=\"?cat=";
$my_link .= $c;
$my_link .= "\" class=\"adullact-sort-button";
if ($temp_category->name == $category) {
......@@ -30,10 +30,10 @@ function childrens_of_member_category($category)
$my_link .= " adullact-selected";
}
$my_link .="\">";
$my_link .= "\">";
$my_link .= $temp_category->name;
$my_link.="</a>";
$my_link .= "</a>";
echo $my_link;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment