Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Theme-WordPress-Adullact-org
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adullact
Theme-WordPress-Adullact-org
Commits
3d952fae
Commit
3d952fae
authored
Jul 04, 2019
by
Nathan Peraldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit: mask "chorus pro" block when "Association" selected
parent
40edf3ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
49 deletions
+69
-49
adhesionForm.js
adhesionForm.js
+14
-4
contact.php
contact.php
+13
-10
traitementAdhesion.php
traitementAdhesion.php
+42
-35
No files found.
adhesionForm.js
View file @
3d952fae
//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
"
]);
}
}
}
...
...
contact.php
View file @
3d952fae
...
...
@@ -383,58 +383,61 @@ get_header();
<div
id=
"informationsCollectivite"
>
<h3>
Informations obligatoires :
</h3>
<label
for=
"nomCollectivite"
>
Nom de la collectivité :
</label>
<label
for=
"nomCollectivite"
>
Nom de la collectivité
(obligatoire)
:
</label>
<input
type=
"text"
name=
"nomCollectivite"
id=
"nomCollectivite"
required=
""
value=
"
<?php
tryToEcho
(
"nomCollectivite"
);
?>
"
><br>
<?php
tryToShowError
(
"nom"
);
?>
<label
for=
"adresseCollectivite"
>
Adresse :
</label>
<label
for=
"adresseCollectivite"
>
Adresse
(obligatoire)
:
</label>
<input
type=
"text"
name=
"adresseCollectivite"
id=
"adresseCollectivite"
required=
""
value=
"
<?php
tryToEcho
(
"adresseCollectivite"
);
?>
"
><br>
<?php
tryToShowError
(
"adresse"
);
?>
<label
for=
"codePostalCollectivite"
>
Code postal :
</label>
<label
for=
"codePostalCollectivite"
>
Code postal
(obligatoire)
:
</label>
<input
type=
"text"
name=
"codePostalCollectivite"
id=
"codePostalCollectivite"
required=
""
value=
"
<?php
tryToEcho
(
"codePostalCollectivite"
);
?>
"
><br>
<?php
tryToShowError
(
"CP"
);
?>
<label
for=
"villeCollectivite"
>
Ville :
</label>
<label
for=
"villeCollectivite"
>
Ville
(obligatoire)
:
</label>
<input
type=
"text"
name=
"villeCollectivite"
id=
"villeCollectivite"
required=
""
value=
"
<?php
tryToEcho
(
"villeCollectivite"
);
?>
"
><br>
<?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"
);
?>
<label
for=
"periodeAdhesionCollectivite"
>
Période d'adhésion :
</label>
<label
for=
"periodeAdhesionCollectivite"
>
Période d'adhésion
(obligatoire)
:
</label>
<select
name=
"periodeAdhesionCollectivite"
id=
"periodeAdhesionCollectivite"
required=
""
>
<option
class=
"optionPeriod"
value=
""
selected
>
---
</option>
<?php
generateDates
();
?>
</select>
</div>
<div
id=
"chorus_pro"
>
<h3>
Informations relatives à Chorus Pro
</h3>
<label
for=
"siretCollectivite"
>
SIRET :
</label>
<label
for=
"siretCollectivite"
>
SIRET
(obligatoire)
:
</label>
<input
type=
"number"
name=
"siretCollectivite"
id=
"siretCollectivite"
required=
""
value=
"
<?php
tryToEcho
(
"siretCollectivite"
);
?>
"
><br>
<?php
tryToShowError
(
"siret"
);
?>
<label
for=
"numeroEngagementCollectivite"
>
N° d'engagement :
</label>
<label
for=
"numeroEngagementCollectivite"
>
N° d'engagement
(obligatoire)
:
</label>
<input
type=
"text"
name=
"numeroEngagementCollectivite"
id=
"numeroEngagementCollectivite"
required=
""
value=
"
<?php
tryToEcho
(
"numeroEngagementCollectivite"
);
?>
"
><br>
<?php
tryToShowError
(
"numeroEngagement"
);
?>
<label
for=
"codeCollectivite"
>
Code :
</label>
<label
for=
"codeCollectivite"
>
Code
(obligatoire)
:
</label>
<input
type=
"text"
name=
"codeCollectivite"
id=
"codeCollectivite"
required=
""
value=
"
<?php
tryToEcho
(
"codeCollectivite"
);
?>
"
><br>
<?php
tryToShowError
(
"code"
);
?>
...
...
traitementAdhesion.php
View file @
3d952fae
...
...
@@ -31,6 +31,7 @@ $errorInSiret = "Un numéro de SIRET est composé de 14 chiffres.";
$positiveNumberRequired
=
"Vous devez entrer un nombre positif."
;
$numberRequired
=
"Vous devez entrer un nombre."
;
$fieldRequired
=
"Vous devez compléter ce champ."
;
...
...
@@ -235,7 +236,7 @@ function verifEPCI($tab, $errors)
function
verifNom
(
$tab
)
{
//vérifie si le nom de la collectivité est correct
global
$maxNameCharacters
,
$tooLongName
;
global
$maxNameCharacters
,
$tooLongName
,
$fieldRequired
;
if
(
isset
(
$tab
[
"nomCollectivite"
]))
{
...
...
@@ -249,10 +250,10 @@ function verifNom($tab)
return
$tooLongName
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
return
"vide"
;
return
$fieldRequired
;
}
...
...
@@ -260,7 +261,7 @@ function verifNom($tab)
function
verifAdresse
(
$tab
)
{
//vérifie si l'adresse est correcte
global
$tooLongAddress
,
$maxAddressCharacters
;
global
$tooLongAddress
,
$maxAddressCharacters
,
$fieldRequired
;
if
(
isset
(
$tab
[
"adresseCollectivite"
]))
{
...
...
@@ -274,18 +275,18 @@ function verifAdresse($tab)
return
$tooLongAddress
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
function
verifCodePostal
(
$tab
)
{
//vérifie si le code postal a été correctement entré
global
$debug_mode_traitement
,
$postalCodeError
;
global
$debug_mode_traitement
,
$postalCodeError
,
$fieldRequired
;
if
(
isset
(
$tab
[
"codePostalCollectivite"
]))
{
...
...
@@ -304,17 +305,17 @@ function verifCodePostal($tab)
return
$postalCodeError
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
function
verifVille
(
$tab
)
{
//vérifie la ville
global
$maxCityCharacters
,
$tooLongCity
,
$errorInCityName
;
global
$maxCityCharacters
,
$tooLongCity
,
$errorInCityName
,
$fieldRequired
;
//vérifie si la ville est correcte
if
(
isset
(
$tab
[
"villeCollectivite"
]))
{
...
...
@@ -339,16 +340,16 @@ function verifVille($tab)
return
$tooLongCity
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
function
verifTel
(
$tab
)
{
//vérifie le numéro de téléphone
//vérifie le numéro de téléphone
. il n'est pas obligatoire, on ne retourne pas d'erreur si vide.
global
$errorInTel
;
if
(
isset
(
$tab
[
"telCollectivite"
]))
{
...
...
@@ -364,16 +365,16 @@ function verifTel($tab)
return
$errorInTel
;
}
}
else
{
return
"
vide
"
;
return
""
;
}
}
else
{
return
"
vide
"
;
return
""
;
}
}
function
verifUrl
(
$tab
)
{
//vérifie l'Url du site internet grâce à un filter var
//vérifie l'Url du site internet grâce à un filter var
. pas obligatoire, ne retourne pas d'erreurs si vide.
global
$incorrectUrl
;
if
(
isset
(
$tab
[
"siteCollectivite"
]))
{
...
...
@@ -388,10 +389,10 @@ function verifUrl($tab)
return
$incorrectUrl
;
}
}
else
{
return
"
vide
"
;
return
""
;
}
}
else
{
return
"
vide
"
;
return
""
;
}
}
...
...
@@ -415,7 +416,7 @@ function verifPeriodeAdhesion($tab)
function
verifSiret
(
$tab
)
{
global
$debug_mode_traitement
,
$errorInSiret
;
global
$debug_mode_traitement
,
$errorInSiret
,
$fieldRequired
;
if
(
$debug_mode_traitement
)
{
echo
"<br> on vérifie le siret <br> "
;
...
...
@@ -434,16 +435,18 @@ function verifSiret($tab)
return
$errorInSiret
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
function
verifNumeroEngagement
(
$tab
)
{
//vérifie si le numéro engagement a été correctement entré
global
$fieldRequired
;
if
(
isset
(
$tab
[
"numeroEngagementCollectivite"
]))
{
$numero
=
$tab
[
"numeroEngagementCollectivite"
];
...
...
@@ -452,16 +455,18 @@ function verifNumeroEngagement($tab)
return
""
;
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
function
verifCode
(
$tab
)
{
//vérifie si le code service a été correctement entré
global
$fieldRequired
;
if
(
isset
(
$tab
[
"codeCollectivite"
]))
{
$code
=
$tab
[
"codeCollectivite"
];
...
...
@@ -470,10 +475,10 @@ function verifCode($tab)
return
""
;
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
else
{
return
"vide"
;
return
$fieldRequired
;
}
}
...
...
@@ -482,6 +487,8 @@ function traitementInformations($tab, $errors)
//vérifie tous les champs texte
//ces infos sont toujours obligatoires en fin de formulaire donc on fait une fonction tout en un
global
$debug_mode_traitement
;
$errors
[
"nom"
]
=
verifNom
(
$tab
);
...
...
@@ -495,15 +502,19 @@ function traitementInformations($tab, $errors)
$errors
[
"site"
]
=
verifUrl
(
$tab
);
$errors
[
"siret"
]
=
verifSiret
(
$tab
);
$errors
[
"numeroEngagement"
]
=
verifNumeroEngagement
(
$tab
);
if
(
$tab
[
"firstSelection"
]
!=
"Association"
)
{
if
(
$debug_mode_traitement
)
{
echo
"tab[firstselection] = "
.
$tab
[
"firstSelection"
]
.
"
\n
"
;
}
$errors
[
"code"
]
=
verifCode
(
$tab
);
$errors
[
"siret"
]
=
verifSiret
(
$tab
);
return
$errors
;
$errors
[
"numeroEngagement"
]
=
verifNumeroEngagement
(
$tab
)
;
$errors
[
"code"
]
=
verifCode
(
$tab
);
}
return
$errors
;
}
function
traitement
(
$tab
,
$errors
)
...
...
@@ -514,7 +525,6 @@ function traitement($tab, $errors)
echo
"début du traitement "
;
}
//le résultat du premier select
if
(
verifFirstSelection
(
$tab
))
{
...
...
@@ -547,7 +557,4 @@ function traitement($tab, $errors)
return
$errors
;
}
?>
\ No newline at end of file
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment