diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js index 8b1450a..feccee8 100644 --- a/src/components/GestionAdministrative.js +++ b/src/components/GestionAdministrative.js @@ -354,12 +354,12 @@ function GestionAdministrative(props) { const columns_list_evaluation = [ { field: 'id', headerName: 'id', hide: true }, - { field: 'email', headerName: 'email', width: 200, hideable: true, resizable: true }, - { field: 'nom', headerName: 'nom', width: 200, hide: false, editable: true }, + { field: 'email', headerName: 'email', width: 200, hideable: true, resizable: true }, + { field: 'nom', headerName: 'nom', width: 200, hide: false, editable: true }, { field: 'prenom', headerName: 'prenom', width: 200, hide: false, editable: false }, - { field: 'eval_eval', headerName: 'Evaluation', width: 100, editable: false, flex:true}, + { field: 'eval_eval', headerName: 'Evaluation', width: 100, editable: false, flex: true }, { field: 'eval_note', headerName: 'Note', width: 100, editable: false, }, - { field: 'eval_pedagogie', headerName: 'Pédagogie', width: 100, editable: false, }, + { field: 'eval_pedagogie', headerName: 'Pédagogie', width: 100, editable: false, }, { field: 'eval_date', headerName: 'Date evalution', width: 100, editable: false, }, {/* field: "valide", headerName: 'Valider', @@ -1206,6 +1206,17 @@ function GestionAdministrative(props) { form.append("date_fin_inscription", format(SessionendDateInscription, 'dd/MM/yyyy kk:mm:ss')); form.append("attestation_certif", selectedCertif); + var contenu_ftion = ""; + if (editorRef_contenu_ftion.current) { + contenu_ftion = editorRef_contenu_ftion.current.getContent(); + + if (parse(contenu_ftion.replace(/(<([^>]+)>)/ig, '')).length > editorRef_contenu_ftion_limite) { + alert(" Champ 'Contenu de la formation', limite depassée !") + return; + } + } + form.append("contenu_ftion", contenu_ftion); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/"; @@ -1283,7 +1294,6 @@ function GestionAdministrative(props) { setSessionendDateInscription(date_fin_inscript); } - document.getElementsByName("certif_liste")[0].value = ""; if (mylocaltraining.attestation_certif) { setselectedCertif(mylocaltraining.attestation_certif); @@ -1312,6 +1322,9 @@ function GestionAdministrative(props) { if (mylocaltraining.presentiel) document.getElementsByName("presentiel")[0].value = mylocaltraining.presentiel; + if (mylocaltraining.contenu_ftion) + setfield_contenu_ftion(mylocaltraining.contenu_ftion); + document.getElementsByName("adresse")[0].value = ""; @@ -1354,6 +1367,7 @@ function GestionAdministrative(props) { function annuleSessionUpdate() { + clearSessionFields(); GetCurrentSession(mysession); setsessionChanged(false); desableSessionFields(); @@ -1440,6 +1454,9 @@ function GestionAdministrative(props) { } + + + function desableSessionFields() { document.getElementsByName("code_session")[0].disabled = true; @@ -1530,25 +1547,84 @@ function GestionAdministrative(props) { } function clearSessionFields() { + document.getElementsByName("code_session")[0].value = ""; + document.getElementsByName("sessiondatedebut")[0].value = ""; + document.getElementsByName("sessiondatefin")[0].value = ""; document.getElementsByName("adresse")[0].value = ""; - document.getElementsByName("ville")[0].value = ""; + document.getElementsByName("code_postal")[0].value = ""; - + document.getElementsByName("ville")[0].value = ""; document.getElementsByName("nb_participant")[0].value = ""; - document.getElementsByName("prix_session")[0].value = ""; - document.getElementsByName("presentiel")[0].value = ""; document.getElementsByName("distantiel")[0].value = ""; - + document.getElementsByName("sessiondatedebutinscription")[0].value = ""; + document.getElementsByName("sessiondatefininscription")[0].value = ""; setSessionstartDateInscription(); setSessionendDateInscription(); setSessionendDate(); setSessionstartDate(); + seturlpreview_certif(); + setfield_contenu_ftion(); } + + function clearDetailAttendeFields() { + + if (document.getElementsByName("detail_nom") && document.getElementsByName("detail_nom")[0]) + document.getElementsByName("detail_nom")[0].value = ""; + + if (document.getElementsByName("detail_prenom") && document.getElementsByName("detail_prenom")[0]) + document.getElementsByName("detail_prenom")[0].value = ""; + + if (document.getElementsByName("detail_mail") && document.getElementsByName("detail_mail")[0]) + document.getElementsByName("detail_mail")[0].value = ""; + + if (document.getElementsByName("detail_tel") && document.getElementsByName("detail_tel")[0]) + document.getElementsByName("detail_tel")[0].value = ""; + + if (document.getElementsByName("detail_adresse") && document.getElementsByName("detail_adresse")[0]) + document.getElementsByName("detail_adresse")[0].value = ""; + + if (document.getElementsByName("detail_code_postal") && document.getElementsByName("detail_code_postal")[0]) + document.getElementsByName("detail_code_postal")[0].value = ""; + + if (document.getElementsByName("detail_ville") && document.getElementsByName("detail_ville")[0]) + document.getElementsByName("detail_ville")[0].value = ""; + + if (document.getElementsByName("detail_incr_date") && document.getElementsByName("detail_incr_date")[0]) + document.getElementsByName("detail_incr_date")[0].value = ""; + + if (document.getElementsByName("detail_cout") && document.getElementsByName("detail_cout")[0]) + document.getElementsByName("detail_cout")[0].value = ""; + + if (document.getElementsByName("detail_mode_fin") && document.getElementsByName("detail_mode_fin")[0]) + document.getElementsByName("detail_mode_fin")[0].value = ""; + + if (document.getElementsByName("detail_employeur") && document.getElementsByName("detail_employeur")[0]) + document.getElementsByName("detail_employeur")[0].value = ""; + + if (document.getElementsByName("date_evaluation") && document.getElementsByName("date_evaluation")[0]) + document.getElementsByName("date_evaluation")[0].value = ""; + + if (document.getElementsByName("note_eval") && document.getElementsByName("note_eval")[0]) + document.getElementsByName("note_eval")[0].value = ""; + + if (document.getElementsByName("certif_date") && document.getElementsByName("certif_date")[0]) + document.getElementsByName("certif_date")[0].value = ""; + + + + setfield_evaluation(); + setdetailuser_date_certification(); + setdetailuser_date_evaluation(); + + + } + + function DownloadListEmargement(event) { var trainer = "" @@ -1741,9 +1817,9 @@ function GestionAdministrative(props) { //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); const stored_cookie = getCookie('tokenmysypart'); - - var url = process.env.REACT_APP_API_URL + "myclass/api/DownloadParticipantsList/" + stored_cookie + "/" + mysession+"/"+internal_url; + + var url = process.env.REACT_APP_API_URL + "myclass/api/DownloadParticipantsList/" + stored_cookie + "/" + mysession + "/" + internal_url; @@ -1759,9 +1835,9 @@ function GestionAdministrative(props) { const stored_cookie = getCookie('tokenmysypart'); - - var url = process.env.REACT_APP_API_URL + "myclass/api/DownloadEvaluationList/" + stored_cookie + "/" + mysession+"/"+internal_url; + + var url = process.env.REACT_APP_API_URL + "myclass/api/DownloadEvaluationList/" + stored_cookie + "/" + mysession + "/" + internal_url; @@ -1947,6 +2023,8 @@ function GestionAdministrative(props) { const [display_detail_insc, setdisplay_detail_insc] = React.useState(); function Display_Detail_Inscription(event, cellValues) { + + clearDetailAttendeFields(); setdisplay_detail_insc("1") var montant = String(cellValues.row.amount); var nom = cellValues.row.nom; @@ -2175,9 +2253,15 @@ function GestionAdministrative(props) { const editorRef_evaluation = useRef(null); const [field_evaluation, setfield_evaluation] = useState(""); function editor_keyup() { - } + const editorRef_contenu_ftion = useRef(null); + const [editorRef_contenu_ftion_limite, seteditorRef_description_limite] = useState(800); + + const [field_contenu_ftion, setfield_contenu_ftion] = useState(""); + function editor_contenu_ftion_keyup() { + setsessionChanged(true); + } const [SendEvaluationEmail_api, setSendEvaluationEmail_api] = useState(); @@ -2656,9 +2740,10 @@ function GestionAdministrative(props) {
-
Choisir un certificat + {!fields1desabled &&
Choisir un modèle d'attestation : +
+ +
} + {fields1desabled &&
Le modèle d'attestation : + + + +
} + +
Contenu de la formation (max 800 caractères)
+ (à afficher sur l'attestation) + {!fields1desabled &&
} + {!fields1desabled &&
} + + editorRef_contenu_ftion.current = editor} + initialValue={field_contenu_ftion} + onKeyUp={editor_contenu_ftion_keyup} + disabled={fields1desabled} + + init={{ + resize: false, + + height: 200, + menubar: false, + plugins: [ + 'advlist autolink lists link image charmap print preview anchor', + 'searchreplace visualblocks code fullscreen', + 'insertdatetime media table paste code help wordcount' + ], + toolbar: false, + content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:12px; }' + }} + />
- -
@@ -2705,15 +2820,17 @@ function GestionAdministrative(props) {
- {!sessionChanged && mysession && + {!sessionChanged && mysession && fields1desabled && } - {sessionChanged && mysession && + {((sessionChanged && mysession) || !fields1desabled) && } + +
} @@ -2918,11 +3035,11 @@ function GestionAdministrative(props) {
- +
- + @@ -2966,7 +3083,7 @@ function GestionAdministrative(props) {
- + @@ -3294,12 +3411,12 @@ function GestionAdministrative(props) {
- certificat / Attestation + Attestation
- Date certification + Date attestation } -
- diff --git a/src/components/Inscription_Information.js b/src/components/Inscription_Information.js index 3844ee8..60e4bc4 100644 --- a/src/components/Inscription_Information.js +++ b/src/components/Inscription_Information.js @@ -636,7 +636,7 @@ function Inscription_Information(props) { String(action).toLocaleLowerCase() === "inscription" &&
- Votre inscription bien été prise en compte. + Votre inscription a bien été prise en compte. Vous allez recevoir une email de confirmation dans votre boite email. Merci.
}