diff --git a/src/components/Employes.js b/src/components/Employes.js index 12a93db..f69d65e 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -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) => { -
+
Login & Mot de passe
@@ -6180,14 +6291,15 @@ const Employes = (props) => { /!\ Cet utilisateur n'a pas de login & mot de passe  
} - {String(employee_data_edit_mode) !== "1" &&
+
Login  
{ className="disabled_style" value={p_detail_user_login} /> -
} +
- {String(employee_data_edit_mode) === "1" &&
+ {String(employee_data_edit_mode) === "1" && String(p_detail_user_login) === "" &&
+ +
+ } - Login
+ {String(employee_data_edit_mode) === "1" && String(p_detail_user_login) !== "" &&
+ +
+ } + + {String(employee_data_edit_mode) === "1" && String(p_detail_user_login) !== "" && String(p_detail_user_login_locked) !== "1" + &&
+ Désactiver compte + + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, l'utilisateur ne pourra plus se connecter au système .
+ + +
+
+
+ + +
+
+ +
+
+
+ )} +
+
+ } + + {String(employee_data_edit_mode) === "1" && String(p_detail_user_login) !== "" && String(p_detail_user_login_locked) === "1" + &&
+ Réactiver compte + + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le compte utilisateur sera réactivé .
+ + +
+
+
+ + +
+
+ +
+
+
+ )} +
+
+ } +
+ +
+ +
+ Accès E-Learning +
+
+ {String(p_detail_user_login) === "" &&
+   +
} + + Login E-Learning
 
+ value={p_detail_lms_login} + /> - -
} -
- -
- -
- Accès E-Learning
{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) !== "") && }  
+ && String(p_detail_user_login) !== "") && +
+ Créer accès E-Learning   + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, un compte utilisateur va être créé sur la plateforme E-Learning pour cet utilisateur .
+ + +
+
+
+ + +
+
+ +
+
+
+ )} +
+
} {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) !== "" && } + && String(p_detail_user_login) !== "" && +
+ Desactiver accès E-Learning   + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le compte utilisateur sur la platforme E-Learning sera désactivé pour cet employé .
+ + +
+
+
+ + +
+
+ +
+
+
+ )} +
+
}
diff --git a/src/styles/components/_employes.scss b/src/styles/components/_employes.scss index c926cfd..d174b54 100644 --- a/src/styles/components/_employes.scss +++ b/src/styles/components/_employes.scss @@ -3,8 +3,8 @@ .tooltip_css { background: #81BC3A; z-index: 9999; - } - + } + .Mui-disabled { font-size: small !important; padding: 0px !important; @@ -226,7 +226,7 @@ padding: 5px; } - + .css-1x5jdmq { padding: 6px !important; @@ -288,7 +288,7 @@ margin-right: 10px; } - + .bton_edit { border-radius: 5rem; @@ -414,9 +414,9 @@ font-family: "verdana", "Quicksand", "Signika", sans-serif; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 100% !important; font-size: x-small !important; @@ -424,11 +424,11 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 40% !important; font-size: xx-large !important; @@ -437,33 +437,33 @@ margin-bottom: 2px !important; text-align: right; cursor: pointer; - } - - - .div_row { + } + + + .div_row { float: left; border-width: 0.01rem; width: 100%; - + border-radius: 1rem; - } - - .div_row_gauche { + } + + .div_row_gauche { float: left; width: 100%; border-radius: 1rem; text-align: left; - } - - .div_row_droite { + } + + .div_row_droite { float: left; width: 100%; border-radius: 1rem; text-align: left; - - } - - .bton_suppr { + + } + + .bton_suppr { background: transparent; color: red; border-radius: 5rem; @@ -474,9 +474,9 @@ margin-left: 10px; margin-right: 10px; margin-bottom: 1rem !important; - } - - .bton_enreg { + } + + .bton_enreg { border-radius: 5rem; font-size: small; background: #81BC3A !important; @@ -485,10 +485,10 @@ width: 100%; color: white; margin-bottom: 1rem !important; - } - + } - .bton_create_login { + + .bton_create_login { border-radius: 5rem; font-size: small; background: #81BC3A !important; @@ -497,9 +497,9 @@ width: 100%; color: white; margin-bottom: 1rem !important; - } + } - .bton_edit { + .bton_edit { border-radius: 5rem; font-size: small; background: black !important; @@ -508,9 +508,9 @@ width: 100%; color: white; margin-bottom: 1rem !important; - } - - .bton_annule { + } + + .bton_annule { border-radius: 5rem; font-size: small; background: lightgray !important; @@ -519,35 +519,35 @@ width: 100%; color: black; margin-bottom: 1rem !important; - } - - - .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { + } + + + .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { border-color: transparent !important; border-radius: 20px !important; - } - - .disabled_style { + } + + .disabled_style { //background-color: #ECEFF1; font-size: small !important; color: black; width: 100% !important; height: 3.5rem !important; - + //border: none !important; border-radius: 5px; background: white; border: solid gainsboro 1px; - - } - - .training_caract { + + } + + .training_caract { width: 100%; - + float: left; - } - - .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { + } + + .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { font: inherit; letter-spacing: inherit; color: currentColor; @@ -567,36 +567,36 @@ height: 3rem !important; padding: 0 !important; padding-left: 5px !important; - } - - .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { + } + + .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { padding: 1px !important; - } - - .block_en_mass { + } + + .block_en_mass { width: 100%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_select { + } + + .block_en_mass_select { width: 100%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_bton_action { + } + + .block_en_mass_bton_action { width: 100%; float: left; margin-bottom: 1rem; padding-top: 0.5rem !important; - } + } - .div_row_list_pj{ + .div_row_list_pj { width: 100%; border-left: 3mm ridge rgba(211, 220, 50, .6); float: left; - } + } } @@ -991,9 +991,9 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 40% !important; font-size: x-small !important; @@ -1001,11 +1001,11 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 5% !important; font-size: large !important; @@ -1015,36 +1015,36 @@ text-align: right; cursor: pointer; margin-top: 1rem !important; - } - - .div_row { + } + + .div_row { float: left; //border: 1px solid black; border-width: 0.01rem; width: 100%; //margin-bottom: 1rem; border-radius: 1rem; - } - - .div_row_gauche { + } + + .div_row_gauche { float: left; // border:1px solid black; // border-width:0.01rem; width: 45%; border-radius: 1rem; text-align: left; - } - - .div_row_droite { + } + + .div_row_droite { float: right; //border:1px solid black; //border-width:0.01rem; width: 45%; border-radius: 1rem; text-align: right; - } - - .bton_suppr { + } + + .bton_suppr { background: transparent; color: red; border-radius: 5rem; @@ -1055,9 +1055,9 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - .bton_enreg { + } + + .bton_enreg { border-radius: 5rem; font-size: small; background: #81BC3A !important; @@ -1068,9 +1068,9 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } + } - .bton_create_login { + .bton_create_login { border-radius: 5rem; font-size: small; background: #81BC3A !important; @@ -1081,9 +1081,9 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - .bton_edit { + } + + .bton_edit { border-radius: 5rem; font-size: small; background: black !important; @@ -1094,9 +1094,9 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - .bton_annule { + } + + .bton_annule { border-radius: 5rem; font-size: small; background: lightgray !important; @@ -1107,15 +1107,15 @@ margin-left: 10px; margin-right: 10px; min-width: 15rem; - } - - - .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { + } + + + .css-1t10bd6-MuiFormControl-root-MuiTextField-root fieldset { border-color: transparent !important; border-radius: 20px !important; - } - - .disabled_style { + } + + .disabled_style { //background-color: #ECEFF1; font-size: small !important; color: black; @@ -1128,15 +1128,15 @@ border: solid gainsboro 1px; padding-top: 0.5rem !important; border: none !important; - } - - .training_caract { + } + + .training_caract { width: 30%; padding: 5px; float: left; - } - - .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { + } + + .css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input .Mui-disabled { font: inherit; letter-spacing: inherit; color: currentColor; @@ -1156,36 +1156,36 @@ height: 3rem !important; padding: 0 !important; padding-left: 5px !important; - } - - .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { + } + + .css-11u53oe-MuiSelect-select-MuiInputBase-input-MuiOutlinedInput-input { padding: 1px !important; - } - - .block_en_mass { + } + + .block_en_mass { width: 50%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_select { + } + + .block_en_mass_select { width: 45%; float: left; margin-bottom: 1rem; - } - - .block_en_mass_bton_action { + } + + .block_en_mass_bton_action { width: 45%; float: left; margin-bottom: 1rem; padding-top: 0.5rem !important; - } + } - .div_row_list_pj{ + .div_row_list_pj { width: 50%; border-left: 3mm ridge rgba(211, 220, 50, .6); float: left; - } + } } @@ -1631,9 +1631,9 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 40% !important; font-size: x-small !important; @@ -1641,11 +1641,11 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 5% !important; font-size: xx-large !important; @@ -1654,8 +1654,8 @@ margin-bottom: 2px !important; text-align: right; cursor: pointer; - } - + } + .titre1 { font-family: "Quicksand", "Signika", sans-serif; @@ -1667,13 +1667,13 @@ font-style: italic; background-color: gray; font-weight: normal; - } + } - .div_row_list_pj{ + .div_row_list_pj { width: 30%; border-left: 3mm ridge rgba(211, 220, 50, .6); float: left; - } + } } @@ -1842,7 +1842,7 @@ padding-left: 5px !important; } - + .selectsession { width: 90%; @@ -2140,7 +2140,7 @@ .bton_supprime_image_class:hover { box-shadow: 5px 1px 5px 1px rgb(0 0 0 / 25%); } - + .bton_image_class { font-size: small; text-align: center; @@ -2183,9 +2183,9 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - } - - .texte_area_filter_value { + } + + .texte_area_filter_value { float: left !important; width: 40% !important; font-size: x-small !important; @@ -2193,11 +2193,11 @@ margin: 0.4rem !important; margin-top: 0px !important; margin-bottom: 2px !important; - - } - - - .filter_bton_add { + + } + + + .filter_bton_add { float: left; width: 5% !important; font-size: xx-large !important; @@ -2206,8 +2206,8 @@ margin-bottom: 2px !important; text-align: right; cursor: pointer; - } - + } + .titre1 { font-family: "Quicksand", "Signika", sans-serif; @@ -2219,26 +2219,36 @@ font-style: italic; background-color: gray; font-weight: normal; - } + } - .file_ariane{ + .file_ariane { font-size: large; font-weight: 600; width: 100%; text-align: center; - } + } - .div_row_list_pj{ + .div_row_list_pj { width: 30%; border-left: 3mm ridge rgba(211, 220, 50, .6); float: left; - } + } } // 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%; padding: 5px; @@ -2272,12 +2282,12 @@ margin-left: 10px; margin-right: 10px; } - + .css-1v4ccyo { height: 3.5rem !important; font-size: small; } - + option { font-weight: normal; @@ -2313,8 +2323,9 @@ float: right; padding-right: 10px; text-align: right; - - } + + } + }