04/04/23 - 21h

recette2
cherif 2023-04-04 21:14:05 +02:00
parent eefea36bac
commit b432fe1b91
7 changed files with 290 additions and 68 deletions

View File

@ -481,12 +481,23 @@ const AddClassManual = (props) => {
function RecordTraining(event) {
var code = document.getElementsByName("external_code")[0].value;
if (code.length < 1) {
alert(" Le Champ 'code' est obligatoire")
return;
}
var title = document.getElementsByName("title")[0].value;
if (String(title).length > title_limite) {
alert(" Champ 'Titre', limite depassée !")
return;
}
if (title.length < 1) {
alert(" Le Champ 'Titre' est obligatoire")
return;
}
var trainer = document.getElementsByName("trainer")[0].value;
var presentiel = document.getElementsByName("presentiel")[0].value;
@ -518,7 +529,11 @@ const AddClassManual = (props) => {
alert(" Champ 'Objectif', limite depassée !")
return;
}
}
if (objectif.length < 1) {
alert(" Le Champ 'Objectif' est obligatoire")
return;
}
var programme = "";
@ -546,7 +561,10 @@ const AddClassManual = (props) => {
}
}
if (description.length < 1) {
alert(" Le Champ 'Description' est obligatoire")
return;
}
var mots_cle = "";
if (editorRef_mots_cle.current) {
@ -669,6 +687,18 @@ const AddClassManual = (props) => {
sendClassImage();
//alert(result['status'] + " -- " + myApiResponse + ' mess = ' + result['message']);
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/",
state: {
current_pack: props.currentpack, local_sub_menu: 'affichage', price: "",
period: "", new_pack: ""
}
});
window.location.reload();
}
})
.catch((error) => {
console.error('Error:', error);
@ -1366,7 +1396,7 @@ const AddClassManual = (props) => {
<div className="training_text">
<div className="plus_produit_desabled">
<div className="titre_training_text"> Description (max 1000 caractères) </div>
<div className="titre_training_text"> Description * (max 1000 caractères) </div>
<Editor
onInit={(evt, editor) => editorRef_description.current = editor}
initialValue={field_description}
@ -1399,7 +1429,7 @@ const AddClassManual = (props) => {
<div className="training_text" >
<div className="plus_produit_desabled">
<div className="titre_training_text"> Objectif (max 1000 caractères) </div>
<div className="titre_training_text"> Objectif* (max 1000 caractères) </div>
<Editor
onInit={(evt, editor) => editorRef_objectif.current = editor}
initialValue={field_objectif}

View File

@ -901,6 +901,7 @@ function GestionAdministrative(props) {
var email = cellValues.row.email;
//alert(" confirmation email = " + email);
SendInscriptionConfirmation(email);
}
const [SendInscriptionCancell_api, setSendInscriptionCancell_api] = useState();
@ -2214,6 +2215,59 @@ function GestionAdministrative(props) {
};
const [Resend_LMS_Credentials_With_Email_api, setResend_LMS_Credentials_With_Email_api] = useState();
const [Resend_LMS_Credentials_With_Email_result, setResend_LMS_Credentials_With_Email_result] = useState();
const [Resend_LMS_Credentials_With_Email_message, setResend_LMS_Credentials_With_Email_message] = useState();
function Resend_LMS_Credentials_With_Email(myemail) {
clean_old_messages();
const formData = new FormData();
const stored_cookie = getCookie('tokenmysypart');
formData.append("token", stored_cookie);
formData.append("session_id", mysession);
var local_mail = myemail;
var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
if (!local_mail.match(validRegex)) {
alert("L'adresse email est invalide. Impossible de renvoyer les identifiants");
return;
}
formData.append("email", local_mail);
formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/LMS_Credential_Sending_mail/",
{
method: 'POST',
body: formData,
}
)
.then((response) => response.json())
.then((result) => {
if (String(result['status']) === String("true")) {
//console.log('Success:', result['message']);
setResend_LMS_Credentials_With_Email_result(result['message']);
setResend_LMS_Credentials_With_Email_api("true");
}
else {
setResend_LMS_Credentials_With_Email_message(result['message']);
setResend_LMS_Credentials_With_Email_api("false");
}
})
.catch((error) => {
console.error('Error:', error);
setResend_LMS_Credentials_With_Email_api("false");
});
};
// Cette fonction nettoye les messages avant nouvelle action
function clean_old_messages() {
setResend_LMS_Credentials_api();
@ -4272,7 +4326,7 @@ function GestionAdministrative(props) {
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<Button variant="contained" className="bton_fermer" onClick={Resend_LMS_Credentials}> Renvoyer les Identifiants
<Button variant="contained" className="bton_fermer" onClick={Resend_LMS_Credentials}> (R)envoyer les Identifiants
</Button>
</div>

View File

@ -28,7 +28,7 @@ import OrderConfirmation from "./OrderConfirmation";
import Pricing from "./Pricing";
import {FcHome, FcButtingIn, FcDepartment, FcBullish, FcAddDatabase, FcFolder,
FcList, FcGraduationCap, FcMultipleDevices, FcCurrencyExchange,
FcMoneyTransfer, FcFeedback, FcKey } from "react-icons/fc";
FcMoneyTransfer, FcFeedback, FcKey, FcVideoCall } from "react-icons/fc";
//import { FcHome} from "react-icons/fc";
@ -640,7 +640,7 @@ const Partner = (props) => {
);
}}> MON HEBERGEMENT </div>}
}}> <FcVideoCall className="icone_menu"/> MON HEBERGEMENT </div> }
<hr className="my_hr" />
</div>

View File

@ -2732,7 +2732,9 @@ const Recherche_new_v2 = () => {
> publier mes formations </nav>
<nav className="header_menu" onClick={handleBlogMenu}> Le blog </nav>
<nav className="header_menu cta_hebergement" onClick={publiecatalogue}
> Héberger mes formations </nav>
<nav className="header_menu" onClick={handleBlogMenu}> Le blog </nav>

View File

@ -1578,5 +1578,5 @@
}
.css-6hp17o-MuiList-root-MuiMenu-list{
width: 10%;
width: 50%;
}

View File

@ -1913,6 +1913,10 @@
text-align: left;
cursor: pointer;
}
.sousmenu_hebergement_lms:hover {
color: white;
font-weight: 600;
}
.icone_menu {
width: 2rem;

View File

@ -3144,7 +3144,7 @@
justify-content: flex-end;
align-items: center;
padding: 0px;
gap: 10px;
gap: 3px;
position: absolute;
//width: 843px;
@ -3365,6 +3365,8 @@
flex: none;
order: 0;
flex-grow: 0;
font-weight: normal;
font-size: 12px;
}
@ -3394,7 +3396,8 @@
flex: none;
order: 0;
flex-grow: 0;
font-weight: normal;
font-size: 12px;
}
.rectangle_8 {
@ -5142,6 +5145,7 @@
.forma_et_tuto_mobile {
display: none;
}
.cta_publication {
/* Auto layout */
@ -5149,10 +5153,10 @@
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 5px;
gap: 10px;
padding: 2px 2px;
gap: 5px;
width: 134px;
width: 120px;
height: 56px;
/* Deep Blue */
@ -5167,6 +5171,37 @@
flex-grow: 0;
text-transform: uppercase;
color: white;
font-weight: normal;
font-size: 12px;
}
.cta_hebergement {
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 2px 2px;
gap: 5px;
width: 120px;
height: 56px;
/* Deep Blue */
background: rebeccapurple;
border-radius: 8px;
/* Inside auto layout */
flex: none;
order: 1;
flex-grow: 0;
text-transform: uppercase;
color: white;
font-weight: normal;
font-size: 12px;
}
}
@ -8035,10 +8070,10 @@
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 5px;
padding: 2px 2px;
gap: 10px;
width: 154px;
width: 130px;
height: 56px;
/* Deep Blue */
@ -8053,7 +8088,41 @@
flex-grow: 0;
text-transform: uppercase;
color: white;
font-size: 12px;
font-weight: 600;
}
.cta_hebergement {
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 5px;
gap: 10px;
width: 130px;
height: 56px;
/* Deep Blue */
background: rebeccapurple;
border-radius: 8px;
/* Inside auto layout */
flex: none;
order: 1;
flex-grow: 0;
text-transform: uppercase;
color: white;
font-size: 12px;
font-weight: 600;
}
}
@media only screen and (min-width: 1201px) and (max-width: 1919px) {
@ -10921,6 +10990,7 @@
.forma_et_tuto_mobile {
display: none;
}
.cta_publication {
/* Auto layout */
@ -10946,8 +11016,38 @@
flex-grow: 0;
text-transform: uppercase;
color: white;
font-weight: normal;
font-size: 14px;
}
.cta_hebergement {
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 5px;
gap: 10px;
width: 154px;
height: 56px;
/* Deep Blue */
background: rebeccapurple;
border-radius: 8px;
/* Inside auto layout */
flex: none;
order: 1;
flex-grow: 0;
text-transform: uppercase;
color: white;
font-weight: normal;
font-size: 14px;
}
}
@media only screen and (min-width: 1920px) {
@ -13823,6 +13923,7 @@
.forma_et_tuto_mobile {
display: none;
}
.cta_publication {
/* Auto layout */
@ -13848,6 +13949,37 @@
flex-grow: 0;
text-transform: uppercase;
color: white;
font-weight: normal;
font-size: 14px;
}
.cta_hebergement {
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px 5px;
gap: 10px;
width: 154px;
height: 56px;
/* Deep Blue */
background: rebeccapurple;
border-radius: 8px;
/* Inside auto layout */
flex: none;
order: 1;
flex-grow: 0;
text-transform: uppercase;
color: white;
font-weight: normal;
font-size: 14px;
}
}