diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js index 7c92b78..dbf45b2 100644 --- a/src/components/GestionAdministrative.js +++ b/src/components/GestionAdministrative.js @@ -900,6 +900,56 @@ function GestionAdministrative(props) { SendInscriptionConfirmation(email); } + const [SendInscriptionCancell_api, setSendInscriptionCancell_api] = useState(); + const [SendInscriptionCancell_message, setSendInscriptionCancell_message] = useState(); + const [SendInscriptionCancell_result, setSendInscriptionCancell_result] = useState(); + function SendInscriptionCancell(email) { + + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + if (mysession.length <= 0) { + alert(" Vous devez choisir une session"); + return; + } + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("class_internal_url", internal_url); + form.append("session_id", mysession); + form.append("email", email); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/CancelAttendeeInscription/"; + + axios.post(myurl, form).then(res => { + + if (String(res.data.status) === "true") { + //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status); + //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message); + setSendInscriptionCancell_api("true"); + setSendInscriptionCancell_result(res.data.message); + + GetListePreinscrit(mysession); + GetListeInscrit(mysession); + GetListeEmargement(mysession); + GetListeEvaluation(mysession); + submenu_inscrit(); + + } + else { + setSendInscriptionCancell_api("false"); + setSendInscriptionCancell_message(res.data.message); + + } + + }).catch((error) => { + + console.warn('SendInscriptionCancell : Not good man :( mysearchtext = ' + error); + setSendInscriptionCancell_api("false"); + + }) + } + const [SendInscriptionConfirmation_api, setSendInscriptionConfirmation_api] = useState(); const [SendInscriptionConfirmation_message, setSendInscriptionConfirmation_message] = useState(); @@ -1101,6 +1151,7 @@ function GestionAdministrative(props) { seturlpreview_certif(); setdisplay_detail_insc(); setCreateSessionFormation_api(); + setSendInscriptionConfirmation_api(); var tab_date = []; @@ -1201,6 +1252,8 @@ function GestionAdministrative(props) { } + const [is_lms_class_code, setis_lms_class_code] = useState(); + const [CreateSessionFormation_api, setCreateSessionFormation_api] = useState(); const [CreateSessionFormation_message, setCreateSessionFormation_message] = useState(); const [CreateSessionFormation_result, setCreateSessionFormation_result] = useState(); @@ -1287,8 +1340,10 @@ function GestionAdministrative(props) { var lms_class_code = ""; - if (document.getElementById("lms_class_code") && document.getElementById("lms_class_code").value != "") - lms_class_code = document.getElementById("lms_class_code").value; + if (document.getElementById("lms_class_code") && document.getElementById("lms_class_code").value != "") { + lms_class_code = document.getElementById("lms_class_code").value; + + } @@ -1452,6 +1507,7 @@ function GestionAdministrative(props) { document.getElementsByName("lms_class_code")[0].value = ""; if (mylocaltraining.lms_class_code) { document.getElementsByName("lms_class_code")[0].value = mylocaltraining.lms_class_code; + setis_lms_class_code(mylocaltraining.lms_class_code); } document.getElementsByName("code_postal")[0].value = ""; @@ -2189,6 +2245,10 @@ function GestionAdministrative(props) { } + + const [attendee_lms_pwd, setattendee_lms_pwd] = useState(); + const [attendee_lms_login, setattendee_lms_login] = useState(); + // Cette fonction remplit la zone detail de la personne inscrite const [GetAttendee_api, setGetAttendee_api] = useState(); const [GetAttendee_message, setGetAttendee_message] = useState(); @@ -2231,6 +2291,7 @@ function GestionAdministrative(props) { document.getElementsByName("detail_mail")[0].value = ""; if (mylocalattendee.email) { document.getElementsByName("detail_mail")[0].value = mylocalattendee.email; + setattendee_lms_login(mylocalattendee.email); } @@ -2300,6 +2361,10 @@ function GestionAdministrative(props) { } + if (mylocalattendee.lms_pwd) { + setattendee_lms_pwd("xxxxxx"); + } + desableAttendeeDetailFields(); } @@ -2643,7 +2708,7 @@ function GestionAdministrative(props) { const value = event.target.value; - if (String(value) === "confirmation" || String(value) === "impression") { + if (String(value) === "confirmation" || String(value) === "impression" || String(value) === "annuleinscription") { setactionmass_insc_val(value); } else { @@ -2670,7 +2735,7 @@ function GestionAdministrative(props) { for (var i = 0; i < liste_formation.length; i++) { var line = JSON.parse(rowss_insc[i]); - console.log(" line = ", line); + //console.log(" line = ", line); var email = line.email; console.log(" Traitement de email = ", email); if (String(actionmass_insc_val) === "confirmation") { @@ -2678,10 +2743,16 @@ function GestionAdministrative(props) { SendInscriptionConfirmation(email); } else if (String(actionmass_insc_val) === "impression") { - console.log(" impress mail = ", email); + //console.log(" impress mail = ", email); DownloadAttendeeDetail_one(email); + } else if (String(actionmass_insc_val) === "annuleinscription") { + + console.log(" impress mail = ", email); + SendInscriptionCancell(email); + } + await sleep(100); } @@ -3320,7 +3391,12 @@ function GestionAdministrative(props) { {String(UpdateStagiaireData_api) === "true" &&
la mise à jour a été correctement faite
} {String(UpdateStagiaireData_api) === "false" &&
{UpdateStagiaireData_message}
} - { } + + {String(SendInscriptionCancell_api) === "true" &&
la mise à jour a été correctement faite
} + + {String(SendInscriptionCancell_api) === "false" &&
{SendInscriptionCancell_message}
} + +
@@ -3495,6 +3571,7 @@ function GestionAdministrative(props) { +   @@ -3853,7 +3930,7 @@ function GestionAdministrative(props) {
{String(display_detail_insc) === "1" && mysession &&
- Detail inscription + {String(GetAttendee_api) === "true" &&
@@ -4035,9 +4112,59 @@ function GestionAdministrative(props) { />
+ {is_lms_class_code &&
+
+
+
+
+ Acces LMS +
+
+
login LMS
+ +
+ +
Mot de passe LMS
+ +
+
+ + + +
+
+
}
+
+
+ +
Evaluation
@@ -4135,9 +4262,11 @@ function GestionAdministrative(props) {
} - -
+
+
+ +
Attestation
diff --git a/src/styles/components/_gestionadministrative.scss b/src/styles/components/_gestionadministrative.scss index e462920..ff8cab7 100644 --- a/src/styles/components/_gestionadministrative.scss +++ b/src/styles/components/_gestionadministrative.scss @@ -218,6 +218,9 @@ border-radius: 1rem !important; margin-top: 1rem !important; } + .hr_break { + border: 2px solid grey; + } } @@ -445,6 +448,10 @@ transform: scale(2); margin-left: 5rem; } + + .hr_break { + border: 3px solid grey; + } } @media only screen and (min-width: 992px) and (max-width: 1199px) { @@ -672,7 +679,9 @@ transform: scale(2); margin-left: 5rem; } - + .hr_break { + border: 3px solid grey; + } } @media only screen and (min-width: 1200px) { @@ -895,6 +904,10 @@ margin-right: 10px; } + .hr_break { + border: 5px solid grey; + } + } // end media