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,13 +481,24 @@ 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;
}
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;
var distentiel = document.getElementsByName("distentiel")[0].value;
@ -514,18 +525,22 @@ const AddClassManual = (props) => {
var objectif = "";
if (editorRef_objectif.current) {
objectif = editorRef_objectif.current.getContent();
if( parse(objectif.replace(/(<([^>]+)>)/ig, '')).length > editorRef_objectif_limite){
if (parse(objectif.replace(/(<([^>]+)>)/ig, '')).length > editorRef_objectif_limite) {
alert(" Champ 'Objectif', limite depassée !")
return;
}
}
if (objectif.length < 1) {
alert(" Le Champ 'Objectif' est obligatoire")
return;
}
var programme = "";
if (editorRef_programme.current) {
programme = editorRef_programme.current.getContent();
if( parse(programme.replace(/(<([^>]+)>)/ig, '')).length > editorRef_programme_limite){
if (parse(programme.replace(/(<([^>]+)>)/ig, '')).length > editorRef_programme_limite) {
alert(" Champ 'Programme', limite depassée !")
return;
}
@ -540,13 +555,16 @@ const AddClassManual = (props) => {
if (editorRef_description.current) {
description = editorRef_description.current.getContent();
if( parse(description.replace(/(<([^>]+)>)/ig, '')).length > editorRef_description_limite){
if (parse(description.replace(/(<([^>]+)>)/ig, '')).length > editorRef_description_limite) {
alert(" Champ 'Description', limite depassée !")
return;
}
}
if (description.length < 1) {
alert(" Le Champ 'Description' est obligatoire")
return;
}
var mots_cle = "";
if (editorRef_mots_cle.current) {
@ -565,21 +583,21 @@ const AddClassManual = (props) => {
// Verification si il y a plus de 3 mot clés separés par des ";"
mots_cle = mots_cle.replace( /(<([^>]+)>)/ig, '');
mots_cle = mots_cle.replace(/(<([^>]+)>)/ig, '');
mots_cle = mots_cle.replace("&nbsp;", '');
var local_mot_cle = "";
if( mots_cle.endsWith(";")){
local_mot_cle = mots_cle.substring(0, mots_cle.length-1);
}else{
if (mots_cle.endsWith(";")) {
local_mot_cle = mots_cle.substring(0, mots_cle.length - 1);
} else {
local_mot_cle = mots_cle;
}
console.log(" ## local_mot_cle = ", local_mot_cle);
var words = local_mot_cle.split(';');
var words = local_mot_cle.split(';');
console.log(" ## words = ", words);
if (words.length > 3) {
alert(" Il a plus de 3 mots clés. le max autorisé est 3");
return;
@ -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);
@ -1160,7 +1190,7 @@ const AddClassManual = (props) => {
<div className="training_caract">
<TextField
<TextField
name="training_support"
id="training_support"
select
@ -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

@ -948,7 +948,7 @@ const Recherche_new_v2 = () => {
const [suggestedcities, setsuggestedcities] = useState([]);
useEffect(() => {
@ -987,14 +987,14 @@ const Recherche_new_v2 = () => {
if (categorie && String(categorie).length > 0) {
getClassByMetier_categorie(categorie);
}
else {
DisplayXfirstClas(result.data);
}
}
fetchData();
@ -1375,15 +1375,15 @@ const Recherche_new_v2 = () => {
if( String(my_local_user_connect) === "1"){
if (String(my_local_user_connect) === "1") {
form.append("token", stored_user);
form.append("connection_type", "user");
}
else if ( String(my_local_part_connect) === "1"){
else if (String(my_local_part_connect) === "1") {
form.append("token", stored_part);
form.append("connection_type", "partner");
}
else{
else {
form.append("token", "");
form.append("connection_type", "");
}
@ -1413,7 +1413,7 @@ const Recherche_new_v2 = () => {
}
else {
myurl = process.env.REACT_APP_API_URL + "myclass/api/recherche_text_simple/";
}
//alert("myurl = "+myurl);
@ -1480,20 +1480,20 @@ const Recherche_new_v2 = () => {
if (typeof (NewSearchText) === "undefined" || String(NewSearchText) === '') {
crit_SearchText = "";
myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class/";
} else {
crit_SearchText = NewSearchText;
myurl = process.env.REACT_APP_API_URL + "myclass/api/recherche_text_simple/";
}
var form = new FormData();
form.append("search_text", crit_SearchText);
var my_local_user_connect;
var my_local_part_connect;
@ -1508,20 +1508,20 @@ const Recherche_new_v2 = () => {
} else {
my_local_part_connect = 1;
}
if( String(my_local_user_connect) === "1"){
if (String(my_local_user_connect) === "1") {
form.append("token", stored_user);
form.append("connection_type", "user");
}
else if ( String(my_local_part_connect) === "1"){
else if (String(my_local_part_connect) === "1") {
form.append("token", stored_part);
form.append("connection_type", "partner");
}
else{
else {
form.append("token", "");
form.append("connection_type", "");
}
form.append("certif", "");
form.append("support", "");
form.append("type", "");
@ -1563,7 +1563,7 @@ const Recherche_new_v2 = () => {
if (String(res.data.status) != String("false")) {
//console.log(" In test res.data.status = " + res.data.status);
//console.log(" In DisplayXfirstClas res.data.message = " + res.data.message);
setmyApiResponse("True");
setResult(res.data.message)
// textInput.current.focus();
@ -2544,7 +2544,7 @@ const Recherche_new_v2 = () => {
onClose={ProduitMenu_Close}
open={Boolean(ProduitMenu)}
style={{ "top": "2rem" }} >
<MenuItem onClick={handleProduitService} className="mymenu_item">
<MenuItem onClick={handleProduitService} className="mymenu_item">
<button className='bton_menu_v2'>Nos produits & Services </button></MenuItem>
<MenuItem onClick={handleAvis} className="mymenu_item">
@ -2728,11 +2728,13 @@ const Recherche_new_v2 = () => {
<div className="Menu_Header">
<nav className="header_menu cta_publication" onClick={publiecatalogue}
> publier mes formations </nav>
<nav className="header_menu cta_publication" onClick={publiecatalogue}
<nav className="header_menu" onClick={handleBlogMenu}> Le blog </nav>
> publier mes formations </nav>
<nav className="header_menu cta_hebergement" onClick={publiecatalogue}
> Héberger mes formations </nav>
<nav className="header_menu" onClick={handleBlogMenu}> Le blog </nav>
@ -2941,7 +2943,7 @@ const Recherche_new_v2 = () => {
</div>
</div>
</div>
@ -3292,7 +3294,7 @@ const Recherche_new_v2 = () => {
<div className="filter_metier_sous_block_content_txt">
<div className="filter_metier_sous_block_content_txt_formation">
Santé naturelle
Santé naturelle
</div>
<div className="filter_metier_sous_block_content_txt_nb">
@ -3301,7 +3303,7 @@ const Recherche_new_v2 = () => {
</div>
</div>
{!displayAllmetiers && <div className="filter_metier_sous_block" onClick={DisplayAllmetier}>
@ -3355,7 +3357,7 @@ const Recherche_new_v2 = () => {
<div className="filter_metier_sous_block_content_txt">
<div className="filter_metier_sous_block_content_txt_formation">
Sport
Sport
</div>
<div className="filter_metier_sous_block_content_txt_nb">

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,22 +5145,23 @@
.forma_et_tuto_mobile {
display: none;
}
.cta_publication{
.cta_publication {
/* Auto layout */
display: flex;
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 */
background: red;
background: red;
border-radius: 8px;
/* Inside auto layout */
@ -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;
}
}
@ -8028,22 +8063,22 @@
display: none;
}
.cta_publication{
.cta_publication {
/* Auto layout */
display: flex;
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 */
background: red;
background: red;
border-radius: 8px;
/* Inside auto layout */
@ -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,7 +10990,8 @@
.forma_et_tuto_mobile {
display: none;
}
.cta_publication{
.cta_publication {
/* Auto layout */
display: flex;
@ -10936,7 +11006,7 @@
/* Deep Blue */
background: red;
background: red;
border-radius: 8px;
/* Inside 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,7 +13923,8 @@
.forma_et_tuto_mobile {
display: none;
}
.cta_publication{
.cta_publication {
/* Auto layout */
display: flex;
@ -13838,7 +13939,7 @@
/* Deep Blue */
background: red;
background: red;
border-radius: 8px;
/* Inside 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;
}
}