From cf053cfbf1445556556582c21f09bc33ee027004 Mon Sep 17 00:00:00 2001 From: cherif Date: Fri, 5 Jan 2024 16:36:28 +0100 Subject: [PATCH] 555 --- src/components/AddClassManual.js | 96 +++++++--- src/components/DisplayPartnerSession.js | 3 +- .../DisplayPartnerTrainingsPagination.js | 178 +++++++++--------- src/components/Partner_Commande.js | 162 +++++++++++++++- .../_displaypartnertrainingpagination.scss | 9 +- 5 files changed, 324 insertions(+), 124 deletions(-) diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index e985b94..37e1c13 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -36,26 +36,26 @@ const AddClassManual = (props) => { const [inputs, setInputs] = useState({}); const [mypublished, setmypublished] = useState("0"); - const [mypublished_label, setmypublished_label] = useState(""); + const [mypublished_label, setmypublished_label] = useState("-"); const [mytrainingsupport, setmytrainingsupport] = useState("n/a"); - const [mytrainingsupport_label, setmytrainingsupport_label] = useState(""); + const [mytrainingsupport_label, setmytrainingsupport_label] = useState("-"); const [mytrainingdurationunit, setmytrainingdurationunit] = useState("heure"); - const [mycpf, setmycpf] = useState(""); - const [mycpf_label, setmycpf_label] = useState(""); + const [mycpf, setmycpf] = useState("0"); + const [mycpf_label, setmycpf_label] = useState("Non"); - const [mycertif, setmycertif] = useState(""); - const [mycertif_label, setmycertif_label] = useState(""); + const [mycertif, setmycertif] = useState("0"); + const [mycertif_label, setmycertif_label] = useState("Non"); - const [mypresence, setmypresence] = useState(""); - const [mypresence_label, setmypresence_label] = useState(""); + const [mypresence, setmypresence] = useState("0"); + const [mypresence_label, setmypresence_label] = useState("Non"); - const [mydistance, setmydistance] = useState(""); - const [mydistance_label, setmydistance_label] = useState(""); + const [mydistance, setmydistance] = useState("0"); + const [mydistance_label, setmydistance_label] = useState("Non"); const [importmessage, setimportmessage] = useState(""); @@ -568,7 +568,7 @@ const AddClassManual = (props) => { } else { setp_formateur_id(""); - setp_formateur_label(""); + setp_formateur_label("-"); } @@ -647,10 +647,10 @@ const AddClassManual = (props) => { setmycertif(mylocaltraining.certif); var result2 = certif.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.certif))); - console.log(" CERTIFFF = ",result2 ) - if (result2[0]){ + + if (result2[0]) { setmycertif_label(result2[0].label); - console.log(" result2[0].label = ",result2[0].label ) + } } else { @@ -658,7 +658,7 @@ const AddClassManual = (props) => { setmycertif_label("Non"); } - if (mylocaltraining.class_level) { + if (mylocaltraining.class_level && String(mylocaltraining.class_level).trim() !== "") { setp_class_level(mylocaltraining.class_level); setp_class_level_label(mylocaltraining.class_level_description); @@ -844,7 +844,10 @@ const AddClassManual = (props) => { var presentiel = mypresence; var distentiel = mydistance; - var domaine = document.getElementsByName("domaine")[0].value; + var domaine = mytrainingdomaine; + if( String(domaine).trim() === "-"){ + domaine = "" + } var mypublier = mypublished; var niveau_ftion = p_class_level; var price = document.getElementsByName("price")[0].value; @@ -853,8 +856,11 @@ const AddClassManual = (props) => { var lms_class_code = document.getElementsByName("lms_class_code")[0].value; var class_inscription_url = document.getElementsByName("class_inscription_url")[0].value; var mymetier = mytrainingmetier; + if( String(mymetier).trim() === "-"){ + mymetier = "" + } var mynote = document.getElementsByName("note")[0].value; - var mycpf = mycpf; + var localmycpf = mycpf; var mycertif = mycertif; var trainingSupport = mytrainingsupport; @@ -1006,7 +1012,7 @@ const AddClassManual = (props) => { formData.append('note', mynote); formData.append('published', mypublier); - formData.append('cpf', mycpf); + formData.append('cpf', localmycpf); formData.append('certif', mycertif); @@ -1103,7 +1109,7 @@ const AddClassManual = (props) => { const [Get_List_Metiers_result, setGet_List_Metiers_result] = useState(); function Get_List_Metiers() { var form = new FormData(); - var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_List_metier_formation_JSON/"; + var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_List_all_metier_formation/"; setLoading(true); fetch(myurl, { @@ -1113,7 +1119,7 @@ const AddClassManual = (props) => { .then((data) => data.json()) .then((data) => { setLoading(false); - //console.log(' IN Get_List_Metiers Success:', data['message'], "data['status'] = ", data['status']); + console.log(' IN Get_List_Metiers Success:', data['message'], "data['status'] = ", data['status']); if (String(data['status']) === String("true")) { setGet_List_Metiers_api("true"); @@ -1122,9 +1128,12 @@ const AddClassManual = (props) => { var new_data2 = []; const new_data = data['message'].map((x) => { + //--- - var localid = x.id; - var local_metier = x.metier; + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_metier = JSON.parse(x).metier; + var local_domaine = JSON.parse(x).domaine; //--- @@ -1132,6 +1141,7 @@ const AddClassManual = (props) => { "id": localid, "label": local_metier, "metier": local_metier, + "domaine": local_domaine, }; new_data2.push(node); @@ -1139,7 +1149,7 @@ const AddClassManual = (props) => { if (new_data2.length > 0) { setNew_Get_List_Metiers_result(new_data2); - // console.log(" ### new_data2 ", new_data2); + //console.log(" ### new_data2 ", new_data2); //console.log(" ### setNew_Get_List_Metiers_result ", New_Get_List_Metiers_result); } @@ -1910,7 +1920,7 @@ const AddClassManual = (props) => {
- { } }} - renderInput={(params) => + renderInput={(params) => } /> - {/* { onChange={(event, value) => { if (value && value.domaine) { setmytrainingdomaine(value.domaine); + setmytrainingmetier("-"); setdatamodification("1"); + } else { + setmytrainingdomaine("-"); + setmytrainingmetier("-"); } }} @@ -2224,7 +2238,32 @@ const AddClassManual = (props) => {
-
+ {mytrainingdomaine && String(mytrainingdomaine).trim() !== "-" &&
+ local_mymanager.domaine === String(String(mytrainingdomaine).trim()))} + value={mytrainingmetier} + onChange={(event, value) => { + + + if (value && value.metier) { + + setmytrainingmetier(value.metier); + setdatamodification("1"); + } + }} + + renderInput={(params) => + } + /> + +
} + + {(!mytrainingdomaine || String(mytrainingdomaine).trim().length <= 0 || String(mytrainingdomaine).trim() === "-") &&
{ value={mytrainingmetier} onChange={(event, value) => { + if (value && value.metier) { setmytrainingmetier(value.metier); @@ -2246,7 +2286,7 @@ const AddClassManual = (props) => { } /> -
+
} {/*
{ //--- var node = { "_id": local_id, "id": localid, - "label": local_title, "internal_url": local_internal_url, + "label": local_title, + "internal_url": local_internal_url, "title": local_title, "ispublished": local_is_published, }; diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index 5ecd2d1..c6b9900 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -1898,16 +1898,102 @@ const DistplayPartnerTraningsPage = (props) => {
 
+
+ {selectionModel && selectionModel.length >= 1 &&
+ +   + + + + Action    + Publier   + Dépublier   + Dupliquer   + Supprimer   + + + + {actionmass_ftion_val && + } + + +
} +
+ {selectionModel && selectionModel.length >= 1 &&
+
+
} +   +
- + { id='menu_import_participant' name='menu_import_participant' style={{ "marginRight": "10px" }}>Ajout 1 Formation   ajout session - -
- {formation_file_name && } + +
+ {formation_file_name && } @@ -1950,93 +2036,13 @@ const DistplayPartnerTraningsPage = (props) => {
  • ...
  • Télécharger le guide complet pour plus d'informations
    -
    +
     

    -
    - {selectionModel && selectionModel.length >= 1 &&
    - -   - - - - Action    - Publier   - Dépublier   - Dupliquer   - Supprimer   - - - - {actionmass_ftion_val && - } - -
    } -
    diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index b66ca10..73b8c87 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -17,6 +17,7 @@ import { Tooltip } from 'react-tooltip' import add_plus from "../mysy_img/plus.png"; import excel_icone from "../mysy_img/excel_icone.png"; import participants from "../mysy_img/participants.png"; +import Autocomplete from '@mui/material/Autocomplete'; import fileDownload from 'js-file-download' import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; @@ -490,6 +491,8 @@ const Partner_Commande = (props) => { setDialog_1_open(false); }; + const [New_GetCurrentPartnerClass_result, setNew_GetCurrentPartnerClass_result] = useState([]); + const [GetCurrentPartnerClass_api, setGetCurrentPartnerClass_api] = useState(); const [GetCurrentPartnerClass_message, setGetCurrentPartnerClass_message] = useState(); const [GetCurrentPartnerClass_result, setGetCurrentPartnerClass_result] = useState(); @@ -512,6 +515,35 @@ const Partner_Commande = (props) => { setGetCurrentPartnerClass_api("true"); setGetCurrentPartnerClass_result(res.data.message); + var new_data2 = []; + + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_internal_url = JSON.parse(x).internal_url; + var local_title = JSON.parse(x).title; + var local_is_published = JSON.parse(x).published; + + + //--- + var node = { + "_id": local_id, "id": localid, + "label": local_title, "internal_url": local_internal_url, + "title": local_title, + "ispublished": local_is_published, + }; + new_data2.push(node); + + // return {"_id": " + str(local_id) + ", "label": " + local_courrier_template_ref_interne + '" , "courrier_template_ref_interne": "' + local_courrier_template_ref_interne + '", "nom_champ_technique": "' + local_nom_champ_technique + '", "nom_champ_fonctionel": "' + local_nom_champ_fonctionel + '","valide": "1" }; + + }); + + + if (new_data2.length > 0) + setNew_GetCurrentPartnerClass_result(new_data2); + } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -1075,6 +1107,8 @@ const Partner_Commande = (props) => { }) } + const [New_Get_List_Partner_Clients_result, setNew_Get_List_Partner_Clients_result] = useState([]); + const [Get_List_Partner_Clients_api, setGet_List_Partner_Clients_api] = useState(); const [Get_List_Partner_Clients_message, setGet_List_Partner_Clients_message] = useState(); const [Get_List_Partner_Clients_result, setGet_List_Partner_Clients_result] = useState(); @@ -1095,6 +1129,31 @@ const Partner_Commande = (props) => { if (String(res.data.status) === String("true")) { setGet_List_Partner_Clients_api("true"); setGet_List_Partner_Clients_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_nom = JSON.parse(x).nom; + var local_raison_sociale = JSON.parse(x).raison_sociale; + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom, + "nom": local_nom, + "raison_sociale": local_raison_sociale, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_List_Partner_Clients_result(new_data2); + } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -1989,6 +2048,7 @@ const Partner_Commande = (props) => { }) } + const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]); const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState(); const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState(); @@ -2012,6 +2072,32 @@ const Partner_Commande = (props) => { //console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message); setGetall_Training_Employee_No_Filter_api("true"); setGetall_Training_Employee_No_Filter_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_nom = JSON.parse(x).nom; + var local_prenom = JSON.parse(x).prenom; + var local_ismanager = JSON.parse(x).ismanager; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom + " " + local_prenom, + "nom": local_nom, + "prenom": local_prenom, + "ismanager": local_ismanager + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Getall_Training_Employee_No_Filter_result(new_data2); } else { setGetall_Training_Employee_No_Filter_api("false"); @@ -2316,6 +2402,8 @@ const Partner_Commande = (props) => { const [p_add_cmd_header_description, setp_add_cmd_header_description] = useState(""); const [p_add_cmd_header_comment, setp_add_cmd_header_comment] = useState(""); const [p_add_cmd_header_vendeur_id, setp_add_cmd_header_vendeur_id] = useState(props.conntected_employee_id); + const [p_add_cmd_header_vendeur_id_label, setp_add_cmd_header_vendeur_id_label] = useState(); + const [p_add_cmd_header_date_cmd, setp_add_cmd_header_date_cmd] = useState(new Date().toLocaleDateString('fr-FR')); const [p_add_cmd_header_date_expiration_cmd, setp_add_cmd_header_date_expiration_cmd] = useState(date_today_90j.toLocaleDateString('fr-FR')); const [p_add_cmd_header_order_type, setp_add_cmd_header_order_type] = useState(""); @@ -2987,7 +3075,26 @@ const Partner_Commande = (props) => { {String(p_detail_header_statut_label).toLowerCase() !== "facturé" &&
    Article - { + // setp_champ_table(value.nom_champ_technique); + setp_add_line_item(value.internal_url); + setp_add_line_item_internal_url(value.internal_url); + Get_Class_Data(value.internal_url); + setp_add_line_item_title(value.title); + }} + + + renderInput={(params) => + } + /> + + {/* { ))} - + */}
    } @@ -3360,7 +3467,28 @@ const Partner_Commande = (props) => {
    Client - { + if (value && value._id) { + + setp_add_cmd_header_client_id(value._id); + Get_Givent_Partner_Client_Data(value._id); + + } + + }} + + renderInput={(params) => + } + /> + + + {/* { ))} - + */}
    @@ -3472,7 +3600,27 @@ const Partner_Commande = (props) => {
    Vendeur
    - { + if (value && value._id) { + setp_add_cmd_header_vendeur_id(value._id); + setp_add_cmd_header_vendeur_id_label(value.label); + + + } + }} + + renderInput={(params) => + } + /> + + {/* { ))} - + */}
    Conditions Paiement
    @@ -3890,7 +4038,7 @@ const Partner_Commande = (props) => { color: "black", fontSize: 14 }, - + '& .line--statut--selected': { backgroundColor: '#FBF2EF', color: 'black', diff --git a/src/styles/components/_displaypartnertrainingpagination.scss b/src/styles/components/_displaypartnertrainingpagination.scss index ec06667..f4b4a71 100644 --- a/src/styles/components/_displaypartnertrainingpagination.scss +++ b/src/styles/components/_displaypartnertrainingpagination.scss @@ -47,6 +47,11 @@ background: white; } + .hr_break { + border: 3px solid grey; + } + + @media only screen and (max-width: 600px) { text-align: left; font-size: small !important; @@ -1369,7 +1374,7 @@ .icon_excel { width: 10%; - } + } } @@ -1807,7 +1812,7 @@ .icon_excel { width: 10%; - } + } }