15/01/2024 - 22h
parent
1ac4dc1c79
commit
27e2d7cdfc
|
@ -853,7 +853,11 @@ const Employes = (props) => {
|
|||
setp_one_detail_resp_hierarchie_nom('');
|
||||
setp_one_detail_resp_hierarchie_prenom('');
|
||||
|
||||
setp_detail_lms_login('');
|
||||
|
||||
setp_detail_user_login('');
|
||||
setp_detail_user_login_locked('');
|
||||
|
||||
setp_detail_lms_virtualhost_url('');
|
||||
setp_detail_mysy_lms_user_id('');
|
||||
setp_detail_lms_account_disable('');
|
||||
|
@ -904,6 +908,11 @@ const Employes = (props) => {
|
|||
const [p_detail_resp_hierarchie_nom, setp_detail_resp_hierarchie_nom] = useState("");
|
||||
const [p_detail_resp_hierarchie_prenom, setp_detail_resp_hierarchie_prenom] = useState("");
|
||||
|
||||
|
||||
const [p_detail_lms_login, setp_detail_lms_login] = useState("");
|
||||
|
||||
const [p_detail_user_login_locked, setp_detail_user_login_locked] = useState("");
|
||||
|
||||
const [p_detail_user_login, setp_detail_user_login] = useState("");
|
||||
const [p_detail_lms_virtualhost_url, setp_detail_lms_virtualhost_url] = useState("");
|
||||
const [p_detail_mysy_lms_user_id, setp_detail_mysy_lms_user_id] = useState("");
|
||||
|
@ -1049,6 +1058,15 @@ const Employes = (props) => {
|
|||
setp_detail_fonction(mylocal_employe.fonction);
|
||||
}
|
||||
|
||||
if (mylocal_employe.lms_username) {
|
||||
setp_detail_lms_login(mylocal_employe.lms_username);
|
||||
|
||||
} else {
|
||||
|
||||
setp_detail_lms_login("");
|
||||
}
|
||||
|
||||
|
||||
if (mylocal_employe.user_login) {
|
||||
setp_detail_user_login(mylocal_employe.user_login);
|
||||
setp_new_login(mylocal_employe.user_login)
|
||||
|
@ -1064,6 +1082,13 @@ const Employes = (props) => {
|
|||
setp_detail_lms_virtualhost_url('');
|
||||
}
|
||||
|
||||
if (mylocal_employe.locked) {
|
||||
setp_detail_user_login_locked(mylocal_employe.locked);
|
||||
|
||||
} else {
|
||||
setp_detail_user_login_locked('');
|
||||
}
|
||||
|
||||
if (mylocal_employe.mysy_lms_user_id) {
|
||||
setp_detail_mysy_lms_user_id(mylocal_employe.mysy_lms_user_id);
|
||||
|
||||
|
@ -1552,6 +1577,11 @@ const Employes = (props) => {
|
|||
function disable_Employee_DetailFields() {
|
||||
setemployee_data_edit_mode("0");
|
||||
|
||||
if (document.getElementsByName("detail_lms_login")[0]) {
|
||||
document.getElementsByName("detail_lms_login")[0].disabled = true;
|
||||
document.getElementsByName("detail_lms_login")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("detail_nom")[0]) {
|
||||
document.getElementsByName("detail_nom")[0].disabled = true;
|
||||
document.getElementsByName("detail_nom")[0].style.backgroundColor = "#ECEFF1";
|
||||
|
@ -1724,8 +1754,8 @@ const Employes = (props) => {
|
|||
document.getElementsByName("detail_ismanager")[0].disabled = false;
|
||||
document.getElementsByName("detail_ismanager")[0].style.backgroundColor = "#FFFFFF";
|
||||
|
||||
document.getElementsByName("detail_user_login")[0].disabled = false;
|
||||
document.getElementsByName("detail_user_login")[0].style.backgroundColor = "#FFFFFF";
|
||||
//document.getElementsByName("detail_user_login")[0].disabled = false;
|
||||
//document.getElementsByName("detail_user_login")[0].style.backgroundColor = "#FFFFFF";
|
||||
|
||||
document.getElementsByName("detail_resp_hierarchie_id")[0].disabled = false;
|
||||
document.getElementsByName("detail_resp_hierarchie_id")[0].style.backgroundColor = "#FFFFFF";
|
||||
|
@ -1741,6 +1771,8 @@ const Employes = (props) => {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -4370,6 +4402,85 @@ const Employes = (props) => {
|
|||
}
|
||||
|
||||
|
||||
const [Locked_MySy_Trainer_Account_api, setLocked_MySy_Trainer_Account_api] = useState();
|
||||
const [Locked_MySy_Trainer_Account_message, setLocked_MySy_Trainer_Account_message] = useState();
|
||||
const [Locked_MySy_Trainer_Account_result, setLocked_MySy_Trainer_Account_result] = useState();
|
||||
function Locked_MySy_Trainer_Account() {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("rh_id", selected_id);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Lock_partner_account_From_Rh_Id/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Locked_MySy_Trainer_Account res.data.status = " + res.data.status);
|
||||
//console.log(" In Locked_MySy_Trainer_Account res.data.message r_class = " + res.data.message);
|
||||
setLocked_MySy_Trainer_Account_api("true");
|
||||
setLocked_MySy_Trainer_Account_result(res.data.message);
|
||||
handleClick_edit_employee_From_Line(gridline_id);
|
||||
alert(res.data.message);
|
||||
}
|
||||
else {
|
||||
setLocked_MySy_Trainer_Account_api("false");
|
||||
setLocked_MySy_Trainer_Account_message(res.data.message);
|
||||
alert(res.data.message)
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Locked_MySy_Trainer_Account = ', error);
|
||||
setLocked_MySy_Trainer_Account_api("false");
|
||||
alert(" Impossible de désactiver le compte utilisateur de l'employé");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
const [UnLocked_MySy_Trainer_Account_api, setUnLocked_MySy_Trainer_Account_api] = useState();
|
||||
const [UnLocked_MySy_Trainer_Account_message, setUnLocked_MySy_Trainer_Account_message] = useState();
|
||||
const [UnLocked_MySy_Trainer_Account_result, setUnLocked_MySy_Trainer_Account_result] = useState();
|
||||
function UnLocked_MySy_Trainer_Account() {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("rh_id", selected_id);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Unlock_partner_account_From_Rh_Id/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In UnLocked_MySy_Trainer_Account res.data.status = " + res.data.status);
|
||||
//console.log(" In UnLocked_MySy_Trainer_Account res.data.message r_class = " + res.data.message);
|
||||
setUnLocked_MySy_Trainer_Account_api("true");
|
||||
setUnLocked_MySy_Trainer_Account_result(res.data.message);
|
||||
handleClick_edit_employee_From_Line(gridline_id);
|
||||
alert(res.data.message);
|
||||
}
|
||||
else {
|
||||
setUnLocked_MySy_Trainer_Account_api("false");
|
||||
setUnLocked_MySy_Trainer_Account_message(res.data.message);
|
||||
alert(res.data.message)
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( UnLocked_MySy_Trainer_Account = ', error);
|
||||
setUnLocked_MySy_Trainer_Account_api("false");
|
||||
alert(" Impossible de réactiver le compte utilisateur de l'employé");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const [Disable_Lms_Trainer_Account_api, setDisable_Lms_Trainer_Account_api] = useState();
|
||||
const [Disable_Lms_Trainer_Account_message, setDisable_Lms_Trainer_Account_message] = useState();
|
||||
const [Disable_Lms_Trainer_Account_result, setDisable_Lms_Trainer_Account_result] = useState();
|
||||
|
@ -6167,7 +6278,7 @@ const Employes = (props) => {
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "50%", "float": "left", "borderRight":"thick double #32a1ce" }}>
|
||||
<div style={{ "width": "45%", "float": "left", "borderRight": "thick double #32a1ce" }}>
|
||||
<div className="div_row" style={{ "border": "None", "fontSize": "20px", "fontWeight": "600", "padding": "5px" }}>
|
||||
Login & Mot de passe
|
||||
</div>
|
||||
|
@ -6180,14 +6291,15 @@ const Employes = (props) => {
|
|||
/!\ Cet utilisateur n'a pas de login & mot de passe <FcInfo />
|
||||
</a>
|
||||
</div>}
|
||||
{String(employee_data_edit_mode) !== "1" && <div className="session_caract">
|
||||
<div style={{ "paddingLeft": "10px" }}>
|
||||
<Tooltip className="tooltip_css" id="deb_inscription" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="deb_inscription" data-tooltip-html="Pour créer un login & pwd pour cet utilisateur, cliquez sur 'Editer.<br/>
|
||||
Pensez également lui accorder les niveaux d'accès nécessaires à partir du bouton <i>'DROITS D'ACCES'</i> ">
|
||||
Login <FcInfo /><br />
|
||||
</a>
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, background: "#ECEFF1", color: "black" }}
|
||||
|
||||
required
|
||||
name="detail_user_login"
|
||||
id="detail_user_login"
|
||||
|
@ -6199,47 +6311,269 @@ const Employes = (props) => {
|
|||
className="disabled_style"
|
||||
value={p_detail_user_login}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{String(employee_data_edit_mode) === "1" && String(p_detail_user_login) === "" && <div style={{ "paddingLeft": "10px" }}>
|
||||
<Button variant="contained" className="bton_action1" onClick={Dialog_1_handle_change_login_pwd}> Créer login & pwd <FcPodiumWithAudience style={{ "fontSize": "x-large" }} />
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
|
||||
{String(employee_data_edit_mode) === "1" && String(p_detail_user_login) !== "" && <div style={{ "paddingLeft": "10px" }}>
|
||||
<Button variant="contained" className="bton_action1" onClick={Dialog_1_handle_change_login_pwd}> M.A.J PWD <FcPodiumWithAudience style={{ "fontSize": "x-large" }} />
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
|
||||
{String(employee_data_edit_mode) === "1" && String(p_detail_user_login) !== "" && String(p_detail_user_login_locked) !== "1"
|
||||
&& <div style={{ "paddingLeft": "10px" }}>
|
||||
<Popup
|
||||
trigger={
|
||||
<Button variant="contained" className="bton_action1" > Désactiver compte <FcPodiumWithAudience style={{ "fontSize": "x-large" }} />
|
||||
</Button>
|
||||
|
||||
|
||||
}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération,<i><font color="red"> l'utilisateur ne pourra plus se connecter au système </font></i>. <br />
|
||||
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
|
||||
Locked_MySy_Trainer_Account(event);
|
||||
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>
|
||||
</div>
|
||||
}
|
||||
|
||||
{String(employee_data_edit_mode) === "1" && String(p_detail_user_login) !== "" && String(p_detail_user_login_locked) === "1"
|
||||
&& <div style={{ "paddingLeft": "10px" }}>
|
||||
<Popup
|
||||
trigger={
|
||||
<Button variant="contained" className="bton_action1" > Réactiver compte <FcPodiumWithAudience style={{ "fontSize": "x-large" }} />
|
||||
</Button>
|
||||
|
||||
|
||||
}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération,<i><font color="red"> le compte utilisateur sera réactivé </font></i>. <br />
|
||||
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
|
||||
UnLocked_MySy_Trainer_Account(event);
|
||||
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>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
|
||||
<div className="div_row" style={{ "border": "None", "fontSize": "20px", "fontWeight": "600", "padding": "5px" }}>
|
||||
Accès E-Learning
|
||||
</div>
|
||||
<div style={{ "paddingLeft": "10px" }}>
|
||||
{String(p_detail_user_login) === "" && <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
|
||||
|
||||
</div>}
|
||||
|
||||
|
||||
|
||||
{String(employee_data_edit_mode) === "1" && <div className="session_caract">
|
||||
|
||||
Login <br />
|
||||
Login E-Learning <br />
|
||||
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, width: "100%" }}
|
||||
required
|
||||
name="detail_user_login"
|
||||
id="detail_user_login"
|
||||
name="detail_lms_login"
|
||||
id="detail_lms_login"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_detail_user_login}
|
||||
/> <Button variant="contained" className="bton_create_login" onClick={Dialog_1_handle_change_login_pwd}> Créer / M.A.J login & pwd <FcPodiumWithAudience style={{ "fontSize": "x-large" }} />
|
||||
</Button> <br />
|
||||
value={p_detail_lms_login}
|
||||
/>
|
||||
|
||||
|
||||
</div>}
|
||||
</div>
|
||||
|
||||
<div style={{ "width": "40%", "float": "right" }}>
|
||||
|
||||
<div className="div_row" style={{ "border": "None", "fontSize": "20px", "fontWeight": "600", "padding": "5px" }}>
|
||||
Accès E-Learning
|
||||
</div>
|
||||
{String(p_detail_lms_account_disable) === "1" || (
|
||||
String(p_detail_mysy_lms_user_id) === "" && String(p_detail_lms_virtualhost_url) === ""
|
||||
&& String(p_detail_user_login) !== "") && <Button variant="contained" className="bton_create_login" onClick={Create_Lms_Trainer_Account}> Créer accès E-Learning
|
||||
</Button>} <br />
|
||||
&& String(p_detail_user_login) !== "") &&
|
||||
<div style={{ "paddingLeft": "10px" }}>
|
||||
<Popup
|
||||
trigger={
|
||||
<Button variant="contained" className="bton_action1"> Créer accès E-Learning
|
||||
</Button>
|
||||
|
||||
}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération,<i><font color="blue"> un compte utilisateur va être créé sur la plateforme E-Learning pour cet utilisateur </font></i>. <br />
|
||||
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
|
||||
Create_Lms_Trainer_Account(event);
|
||||
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>
|
||||
</div>}
|
||||
|
||||
{String(p_detail_lms_account_disable) !== "1" &&
|
||||
String(p_detail_mysy_lms_user_id) !== "" && String(p_detail_lms_virtualhost_url) !== ""
|
||||
&& String(p_detail_user_login) !== "" && <Button variant="contained" className="bton_create_login" onClick={Disable_Lms_Trainer_Account}> Desactiver accès E-Learning
|
||||
</Button>}
|
||||
&& String(p_detail_user_login) !== "" &&
|
||||
<div style={{ "paddingLeft": "10px" }}>
|
||||
<Popup
|
||||
trigger={
|
||||
<Button variant="contained" className="bton_action1" > Desactiver accès E-Learning
|
||||
</Button>
|
||||
|
||||
}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération,<i><font color="red"> le compte utilisateur sur la platforme E-Learning sera désactivé pour cet employé </font></i>. <br />
|
||||
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
|
||||
Disable_Lms_Trainer_Account(event);
|
||||
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>
|
||||
</div>}
|
||||
</div>
|
||||
|
||||
<div className="div_row">
|
||||
|
|
|
@ -2238,6 +2238,16 @@
|
|||
|
||||
// end media
|
||||
|
||||
.bton_action1 {
|
||||
border-radius: 5rem;
|
||||
font-size: small;
|
||||
background: #81BC3A !important;
|
||||
text-align: center;
|
||||
width: 40%;
|
||||
color: white;
|
||||
font-size: 11px;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.session_caract_Dialog {
|
||||
width: 100%;
|
||||
|
@ -2317,6 +2327,7 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.MuiMenu-paper {
|
||||
|
|
Loading…
Reference in New Issue