recette2
cherif 2024-01-05 16:36:28 +01:00
parent 8bca5e98a4
commit cf053cfbf1
5 changed files with 324 additions and 124 deletions

View File

@ -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) => {
<div className="training_caract">
<Autocomplete
<Autocomplete
disablePortal
name="certif"
id="certif"
@ -1927,11 +1937,11 @@ const AddClassManual = (props) => {
}
}}
renderInput={(params) => <TextField {...params} label="ligible CPF" />
renderInput={(params) => <TextField {...params} label="Eligible CPF" />
}
/>
{/* <TextField
{/* <TextField
name="cpf"
select
label="Eligible CPF"
@ -2214,7 +2224,11 @@ const AddClassManual = (props) => {
onChange={(event, value) => {
if (value && value.domaine) {
setmytrainingdomaine(value.domaine);
setmytrainingmetier("-");
setdatamodification("1");
} else {
setmytrainingdomaine("-");
setmytrainingmetier("-");
}
}}
@ -2224,7 +2238,32 @@ const AddClassManual = (props) => {
</div>
<div className="training_caract">
{mytrainingdomaine && String(mytrainingdomaine).trim() !== "-" && <div className="training_caract">
<Autocomplete
disablePortal
name="metier"
id="metier"
className="disabled_style"
options={New_Get_List_Metiers_result.filter((local_mymanager) => local_mymanager.domaine === String(String(mytrainingdomaine).trim()))}
value={mytrainingmetier}
onChange={(event, value) => {
if (value && value.metier) {
setmytrainingmetier(value.metier);
setdatamodification("1");
}
}}
renderInput={(params) => <TextField {...params} label="Métier" />
}
/>
</div>}
{(!mytrainingdomaine || String(mytrainingdomaine).trim().length <= 0 || String(mytrainingdomaine).trim() === "-") && <div className="training_caract">
<Autocomplete
disablePortal
@ -2235,6 +2274,7 @@ const AddClassManual = (props) => {
value={mytrainingmetier}
onChange={(event, value) => {
if (value && value.metier) {
setmytrainingmetier(value.metier);
@ -2246,7 +2286,7 @@ const AddClassManual = (props) => {
}
/>
</div>
</div>}
{/*<div className="training_caract">
<TextField

View File

@ -4620,7 +4620,8 @@ const DisplayPartnerSession = (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,
};

View File

@ -1898,16 +1898,102 @@ const DistplayPartnerTraningsPage = (props) => {
</div>
</div>
<div className="div_row"> &nbsp; </div>
<div className="div_row">
{selectionModel && selectionModel.length >= 1 && <div className="block_en_mass">
<nav >Traitement en masse </nav>
&nbsp;
<TextField
select
InputLabelProps={{
shrink: true,
}}
inputProps={{ min: "0", max: "1", step: "1" }}
disabled={false}
className="block_en_mass_select"
value={actionmass_ftion_val}
onChange={actionmass_ftion}
>
<MenuItem value="" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Action &nbsp;&nbsp;</MenuItem>
<MenuItem value="publier" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Publier &nbsp;</MenuItem>
<MenuItem value="depublier" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Dépublier &nbsp;</MenuItem>
<MenuItem value="dupliquer" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Dupliquer &nbsp;</MenuItem>
<MenuItem value="supprimer" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Supprimer &nbsp;</MenuItem>
</TextField>
{actionmass_ftion_val && <nav className='block_en_mass_bton_action'>
<Popup
trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>
<FcAcceptDatabase /> Traiter
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
<font color="red"> Confirmer l'action <b> {actionmass_ftion_val} </b> en masse pour {selectionModel.length} lignes.
</font>
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
actionmass_ftion_Traitemet();
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
</nav>
}
</div>}
</div>
{selectionModel && selectionModel.length >= 1 && <div className="div_row" style={{ "border": "None" }}>
<hr className="hr_break" />
</div>}
&nbsp;
<div className='div_row' >
<Button variant="outlined" onClick={changeHandler2} className="detail_class_submenu" style={{
"background": "#c8cfd5",
"minWidth": "15rem", "color": "black", "width": "auto"
}}
id='menu_import_formation' name='menu_import_formation'>Choisir un fichier et importer des formations &nbsp; <GrDocumentCsv style={{"fontSize":"large"}}/> <SendIcon />
id='menu_import_formation' name='menu_import_formation'>Choisir un fichier et importer des formations &nbsp; <GrDocumentCsv style={{ "fontSize": "large" }} /> <SendIcon />
</Button>
<input type="file"
accept=".csv"
ref={hiddenFileInput_formation}
@ -1921,9 +2007,9 @@ const DistplayPartnerTraningsPage = (props) => {
id='menu_import_participant' name='menu_import_participant' style={{ "marginRight": "10px" }}>Ajout 1 Formation &nbsp;
<img src={add_plus} alt="ajout session" className="icon_plus" />
</Button>
<br/>
{formation_file_name && <nav className="okUpdateData"><i>{formation_file_name}</i></nav>}
<br />
{formation_file_name && <nav className="okUpdateData"><i>{formation_file_name}</i></nav>}
<a href='/sample/template_import_formations.csv' download><nav style={{ "fontSize": "14px" }}>Télécharger un fichier modèle</nav></a>
@ -1950,93 +2036,13 @@ const DistplayPartnerTraningsPage = (props) => {
<li> ...</li>
</ul>
<a href='/sample/MySy_Import_formation_csv.pdf' download>Télécharger le guide complet pour plus d'informations</a><br />
<br/>
<br />
</div>
<div style={{ "width": "50%" }}> &nbsp; </div>
</div>
</div>
<br />
<div className="div_row">
{selectionModel && selectionModel.length >= 1 && <div className="block_en_mass">
<nav >Traitement en masse </nav>
&nbsp;
<TextField
select
InputLabelProps={{
shrink: true,
}}
inputProps={{ min: "0", max: "1", step: "1" }}
disabled={false}
className="block_en_mass_select"
value={actionmass_ftion_val}
onChange={actionmass_ftion}
>
<MenuItem value="" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Action &nbsp;&nbsp;</MenuItem>
<MenuItem value="publier" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Publier &nbsp;</MenuItem>
<MenuItem value="depublier" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Dépublier &nbsp;</MenuItem>
<MenuItem value="dupliquer" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Dupliquer &nbsp;</MenuItem>
<MenuItem value="supprimer" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Supprimer &nbsp;</MenuItem>
</TextField>
{actionmass_ftion_val && <nav className='block_en_mass_bton_action'>
<Popup
trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>
<FcAcceptDatabase /> Traiter
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
<font color="red"> Confirmer l'action <b> {actionmass_ftion_val} </b> en masse pour {selectionModel.length} lignes.
</font>
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
actionmass_ftion_Traitemet();
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
</nav>
}
</div>}
</div>
</div>

View File

@ -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é" && <div className="session_caract_Dialog" > Article
<TextField
<Autocomplete
disablePortal
name="ref_article"
id="ref_article"
fullWidth
options={New_GetCurrentPartnerClass_result}
onChange={(event, value) => {
// 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) => <TextField {...params} label="" />
}
/>
{/*<TextField
required
autoFocus
margin="dense"
@ -3022,7 +3129,7 @@ const Partner_Commande = (props) => {
</MenuItem>
))}
</TextField>
</TextField>*/}
</div>}
@ -3360,7 +3467,28 @@ const Partner_Commande = (props) => {
<DialogContent>
<div className="session_caract_Dialog" > Client
<TextField
<Autocomplete
disablePortal
id="ref_client"
className="session_caract_Dialog"
fullWidth
options={New_Get_List_Partner_Clients_result}
onChange={(event, value) => {
if (value && value._id) {
setp_add_cmd_header_client_id(value._id);
Get_Givent_Partner_Client_Data(value._id);
}
}}
renderInput={(params) => <TextField {...params} label="" />
}
/>
{/*<TextField
required
autoFocus
margin="dense"
@ -3384,7 +3512,7 @@ const Partner_Commande = (props) => {
</MenuItem>
))}
</TextField>
</TextField>*/}
</div>
@ -3472,7 +3600,27 @@ const Partner_Commande = (props) => {
<div className="session_caract_Dialog" > Vendeur <br />
<TextField
<Autocomplete
disablePortal
name="ref_vendeur"
id="ref_vendeur"
fullWidth
options={New_Getall_Training_Employee_No_Filter_result}
value={p_add_cmd_header_vendeur_id_label}
onChange={(event, value) => {
if (value && value._id) {
setp_add_cmd_header_vendeur_id(value._id);
setp_add_cmd_header_vendeur_id_label(value.label);
}
}}
renderInput={(params) => <TextField {...params} label="" />
}
/>
{/*<TextField
margin="dense"
id="ref_vendeur"
@ -3495,7 +3643,7 @@ const Partner_Commande = (props) => {
</MenuItem>
))}
</TextField>
</TextField>*/}
</div>
<div className="session_caract_Dialog" > Conditions Paiement <br />
@ -3890,7 +4038,7 @@ const Partner_Commande = (props) => {
color: "black",
fontSize: 14
},
'& .line--statut--selected': {
backgroundColor: '#FBF2EF',
color: 'black',

View File

@ -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%;
}
}
}