From 2f78c5c7802c3b6fd4c141b50758af7d956007f2 Mon Sep 17 00:00:00 2001 From: cherif Date: Thu, 16 Feb 2023 22:00:27 +0100 Subject: [PATCH] 16/02/23 - 22h --- src/components/GestionAdministrative.js | 418 ++++++++++++++++-- src/components/SignIn.js | 20 +- src/components/TestUrl.js | 2 +- .../components/_gestionadministrative.scss | 36 +- src/styles/components/_signin.scss | 63 ++- src/styles/components/_signup.scss | 16 +- 6 files changed, 466 insertions(+), 89 deletions(-) diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js index 1049314..33cdd85 100644 --- a/src/components/GestionAdministrative.js +++ b/src/components/GestionAdministrative.js @@ -263,24 +263,6 @@ function GestionAdministrative(props) { ); } }, - { - field: "valide", headerName: 'Valider', - renderCell: (cellValues) => { - return ( - - - - ); - } - }, { field: "Detail", headerName: 'Voir detail', @@ -458,16 +440,34 @@ function GestionAdministrative(props) { if (parseFloat(montant).toFixed(2) <= 0) { alert(" Le montant de la formation est incorrect"); return; - } + if (String(montant) === "undefined") { + alert(" Le montant de la formation est incorrect"); + return; + } + + + var nom = cellValues.row.nom; var email = cellValues.row.email; var prenom = cellValues.row.prenom; var opco = cellValues.row.opco; + if (String(opco) === "undefined") { + opco = "" + } + var modefinancement = cellValues.row.modefinancement; + if (String(modefinancement) === "undefined") { + modefinancement = "" + } + var status = "1"; var employeur = cellValues.row.employeur; + if (String(employeur) === "undefined") { + employeur = "" + } + UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur); } @@ -475,13 +475,29 @@ function GestionAdministrative(props) { function handleClick_update_data(event, cellValues) { var montant = String(cellValues.row.amount); + if (String(montant) === "undefined") { + montant = "0" + } + var nom = cellValues.row.nom; var email = cellValues.row.email; var prenom = cellValues.row.prenom; var opco = cellValues.row.opco; + if (String(opco) === "undefined") { + opco = "" + } + var modefinancement = cellValues.row.modefinancement; + if (String(modefinancement) === "undefined") { + modefinancement = "" + } + var status = "0"; var employeur = cellValues.row.employeur; + if (String(employeur) === "undefined") { + employeur = "" + } + var comment = ""; UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, comment); @@ -492,13 +508,29 @@ function GestionAdministrative(props) { var motif_refus = document.getElementById("motif_refus").value; var montant = String(cellValues.row.amount); + if (String(montant) === "undefined") { + montant = "0" + } + var nom = cellValues.row.nom; var email = cellValues.row.email; var prenom = cellValues.row.prenom; + var opco = cellValues.row.opco; + if (String(opco) === "undefined") { + opco = "" + } + var modefinancement = cellValues.row.modefinancement; + if (String(modefinancement) === "undefined") { + modefinancement = "" + } + var status = "-1"; var employeur = cellValues.row.employeur; + if (String(employeur) === "undefined") { + employeur = "" + } UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, motif_refus); } @@ -645,10 +677,12 @@ function GestionAdministrative(props) { setUpdateStagiaireData_result(res.data.message); GetListePreinscrit(mysession); GetListeInscrit(mysession); + setretval_ch("1"); } else { setUpdateStagiaireData_api("false"); setUpdateStagiaireData_message(res.data.message); + setretval_ch("-1"); } @@ -656,6 +690,7 @@ function GestionAdministrative(props) { console.warn('UpdateStagiaireData : Not good man :( mysearchtext = ' + error); setUpdateStagiaireData_api("false"); + setretval_ch("-1"); }) } @@ -794,7 +829,7 @@ function GestionAdministrative(props) { /* Envoi de l'envoi de l'email de confirmation de la validation de l'inscription */ function handleClick_resend_conf_mail(event, cellValues) { var email = cellValues.row.email; - alert(" confirmation email = " + email); + //alert(" confirmation email = " + email); SendInscriptionConfirmation(email); } @@ -1672,7 +1707,41 @@ function GestionAdministrative(props) { var nom_fiche_detaillee = "Fiche_Detaillee.pdf"; - var url = process.env.REACT_APP_API_URL + "myclass/api/PrintAttendeeDetail_perSession/" + stored_cookie + "/" + mysession + "/" + selectedattendeeemail; + var url = process.env.REACT_APP_API_URL + "myclass/api/PrintAttendeeDetail_perSession/" + stored_cookie + "/" + mysession + "/" + selectedattendeeemail+ "/" + internal_url; + + + axios.get(url, { responseType: 'blob', },) + .then((res) => { + fileDownload(res.data, nom_fiche_detaillee) + }).catch((error) => { + console.error('Error:', error); + + }); + } + + + function DownloadAttendeeDetail_one(addendeeEmail) { + + + var trainer = "" + if (document.getElementsByName("formateur")[0]) + trainer = document.getElementsByName("formateur")[0].value; + + if (trainer == "") { + alert(" Aucun formateur pour cette session "); + return; + } + + if (addendeeEmail == "") { + alert(" Aucun utilisateur choisi "); + return; + } + + const stored_cookie = getCookie('tokenmysypart'); + + var nom_fiche_detaillee = "Fiche_Detaillee.pdf"; + + var url = process.env.REACT_APP_API_URL + "myclass/api/PrintAttendeeDetail_perSession/" + stored_cookie + "/" + mysession + "/" + addendeeEmail+ "/" + internal_url; axios.get(url, { responseType: 'blob', },) @@ -2347,6 +2416,158 @@ function GestionAdministrative(props) { } + const [actionmass_preinsc_val, setactionmass_preinsc_val] = useState(); + const actionmass_preinsc = (event) => { + const value = event.target.value; + + if (String(value) === "valider" || String(value) === "refuser") { + setactionmass_preinsc_val(value); + } + else { + setactionmass_preinsc_val(); + } + } + + function GetSelectedRows_PresInsc() { + + var tab_tmp = [] + for (var i = 0; i < selectionModel.length; i++) { + var myid = parseInt(String(selectionModel[i])); + var line = JSON.parse(rowss[myid]); + tab_tmp.push(line.email); + } + return tab_tmp; + + } + + function GetSelectedRows_PresInsc_Ids() { + + var tab_tmp = [] + for (var i = 0; i < selectionModel.length; i++) { + var myid = parseInt(String(selectionModel[i])); + //var line = JSON.parse(rowss[myid]); + tab_tmp.push(myid); + } + return tab_tmp; + + } + + const [retval_ch, setretval_ch] = useState(); + function actionmass_preinsc_Traitemet() { + + var liste_formation = GetSelectedRows_PresInsc_Ids(); + for (var i = 0; i < liste_formation.length; i++) { + var line = JSON.parse(rowss[i]); + + var email = line.email; + var montant = String(line.price); + //console.log("line = ", line); + //console.log(" montant = ", montant); + var status; + var motif = ""; + if (String(actionmass_preinsc_val) === "valider") { + status = "1"; + + if (String(montant) === "undefined" || String(montant).trim() === "") { + alert(" Verifier les montants. Ils sont incorrectes"); + return; + } + + if (parseFloat(montant).toFixed(2) <= 0) { + alert(" Verifier les montants. Ils sont incorrectes "); + return; + + } + } else if (String(actionmass_preinsc_val) === "refuser") { + status = "-1"; + } + + + var nom = line.nom; + var prenom = line.prenom; + var opco = line.opco; + if (String(opco) === "undefined") { + opco = "" + } + + var modefinancement = line.modefinancement; + if (String(modefinancement) === "undefined") { + modefinancement = "" + } + + + + var employeur = line.employeur; + if (String(employeur) === "undefined") { + employeur = "" + } + + if (String(actionmass_preinsc_val) === "valider") { + UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur); + } + else if (String(actionmass_preinsc_val) === "refuser") { + UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, motif); + } + //console.log(" retval de ", email + " = retval_ch =", retval_ch); + + } + setSelectionModel([]); + setactionmass_preinsc_val(); + + } + + + const [actionmass_insc_val, setactionmass_insc_val] = useState(); + const actionmass_inscrit = (event) => { + const value = event.target.value; + + + if (String(value) === "confirmation" || String(value) === "impression") { + setactionmass_insc_val(value); + } + else { + setactionmass_insc_val(); + } + } + + + function GetSelectedRows_Insc_Ids() { + + var tab_tmp = [] + for (var i = 0; i < selectionModel_insc.length; i++) { + var myid = parseInt(String(selectionModel_insc[i])); + //var line = JSON.parse(rowss[myid]); + tab_tmp.push(myid); + } + return tab_tmp; + + } + + function actionmass_insc_Traitemet() { + + var liste_formation = GetSelectedRows_Insc_Ids(); + for (var i = 0; i < liste_formation.length; i++) { + + var line = JSON.parse(rowss_insc[i]); + console.log(" line = ", line); + var email = line.email; + console.log(" Traitement de email = ", email); + if (String(actionmass_insc_val) === "confirmation") { + + SendInscriptionConfirmation(email); + } else if (String(actionmass_insc_val) === "impression") { + + console.log(" impress mail = ", email); + DownloadAttendeeDetail_one(email); + + } + + } + + setSelectionModel_insc([]); + setactionmass_insc_val(); + } + return (
@@ -2899,21 +3120,73 @@ function GestionAdministrative(props) { />
- {selectionModel && selectionModel.length >= 1 &&
- -   -
-
- } + + {selectionModel && selectionModel.length >= 1 && +
+
+ +     + {actionmass_preinsc_val && + + Traiter + + } + modal + nested + position="center center" + > + + {close => ( +
+ +
MySy Information
+
+ {' '} + + Confirmer l'action {actionmass_preinsc_val} en masse. +
+
+
+ + +
+
+ +
+
+
+ )} +
+ } +
+ +
+ +
} +
{/* */} @@ -2961,18 +3234,69 @@ function GestionAdministrative(props) { />
- {selectionModel_insc && selectionModel_insc.length >= 1 &&
- -   -
+ {selectionModel_insc && selectionModel_insc.length >= 1 && +
+ +     + + {actionmass_insc_val && + + Traiter + + } + modal + nested + position="center center" + > + + {close => ( +
+ +
MySy Information
+
+ {' '} + + Confirmer l'action {actionmass_insc_val} en masse. +
+
+
+ + +
+
+ +
+
+
+ )} +
+ } +
+ + +
} diff --git a/src/components/SignIn.js b/src/components/SignIn.js index 60535b2..2b7b88a 100644 --- a/src/components/SignIn.js +++ b/src/components/SignIn.js @@ -436,28 +436,35 @@ function SignIn() {
+ style={{ "float": "left", "textAlign": "center", "height":"3rem" }}>Utilisateur + style={{ "float": "right", "textAlign": "center", "height":"3rem" }}>Organisme de formation
-
+
- + - +   + + + + + + + {/*String(menucompte) === String("partner") &&
+ +   +
diff --git a/src/components/TestUrl.js b/src/components/TestUrl.js index 64bb63e..9628a99 100644 --- a/src/components/TestUrl.js +++ b/src/components/TestUrl.js @@ -886,7 +886,7 @@ Cette fonction recuperer les stats des TOP 5 formations sur la periode saisie pa
Open Modal 2} + trigger={} modal nested position="center center" diff --git a/src/styles/components/_gestionadministrative.scss b/src/styles/components/_gestionadministrative.scss index 334c7f7..dd610e2 100644 --- a/src/styles/components/_gestionadministrative.scss +++ b/src/styles/components/_gestionadministrative.scss @@ -869,26 +869,14 @@ margin-left: 10rem; } + .action_mass { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-weight: 500; - text-align: left; + border-radius: 5px; font-size: small; - line-height: 1.75; - letter-spacing: 0.02857em; - text-transform: uppercase; - min-width: 64px; - transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, - box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, - border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, - color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; - color: #fff; - background-color: #81bc3a; - margin-bottom: 1rem; - width: 10rem; - box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), - 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12); - + padding: 0.3rem; + width: 40%; + background: #81BC3A; + height: 2.5rem; } } @@ -933,6 +921,18 @@ } + .bton_traiter_en_mass { + border-radius: 5px; + font-size: small; + padding: 0.3rem; + width: 40%; + background: #81BC3A; + margin-left: 5%; + height: 2.5rem; + color: white; + + } + .bton_fermer { border-radius: 5px; font-size: small; diff --git a/src/styles/components/_signin.scss b/src/styles/components/_signin.scss index 9fcb8bc..8074f86 100644 --- a/src/styles/components/_signin.scss +++ b/src/styles/components/_signin.scss @@ -1,6 +1,7 @@ .signin-content { @media only screen and (max-width: 600px) { width: 16rem !important; + .popup-reset-pwd-content { top: 10% !important; left: 10% !important; @@ -32,10 +33,11 @@ color: #3b3e40; } - .btn-sm{ + .btn-sm { font-size: small; } - .zone_mail{ + + .zone_mail { width: 15rem; font-size: small; border-radius: 0px; @@ -46,6 +48,7 @@ @media only screen and (min-width: 601px) and (max-width: 991px) { width: 20rem !important; + .popup-reset-pwd-content { top: 30% !important; left: 40% !important; @@ -76,10 +79,11 @@ color: #3b3e40; } - .btn-sm{ + .btn-sm { font-size: small; } - .zone_mail{ + + .zone_mail { width: 15rem; font-size: small; border-radius: 0px; @@ -121,10 +125,11 @@ color: #3b3e40; } - .btn-sm{ + .btn-sm { font-size: small; } - .zone_mail{ + + .zone_mail { width: 15rem; font-size: small; border-radius: 0px; @@ -167,10 +172,11 @@ color: #3b3e40; } - .btn-sm{ + .btn-sm { font-size: small; } - .zone_mail{ + + .zone_mail { width: 15rem; font-size: small; border-radius: 0px; @@ -234,7 +240,8 @@ h4 { display: inline-block; - font-size: large; /*or whatever you want*/ + font-size: large; + /*or whatever you want*/ color: white; } @@ -286,6 +293,7 @@ .btn_login { width: 10rem; } + .button { width: 100% !important; } @@ -303,6 +311,7 @@ font-size: small !important; margin: 0.2rem !important; } + .div_centre_social { float: center; border-width: 0.01rem; @@ -516,6 +525,7 @@ text-transform: none; /* Lowering the shadow */ } + .signin_menu:focus { //border: 3px dotted green; background-color: #e7f3fb; @@ -904,11 +914,13 @@ float: left; margin-top: 2rem; - @media only screen and (min-height: 1000px) { /* Ipaid */ + @media only screen and (min-height: 1000px) { + /* Ipaid */ margin-top: 20rem; } - @media only screen and (min-height: 1101px) { /* Ipad Air */ + @media only screen and (min-height: 1101px) { + /* Ipad Air */ margin-top: 25rem; } @@ -1066,6 +1078,7 @@ text-transform: none; /* Lowering the shadow */ } + .signin_menu:focus { //border: 3px dotted green; background-color: #e7f3fb; @@ -1172,6 +1185,7 @@ max-width: 20%; max-height: 3rem; } + .erreurconnexion { font-size: small; color: red; @@ -1598,6 +1612,7 @@ text-transform: none; /* Lowering the shadow */ } + .signin_menu:focus { //border: 3px dotted green; background-color: #e7f3fb; @@ -1705,13 +1720,13 @@ color: red; font-style: italic; } + input { width: 100%; - height: 2rem; + height: 3rem; + border-radius: 5rem; margin: 0 auto; border: auto; - border-radius: 0.5rem; - margin-bottom: 0.5rem; font-size: small; } @@ -1836,6 +1851,8 @@ .btn_login { width: 10rem; + height: 2.5rem; + border-radius: 5rem; } .div_row_gauche { @@ -1933,6 +1950,12 @@ font-size: xx-small; margin-left: auto !important; margin-right: 0px !important; + height: 1.5rem; + width: 30%; + text-align: center; + color: white; + background: no-repeat; + font-size: small; } .div_row2 { @@ -2142,6 +2165,7 @@ text-transform: none; /* Lowering the shadow */ } + .signin_menu:focus { //border: 3px dotted green; background-color: #e7f3fb; @@ -2210,5 +2234,14 @@ margin: 0.4rem !important; height: 1.8rem !important; } + + .div_row_bis { + margin-top: 2rem; + } + + + } -} + + // end media +} \ No newline at end of file diff --git a/src/styles/components/_signup.scss b/src/styles/components/_signup.scss index cb84573..16286e0 100644 --- a/src/styles/components/_signup.scss +++ b/src/styles/components/_signup.scss @@ -1306,7 +1306,7 @@ input { width: 100%; - height: 1.9rem; + height: 2.5rem; margin: 0 auto; border: auto; border-radius: 0.5rem; @@ -1679,11 +1679,11 @@ } .texte_area_passwd { - width: 95% !important; - font-size: x-small !important; + font-size: small !important; font-family: "verdana", "Quicksand", "Signika", sans-serif; margin: 0.4rem !important; height: 1.8rem !important; + margin-bottom: 2rem !important; } .css-1ptx2yq-MuiInputBase-root-MuiInput-root { @@ -1707,5 +1707,15 @@ border-radius: 10px; margin-top: 10px; } + + .css-1yq5fb3-MuiButtonBase-root-MuiIconButton-root{ + margin-right: 1rem !important; + padding: 0px !important; + + } + .MuiInputBase-inputAdornedEnd{ + height: 2.5rem !important; + max-height: 2.5rem !important; + } } }