20/01/2025 - 18h

recette2
cherif 2025-01-20 17:59:16 +01:00
parent ce494cb7e4
commit 83257f9bbb
14 changed files with 329 additions and 105 deletions

View File

@ -19,7 +19,7 @@ import Header from "./Header";
import UpgradeToPro from "./UpgradeToPro"
import Profil_Objectif from "./ProfilObjectif";
import { useLocation } from "react-router-dom";
import { FaHandPointRight } from "react-icons/fa";
import Intranet_Factures_Client from "./Intranet_Factures_Client";
import Intranet_Tous_Documents from "./Intranet_Tous_Documents";
import Modules_Mes_Documents from "./Modules_Mes_Documents";
@ -85,6 +85,11 @@ function Account() {
displayProfil_Objectif();
}
if (location && location.state && location.state.firstconnexion) {
setfirstConnexion(location.state.firstconnexion);
}
}, []);
@ -126,6 +131,8 @@ function Account() {
}
const [firstConnexion, setfirstConnexion] = useState("");
function logout_confirmation() {
/* si c'est une connexion partner qui est active */
@ -201,6 +208,7 @@ function Account() {
};
const [connected_user_data, setconnected_user_data] = useState();
function GetUserNameFromToken(event) {
@ -212,15 +220,17 @@ function Account() {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_user_account/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
// console.log(" In GetUserNameFromToken res.data.status = " + res.data.status);
// console.log(" In GetUserNameFromToken res.data.message = " + res.data.message);
if (String(res.data.status) === String("true")) {
setusername(JSON.parse(res.data.message).email);
if (JSON.parse(res.data.message).migrated &&
String(JSON.parse(res.data.message).migrated) === String("1")) {
setmigratedaccount(String(JSON.parse(res.data.message).migrated));
}
setconnected_user_data(JSON.parse(res.data.message));
//setmyApiResponse("true");
@ -236,7 +246,7 @@ function Account() {
}).catch((error) => {
console.warn('In GetUserNameFromToken Not good man :( mysearchtext = ');
console.warn('In GetUserNameFromToken Not good man :( mysearchtext = ', error);
//setmyApiResponse("false");
//setmyApimyApiMessage("")
})
@ -443,6 +453,18 @@ function Account() {
</div>
<div className="div_droite" style={{ border: 'none' }}>
{String(firstConnexion) === "1" &&
<div className="div_droite firstConnexion">
<div className="firstConnexion_text">
<b>Cher Utilisateur, c'est votre première connexion, </b> <br /> &nbsp;<br />
Nous sommes ravis de vous accueillir. Nous vous invitons à modifier votre mot de passe à partir du menu <i>"MES INFORMATIONS"</i> ==&gt; Pavé <i>"SECURITE"</i> puis <i>"MODIFIER"</i> <br /><br />
<Button onClick={(e) => setfirstConnexion()} className="firstConnexion_bton"> &nbsp; &nbsp;<FaHandPointRight /> &nbsp; Fermer</Button><br />
&nbsp; <br /> Merci.
</div>
</div>}
{String(myApiResponse) === String("true") && <div className="okUpdateData">
{result}

View File

@ -1060,7 +1060,7 @@ const AddClassManual = (props) => {
//document.getElementsByName("objectif")[0].value = "";
//document.getElementsByName("programme")[0].value = "";
//document.getElementsByName("prerequis")[0].value = "";
alert(" La formation a été correctement supprimée.");
// alert(" La formation a été correctement supprimée.");
history.push({
pathname: "/Partner/",

View File

@ -630,6 +630,9 @@ const AddParnerClient = (props) => {
setformedit_mode_invoice("1");
}
setp_new_pwd("");
setp_conf_new_login("");
}, [props.client_mail,]);
@ -3112,6 +3115,8 @@ const AddParnerClient = (props) => {
const [Dialog_mysy_intranet_account_open, setDialog_mysy_intranet_account_open] = React.useState(false);
const Dialog_mysy_intranet_account_handleClose = () => {
setp_new_pwd("");
setp_conf_new_login("");
setDialog_mysy_intranet_account_open(false)
};
@ -3134,13 +3139,13 @@ const AddParnerClient = (props) => {
const handleClickShowPassword = () => {
if (currentpawdvisible == false) {
document.getElementsByName("new_pwd")[0].type = "text";
document.getElementsByName("conf_new_login")[0].type = "text";
document.getElementsByName("new_pwd011")[0].type = "text";
document.getElementsByName("conf_new_login011")[0].type = "text";
setcurrentpawdvisible(true);
}
else if (currentpawdvisible == true) {
document.getElementsByName("new_pwd")[0].type = "password";
document.getElementsByName("conf_new_login")[0].type = "password";
document.getElementsByName("new_pwd011")[0].type = "password";
document.getElementsByName("conf_new_login011")[0].type = "password";
setcurrentpawdvisible(false);
}
};
@ -3254,7 +3259,7 @@ const AddParnerClient = (props) => {
<div className="add_partner_client">
{/*** Affichage des messages d'alerte*/}
display_alert_mysy = {display_alert_mysy} <br />
{display_alert_mysy && String(display_alert_mysy) === "1" &&
<Module_Alert_Confirmation alert_message={alert_message}
alert_type={alert_type}
@ -3320,8 +3325,8 @@ const AddParnerClient = (props) => {
<TextField
autoFocus
margin="dense"
id="new_pwd"
name="new_pwd"
id="new_pwd011"
name="new_pwd011"
type="password"
//label="Prix Unitaire"
@ -3333,6 +3338,13 @@ const AddParnerClient = (props) => {
}
}
inputProps={{
autocomplete: 'new-password',
form: {
autocomplete: 'off',
},
}}
/>
<nav className="show_pwd_div" onClick={handleClickShowPassword}>
{currentpawdvisible ? <Visibility /> : <VisibilityOff />}
@ -3343,8 +3355,8 @@ const AddParnerClient = (props) => {
<TextField
autoFocus
margin="dense"
id="conf_new_login"
name="conf_new_login"
id="conf_new_login011"
name="conf_new_login011"
type="password"
//label="Prix Unitaire"
@ -3356,8 +3368,14 @@ const AddParnerClient = (props) => {
}
}
inputProps={{
autocomplete: 'new-password',
form: {
autocomplete: 'off',
},
}}
/>
<Button onClick={Generate_Pwd} className="bton_enreg_dialog" style={{ "width": "100%", "margin": "0px", "background": "orange" }}>Générer automatiquement un mot de passe &nbsp; <LiaDharmachakraSolid style={{ "fontSize": "medium" }} /> </Button>
<Button onClick={Generate_Pwd} className="bton_generer_pwd" style={{ "width": "auto", "margin": "0px", "background": "orange" }}>Générer un mot de passe &nbsp; <LiaDharmachakraSolid style={{ "fontSize": "medium" }} /> </Button>
</div>
</DialogContent>
@ -3386,7 +3404,7 @@ const AddParnerClient = (props) => {
<Button onClick={Add_Update_Client_Intranet_Login_Pass_Data} className="bton_enreg_dialog">Mettre à jour &nbsp;<FcInfo /></Button>}
{!p_client_intranet_account_id || String(p_client_intranet_account_id).length <= 3 &&
<Button onClick={Add_Update_Client_Intranet_Login_Pass_Data} className="bton_enreg_dialog">Création Compte Intranet &nbsp;<FcInfo /></Button>}
<Button onClick={Add_Update_Client_Intranet_Login_Pass_Data} className="bton_enreg_dialog">Créer le Compte Intranet &nbsp;<FcInfo /></Button>}
</a>
</div>
@ -3955,17 +3973,27 @@ const AddParnerClient = (props) => {
</nav>
<Tooltip className="tooltip_css" id="tooltip_intranet_account" style={{ "fontSize": "10px" }} />
<a data-tooltip-id="tooltip_intranet_account" data-tooltip-html="Création & Gestion compte intranet">
<nav onClick={(e) => {
<div style={{ width: '100%', float: 'left' }}>
<nav style={{ width: '50%', float: "left" }}>
Compte Intranet <FcInfo /> &nbsp;
</nav>
<nav style={{ width: '50%', float: "left" }}>
<nav style={{
cursor: 'pointer',
float: "left", textAlign: 'center'
}} onClick={(e) => {
setp_conf_new_login("");
setDialog_mysy_intranet_account_open(true);
}}
>
Compte Intranet <FcInfo /> &nbsp; <MdManageAccounts style={{ fontSize: '20px' }} /> &nbsp;
}}>
<MdManageAccounts style={{ fontSize: '20px' }} /> &nbsp;
{p_client_intranet_account_id && String(p_client_intranet_account_id).length > 3 && <CheckCircleOutlineIcon style={{ color: 'green' }} />}
{!p_client_intranet_account_id || String(p_client_intranet_account_id).length <= 3 && <BlockIcon style={{ color: 'orangered' }} />}
{p_client_intranet_account_id && String(p_client_intranet_account_id).length > 3 && <CheckCircleOutlineIcon style={{ color: 'green', fontSize: '14px' }} />}
{!p_client_intranet_account_id || String(p_client_intranet_account_id).length <= 3 && <BlockIcon style={{ color: 'orangered', fontSize: '14px' }} />}
</nav>
</nav>
<br /></nav>
</div>
</a>
</div>

View File

@ -799,7 +799,7 @@ const Intranet_Mes_Stagiaires = (props) => {
form.append("client_rattachement_id", props.partner_client_id);
}
console.log(" ### Getall_TrainingParticipant form = ", form)
// console.log(" ### Getall_TrainingParticipant form = ", form)
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Statgaire_List_Partner_with_filter/";

View File

@ -89,14 +89,16 @@ function Module_Connexion_Intranet_Client() {
var partner_connexion = "";
var url_login = "";
url_login = process.env.REACT_APP_API_URL + "myclass/api/login/";
setmenucompte("user");
partner_connexion = "user";
// console.log( " ### full url_login = ", url_login)
// Gestion des Cookies
const stored_partner = cookie_part.tokenmysypart;
const stored_user = cookie.tokenmysych;
const formData = new FormData();
@ -119,6 +121,7 @@ function Module_Connexion_Intranet_Client() {
// si c'est une connexion user qui est active
if (typeof (stored_user) != "undefined" && String(stored_user) !== String('')) {
//alert(" c'est une connexion USERR qui est active");
@ -139,43 +142,6 @@ function Module_Connexion_Intranet_Client() {
var val = result['status'];
if (String(val) === String("true")) {
if (String(partner_connexion) === String("partner")) {
// recuperation et stockage des cookies sur les droit d'acces
setCookie("tokenmysypart", JSON.parse(result['message']).token, { path: '/' });
var acces_right_token_name = String(JSON.parse(result['message']).token) + "_uar";
var acces_right_token_val = JSON.parse(result['message']).user_access_right;
//acces_right_token_val = [{'key1':'val1'}, {'key2':'val2'}];
///console.log(" acces_right_token_val = ", acces_right_token_val);
setCookie_acces_right(acces_right_token_name, acces_right_token_val, { path: '/' });
// recuperation et stockage des cookie sur les paramettres de connexion
var returned_connexion_data = JSON.parse(result['message'])
if (returned_connexion_data.list_connexion_context) {
const new_data = returned_connexion_data.list_connexion_context.map((x) => {
// recuperation et stockage des cookies sur les droit d'acces
if (x['code'] && x['code_value']) {
setCookie(String(x['code']), String(x['code_value']), { path: '/' });
}
});
}
//setCookie("tokenmysypart", result['message']);
history.push("/Partner");
}
else if (String(partner_connexion) === String("user")) {
setCookie("tokenmysych", result['message']);
// Verification vers quelle page les renvoyer
@ -185,10 +151,15 @@ function Module_Connexion_Intranet_Client() {
}
else {
// Redirection par defaut vers la compte utilisateur
history.push("/mysy-user-account");
}
history.push({
pathname: "/mysy-user-account",
state: {
firstconnexion: String(result['firstconnexion'])
}
});
}
}
else {
setisconnected("false");
setmyApimyApiMessage(result['message']);
@ -202,6 +173,7 @@ function Module_Connexion_Intranet_Client() {
});
}
const location = useLocation();
useEffect(() => {

View File

@ -206,6 +206,8 @@ function SignIn() {
else if (String(partner_connexion) === String("user")) {
setCookie("tokenmysych", result['message']);
// Verification vers quelle page les renvoyer
if (obj === "training" && String(objid).length > 0) {
// redirection vers l'affichage d'une formation
@ -213,7 +215,14 @@ function SignIn() {
}
else {
// Redirection par defaut vers la compte utilisateur
history.push("/mysy-user-account");
history.push({
pathname: "/mysy-user-account",
state: {
firstconnexion: String(result['firstconnexion'])
}
});
}
}
}
@ -496,9 +505,7 @@ function SignIn() {
<div className="display_screen_600_901">
<div className="div_centre_master">
<div className="div_centre_002">
<Button variant="outlined" onClick={menu_user_account} className="signin_menu"
id="user_account" name="user_account"
style={{ "float": "left", "textAlign": "center", "height": "3rem" }}>Utilisateur</Button>
<Button variant="outlined" onClick={menu_parter_account} className="signin_menu"
id="partner_account" name="partner_account"

View File

@ -96,6 +96,7 @@
height: 25%;
border-radius: 10rem !important;
}
.sousmenu_btn {
font-family: "verdana", "Quicksand", "Signika", sans-serif;
text-align: center;
@ -116,9 +117,11 @@
h4 {
display: inline-block;
font-size: xx-large; /*or whatever you want*/
font-size: xx-large;
/*or whatever you want*/
color: white;
}
.text-box {
position: absolute;
height: 100%;
@ -126,6 +129,7 @@
width: 100%;
vertical-align: middle;
}
.text-box:before {
content: "";
display: inline-block;
@ -305,6 +309,46 @@
margin-left: auto;
margin-right: auto;
}
.firstConnexion_bton {
background: #81bc3a;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 2px;
padding-bottom: 2px;
font-size: small;
width: 10rem;
}
.firstConnexion_bton:hover {
background: #81bc3a !important;
}
.firstConnexion_text {
background: transparent;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 10px;
padding-bottom: 10px;
font-size: small;
}
.firstConnexion {
-webkit-box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 50%);
box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 50%);
width: 100%;
margin-bottom: 2px;
background: #fbeee6;
border: none;
margin-bottom: 2rem;
}
.firstConnexion_div_btn {
text-align: center;
}
}
@media only screen and (min-width: 601px) and (max-width: 991px) {
@ -341,7 +385,8 @@
h4 {
display: inline-block;
font-size: xx-large; /*or whatever you want*/
font-size: xx-large;
/*or whatever you want*/
color: white;
}
@ -352,6 +397,7 @@
width: 100%;
vertical-align: middle;
}
.text-box:before {
content: "";
display: inline-block;
@ -613,6 +659,46 @@
margin-left: auto;
margin-right: auto;
}
.firstConnexion_bton {
background: #81bc3a;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 2px;
padding-bottom: 2px;
font-size: small;
width: 10rem;
}
.firstConnexion_bton:hover {
background: #81bc3a !important;
}
.firstConnexion_text {
background: transparent;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 10px;
padding-bottom: 10px;
font-size: small;
}
.firstConnexion {
-webkit-box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 50%);
box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 50%);
width: 100%;
float: left;
margin-bottom: 2px;
background: #fbeee6;
border: none;
margin-bottom: 2rem;
}
.firstConnexion_div_btn {
text-align: center;
}
}
@media only screen and (min-width: 992px) and (max-width: 1199px) {
@ -648,7 +734,8 @@
h4 {
display: inline-block;
font-size: xx-large; /*or whatever you want*/
font-size: xx-large;
/*or whatever you want*/
color: white;
}
@ -659,6 +746,7 @@
width: 100%;
vertical-align: middle;
}
.text-box:before {
content: "";
display: inline-block;
@ -681,6 +769,7 @@
margin-bottom: 1rem;
margin-left: 20%;
}
.sousmenu_btn {
font-family: "verdana", "Quicksand", "Signika", sans-serif;
text-align: center;
@ -919,6 +1008,46 @@
margin-left: auto;
margin-right: auto;
}
.firstConnexion_bton {
background: #81bc3a;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 2px;
padding-bottom: 2px;
font-size: small;
width: 10rem;
}
.firstConnexion_bton:hover {
background: #81bc3a !important;
}
.firstConnexion_text {
background: transparent;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 10px;
padding-bottom: 10px;
font-size: small;
}
.firstConnexion {
-webkit-box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 50%);
box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 50%);
width: 100%;
float: left;
margin-bottom: 2px;
background: #fbeee6;
border: none;
margin-bottom: 2rem;
}
.firstConnexion_div_btn {
text-align: center;
}
}
@media only screen and (min-width: 1200px) {
@ -937,6 +1066,7 @@
}
font-size: large !important;
.img_logo {
display: block;
height: auto;
@ -945,6 +1075,7 @@
max-width: 18%;
max-height: 5rem;
}
.img_user {
margin-left: auto;
margin-right: auto;
@ -956,7 +1087,8 @@
h4 {
display: inline-block;
font-size: xx-large; /*or whatever you want*/
font-size: xx-large;
/*or whatever you want*/
color: white;
}
@ -967,6 +1099,7 @@
width: 100%;
vertical-align: middle;
}
.text-box:before {
content: "";
display: inline-block;
@ -1229,6 +1362,47 @@
margin-left: auto;
margin-right: auto;
}
.firstConnexion_bton {
background: #b0ce8a;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 2px;
padding-bottom: 2px;
font-size: small;
width: 8rem;
margin-left: 10px;
}
.firstConnexion_bton:hover {
background: #81bc3a !important;
}
.firstConnexion_text {
background: transparent;
padding-left: 15px;
padding-right: 15px;
border-radius: 5px;
padding-top: 10px;
padding-bottom: 10px;
font-size: small;
}
.firstConnexion {
-webkit-box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 50%);
box-shadow: 1px 1px 10px 1px rgba(243, 190, 190, 0.5);
width: 100%;
float: left;
margin-bottom: 2px;
background: #fbeee6;
border: none;
margin-bottom: 2rem;
}
.firstConnexion_div_btn {
text-align: center;
}
}
// end media

View File

@ -745,6 +745,7 @@
// end media
.client_menu {
font-size: 12px !important;
min-width: 15rem !important;

View File

@ -2768,6 +2768,22 @@
}
// end media
.bton_generer_pwd {
border-radius: 5rem;
font-size: small;
background: #bc843a !important;
text-align: center;
height: 2.5rem;
width: 80%;
color: white;
margin-left: 10px;
margin-right: 10px;
font-style: italic;
}
.mode_affichage_selected {
text-underline-offset: 8px;
text-decoration: green wavy underline;

View File

@ -533,7 +533,7 @@
}
.signin_menu {
width: 50%;
width: 100%;
text-align: left;
font-size: 0.8rem;
//font-weight: bold;
@ -544,8 +544,8 @@
//border: 1px solid black;
}
.signin_menu:hover:active,
.signin_menu:hover {
.signin_menuuu:hover:active,
.signin_menuuu:hover {
transform: scale(1.01);
/* Scaling button to 0.98 to its original size */
box-shadow: 3px 2px 22px 1px rgba(0, 0, 0, 0.24);
@ -1140,7 +1140,7 @@
}
.signin_menu {
width: 50%;
width: 100%;
text-align: left;
font-size: 0.7rem;
//font-weight: bold;
@ -1151,8 +1151,8 @@
//border: 1px solid black;
}
.signin_menu:hover:active,
.signin_menu:hover {
.signin_menuuu:hover:active,
.signin_menuuu:hover {
transform: scale(1.01);
/* Scaling button to 0.98 to its original size */
box-shadow: 3px 2px 22px 1px rgba(0, 0, 0, 0.24);
@ -1716,7 +1716,7 @@
}
.signin_menu {
width: 50%;
width: 100%;
text-align: left;
font-size: 0.8rem;
//font-weight: bold;
@ -1727,8 +1727,8 @@
//border: 1px solid black;
}
.signin_menu:hover:active,
.signin_menu:hover {
.signin_menuuu:hover:active,
.signin_menuuu:hover {
transform: scale(1.01);
/* Scaling button to 0.98 to its original size */
box-shadow: 3px 2px 22px 1px rgba(0, 0, 0, 0.24);
@ -2315,7 +2315,7 @@
}
.signin_menu {
width: 50%;
width: 100%;
text-align: left;
font-size: 1rem;
//font-weight: bold;
@ -2326,8 +2326,8 @@
//border: 1px solid black;
}
.signin_menu:hover:active,
.signin_menu:hover {
.signin_menuuu:hover:active,
.signin_menuuu:hover {
transform: scale(1.01);
/* Scaling button to 0.98 to its original size */
box-shadow: 3px 2px 22px 1px rgba(0, 0, 0, 0.24);

View File

@ -1,5 +1,9 @@
.updateuserinfo {
width: 100%;
float: left;
@media only screen and (max-width: 600px) {
text-align: left;
font-size: small !important;