11/02/23 - 20h

recette2
cherif 2023-02-11 20:15:11 +01:00
parent b11a942763
commit 5676e0772f
2 changed files with 147 additions and 30 deletions

View File

@ -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) {
<div className="div_row" style={{ "border": "None" }}>
<div className="session_caract">Choisir un certificat
{!fields1desabled && <div className="session_caract">Choisir un modèle d'attestation :
<select id="certif_liste" name="certif_liste" value={selectedCertif} onChange={handleChangeselectedCertif} className="selectsession">
<option value="">Choisir un certificat </option>
<option value="">Choisir un modèle </option>
{GetAttestation_Certif_result &&
GetAttestation_Certif_result.map((certificat) => (
<option value={JSON.parse(certificat).nom}>
@ -2666,12 +2751,42 @@ function GestionAdministrative(props) {
</option>
))}
</select> <br />
</select>
<img className="preview_certif" src={urlpreview_certif} />
</div>}
{fields1desabled && <div className="session_caract">Le modèle d'attestation :
<img className="preview_certif" src={urlpreview_certif} />
</div>}
<div className="session_caract"> Contenu de la formation (max 800 caractères)<br />
<i> (à afficher sur l'attestation) </i>
{!fields1desabled && <br />}
{!fields1desabled && <br />}
<Editor
onInit={(evt, editor) => 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; }'
}}
/>
</div>
</div>
@ -2705,15 +2820,17 @@ function GestionAdministrative(props) {
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
{!sessionChanged && mysession &&
{!sessionChanged && mysession && fields1desabled &&
<Button variant="contained" className="bton_fermer" onClick={enableSessionFields}>Editer
</Button>}
{sessionChanged && mysession &&
{((sessionChanged && mysession) || !fields1desabled) &&
<Button variant="contained" className="bton_fermer" onClick={annuleSessionUpdate}>Annuler les modifications
</Button>}
</div>
</div>}
@ -2918,11 +3035,11 @@ function GestionAdministrative(props) {
<div className="div_row" style={{ "textAlign": "right", "marginTop": "0.5rem" }}>
<Button className="bton_emarge" onClick={PrintEvaluationDetail}>Exporter (excel)</Button>
</div>
@ -2966,7 +3083,7 @@ function GestionAdministrative(props) {
<br />
@ -3294,12 +3411,12 @@ function GestionAdministrative(props) {
<div className="div_row" style={{ "border": "None" }}>
certificat / Attestation
Attestation
</div>
<div className="div_row" style={{ "border": "None" }}>
<div className="session_caract">
Date certification
Date attestation
<DatePicker
name="certif_date"
id="certif_date"
@ -3349,13 +3466,13 @@ function GestionAdministrative(props) {
</div>}
<Button variant="contained" className="bton_envoyer" onClick={SendAttendeeAttestation}>Delivrer certificat
<Button variant="contained" className="bton_envoyer" onClick={SendAttendeeAttestation}>Delivrer une attestation
</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<Button variant="contained" className="bton_fermer" onClick={DownloadAttendeeAttestation}>Imprimer certificat
<Button variant="contained" className="bton_fermer" onClick={DownloadAttendeeAttestation}>Imprimer une attestation
</Button>

View File

@ -636,7 +636,7 @@ function Inscription_Information(props) {
String(action).toLocaleLowerCase() === "inscription" &&
<div className="okUpdateData">
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.
</div>}