21/05/23 - 10h

recette2
cherif 2023-05-21 09:59:47 +02:00
parent 957a2b4c7d
commit a40827560e
7 changed files with 224 additions and 109 deletions

View File

@ -257,6 +257,8 @@ const AddClassManual = (props) => {
setfield_datelieu("");
setfield_zone_diffusion("");
setmyApiResponse();
Get_List_Domaines();
Get_List_Metiers();
fillfield();
if (props.mytrainingclass['class_external_code']) {
@ -388,10 +390,21 @@ const AddClassManual = (props) => {
if (mylocaltraining.domaine) {
document.getElementsByName("domaine")[0].value = mylocaltraining.domaine;
setmytrainingdomaine(mylocaltraining.domaine);
console.log(" ### mylocaltraining.domaine = ", mylocaltraining.domaine);
}
else
document.getElementsByName("domaine")[0].value = "";
setmytrainingdomaine("");
if (mylocaltraining.metier) {
setmytrainingmetier(mylocaltraining.metier);
console.log(" ### mylocaltraining.metier = ", mylocaltraining.metier);
}
else
setmytrainingmetier("");
if (mylocaltraining.duration)
document.getElementsByName("duree")[0].value = mylocaltraining.duration;
@ -406,9 +419,6 @@ const AddClassManual = (props) => {
document.getElementsByName("metier")[0].value = "";
if (mylocaltraining.metier)
document.getElementsByName("metier")[0].value = mylocaltraining.metier;
document.getElementsByName("note")[0].value = "";
if (mylocaltraining.note)
@ -514,6 +524,7 @@ const AddClassManual = (props) => {
var trainingSupport = document.getElementsByName("training_support")[0].value;
var banniereImg = document.getElementsByName("class_banner_img_url")[0].value;
var pourqui = "";
if (editorRef_pourqui.current) {
pourqui = editorRef_pourqui.current.getContent();
@ -592,9 +603,9 @@ const AddClassManual = (props) => {
local_mot_cle = mots_cle;
}
console.log(" ## local_mot_cle = ", local_mot_cle);
//console.log(" ## local_mot_cle = ", local_mot_cle);
var words = local_mot_cle.split(';');
console.log(" ## words = ", words);
//console.log(" ## words = ", words);
if (words.length > 3) {
alert(" Il a plus de 3 mots clés. le max autorisé est 3");
@ -686,7 +697,7 @@ const AddClassManual = (props) => {
//alert(result['status'] + " -- " + myApiResponse + ' mess = ' + result['message']);
if(String(result['status']) === "true" ){
if (String(result['status']) === "true") {
alert(" La formation a été correctement ajoutée. Vous allez être redirigé vers la liste des formations.");
history.push({
pathname: "/Partner/",
@ -711,6 +722,93 @@ const AddClassManual = (props) => {
}
const [mytrainingmetier, setmytrainingmetier] = useState("");
const [Get_List_Metiers_api, setGet_List_Metiers_api] = useState();
const [Get_List_Metiers_message, setGet_List_Metiers_message] = useState();
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/";
fetch(myurl,
{
method: 'POST',
body: form,
})
.then((data) => data.json())
.then((data) => {
//console.log(' IN Get_List_Metiers Success:', data['message'], "data['status'] = ", data['status']);
if (String(data['status']) === String("true")) {
setGet_List_Metiers_api("true");
setGet_List_Metiers_result(data['message']);
}
else {
setGet_List_Metiers_api("false");
setGet_List_Metiers_message(data['message']);
}
}).catch((error) => {
console.error('Error Get_List_Metiers :', error);
setGet_List_Metiers_api("false");
});
}
const handleChangeMetierTraining = (event) => {
const name = event.target.name;
const value = event.target.value;
setmytrainingmetier(value);
setdatamodification("1");
}
const [mytrainingdomaine, setmytrainingdomaine] = useState("");
const [Get_List_Domaines_api, setGet_List_Domaines_api] = useState();
const [Get_List_Domaines_message, setGet_List_Domaines_message] = useState();
const [Get_List_Domaines_result, setGet_List_Domaines_result] = useState();
function Get_List_Domaines() {
var form = new FormData();
var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_List_domaine_formation/";
fetch(myurl,
{
method: 'POST',
body: form,
})
.then((data) => data.json())
.then((data) => {
//console.log(' IN Get_List_Domaines Success:', data['message'], "data['status'] = ", data['status']);
if (String(data['status']) === String("true")) {
setGet_List_Domaines_api("true");
setGet_List_Domaines_result(data['message']);
}
else {
setGet_List_Domaines_api("false");
setGet_List_Domaines_message(data['message']);
}
}).catch((error) => {
console.error('Error Get_List_Domaines :', error);
setGet_List_Domaines_api("false");
});
}
const handleChangeDomaineTraining = (event) => {
const name = event.target.name;
const value = event.target.value;
setmytrainingdomaine(value);
setdatamodification("1");
}
function alertactivecompte() {
//alert(" ispending = ===== " + props.ispending);
@ -1213,6 +1311,7 @@ const AddClassManual = (props) => {
<div className="training_caract">
<TextField
required
select
name="domaine"
label="Domaine"
InputLabelProps={{
@ -1220,7 +1319,37 @@ const AddClassManual = (props) => {
}}
disabled={false}
className="disabled_style"
/>
onChange={handleChangeDomaineTraining}
value={mytrainingdomaine}
>
{Get_List_Domaines_result && Get_List_Domaines_result.map((option) => (
<MenuItem key={option} value={option}>
{option} &nbsp; <br />
</MenuItem>
))}
</TextField>
</div>
<div className="training_caract">
<TextField
name="metier"
label="metier"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
onChange={handleChangeMetierTraining}
value={mytrainingmetier}
>
{Get_List_Metiers_result && Get_List_Metiers_result.map((option) => (
<MenuItem key={option} value={option}>
{option} &nbsp; <br />
</MenuItem>
))}
</TextField>
</div>
<div className="training_caract">
@ -1291,20 +1420,6 @@ const AddClassManual = (props) => {
/>
</div>
<div className="training_caract">
<TextField
name="metier"
label="metier"
type="text"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
/>
</div>
<div className="training_caract">
<TextField
name="note"

View File

@ -1409,57 +1409,57 @@ const DisplayDetailClass_new_v2 = (props) => {
{GetCurrentClass_result && GetCurrentClass_result.slice(0, 5).map((formation) => (
<li style={{ "height": "2.8rem" }}>
{(JSON.parse(formation).session_ondemande) && (JSON.parse(formation).session_ondemande) === "1" && <nav> Sessions de formation à la demande</nav>}
{(JSON.parse(formation).session_ondemande) && (JSON.parse(formation).session_ondemande) === "1" && <nav> Sessions de formation à la demande</nav>}
{( !(JSON.parse(formation).session_ondemande) || (JSON.parse(formation).session_ondemande) === "0") && <nav>
{(JSON.parse(formation).distantiel) === "1" && (JSON.parse(formation).presentiel) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)} au
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
{(!(JSON.parse(formation).session_ondemande) || (JSON.parse(formation).session_ondemande) === "0") && <nav>
{(JSON.parse(formation).distantiel) === "1" && (JSON.parse(formation).presentiel) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)} au
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
{(JSON.parse(formation).distantiel) === "1" && (JSON.parse(formation).presentiel) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
{(JSON.parse(formation).distantiel) === "1" && (JSON.parse(formation).presentiel) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)} au
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)} au
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;{(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;{(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp; {(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp; {(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
</nav>}
</nav>}
</li>
))}
@ -1888,55 +1888,55 @@ const DisplayDetailClass_new_v2 = (props) => {
{(JSON.parse(formation).session_ondemande) && (JSON.parse(formation).session_ondemande) === "1" && <nav> Sessions de formation à la demande</nav>}
{( !(JSON.parse(formation).session_ondemande) || (JSON.parse(formation).session_ondemande) === "0") && <nav>
{(!(JSON.parse(formation).session_ondemande) || (JSON.parse(formation).session_ondemande) === "0") && <nav>
{(JSON.parse(formation).distantiel) === "1" && (JSON.parse(formation).presentiel) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
{(JSON.parse(formation).distantiel) === "1" && (JSON.parse(formation).presentiel) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
{(JSON.parse(formation).distantiel) === "1" && (JSON.parse(formation).presentiel) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b> A Distance</b> et <b>En Présentiel </b>- {(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).distantiel) === "1" && ((JSON.parse(formation).presentiel) === "0" || !(JSON.parse(formation).presentiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp;
{(JSON.parse(formation).date_fin).substring(0, 10)} <b>A Distance </b> </nav>
}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;{(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
{(JSON.parse(formation).date_debut).substring(0, 10)}&nbsp; au&nbsp;{(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp; {(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
{(JSON.parse(formation).presentiel) === "1" && ((JSON.parse(formation).distantiel) === "0" || !(JSON.parse(formation).distantiel)) &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
<nav>
Le &nbsp; {(JSON.parse(formation).date_fin).substring(0, 10)} <b>En Présentiel </b> -
{(JSON.parse(formation).adresse)} &nbsp;{(JSON.parse(formation).code_postal)}
</nav>}
</nav>}
</nav>}
</li>
))}

View File

@ -290,7 +290,7 @@ const Formation_copie = (props) => {
<div className="div_row">
{String(props.formation.price).length == 9 &&
<div className="training_price" > <i> En attente</i> &nbsp;
<div className="training_price" > <i> Prix : Non communiqué</i> &nbsp;
</div>
}

View File

@ -331,7 +331,7 @@ const Formation = (props) => {
<div className="div_row">
{String(props.formation.price).length == 9 &&
<div className="training_price" > <i> En attente</i> &nbsp;
<div className="training_price" > <i>Prix : Non communiqué</i> &nbsp;
</div>
}

View File

@ -292,7 +292,7 @@ const Formation_Cartouche_Com = (props) => {
<div className="div_row">
{String(props.formation.price).length == 9 &&
<div className="training_price" > <i> En attente</i> &nbsp;
<div className="training_price" > <i> Prix : Non communiqué</i> &nbsp;
</div>
}

View File

@ -3498,8 +3498,8 @@ function GestionAdministrative(props) {
axios.post(myurl, form).then(res => {
console.log(" In One_Create_Participant res.data.status = " + res.data.status);
console.log(" In One_Create_Participant res.data.message r_class = " + res.data.message);
//console.log(" In One_Create_Participant res.data.status = " + res.data.status);
//console.log(" In One_Create_Participant res.data.message r_class = " + res.data.message);
if (String(res.data.status) === "true") {
setOne_Create_Participant_api("true");

View File

@ -1053,7 +1053,7 @@ const Recherche_new_v2 = () => {
var form = new FormData();
fetch(
process.env.REACT_APP_API_URL + "myclass/api/get_List_domaine_metier/",
process.env.REACT_APP_API_URL + "myclass/api/get_List_domaine_metier/",
{
method: 'POST',