From 6b915f833a1cc8468ef816c41f1ac4c1f2d6777c Mon Sep 17 00:00:00 2001 From: Cherif Date: Tue, 1 Jul 2025 21:23:37 +0200 Subject: [PATCH] qsd --- src/App.js | 19 ++- src/components/DisplayPartnerPromotion.js | 165 +++++++++++++------- src/components/DisplayPartnerSession.js | 178 ++++++++++++++++------ 3 files changed, 259 insertions(+), 103 deletions(-) diff --git a/src/App.js b/src/App.js index 94eafa0..380f6b5 100644 --- a/src/App.js +++ b/src/App.js @@ -99,12 +99,20 @@ function App() { const [isLoading, setLoading] = useState(); + + + const [mysy_domain, setmysy_domain] = useState(window.location.hostname.split('.')[0]); + + useEffect(() => { setLoading(true); let myurl = window.location.host; let myurl_pathname = window.location.pathname; + // console.log(" ### mysy_domain =", mysy_domain) + // console.log(" ### myurl =", myurl) + // console.log(" ### window.location.hostname =", window.location.hostname) var domain = myurl; if (domain.includes('://')) { @@ -254,11 +262,16 @@ function App() { */} - + {/*** C'EST TRES TRES CRADE LES 2 LIGNES QUI SUIVENT MAIS C'EST POUR SE DEPANNER EN mode pompier */} + + {String(mysy_domain).length > 5 && String(mysy_domain) !== "colasrail" && } + {String(mysy_domain) === "colasrail" && } + + {/*** FINNN CRADDDDDDDE */} + + - - {/* Debut Migration */} diff --git a/src/components/DisplayPartnerPromotion.js b/src/components/DisplayPartnerPromotion.js index 0dd02bf..1c4e99a 100644 --- a/src/components/DisplayPartnerPromotion.js +++ b/src/components/DisplayPartnerPromotion.js @@ -4106,6 +4106,10 @@ const DisplayPartnerPromotion = (props) => { setgridline_id(''); setsequence_gridline_id(""); + setent_account_automatic(false); + setlms_account_automatic(false); + + //myRef.current.scrollIntoView({ behavior: "smooth" }); var divh = document.getElementById('myRef_add_session').offsetTop; window.scrollTo({ @@ -6271,9 +6275,8 @@ const DisplayPartnerPromotion = (props) => { setp_one_session_etape_label(); setp_one_titre(""); - - - + setent_account_automatic(false); + setlms_account_automatic(false); } @@ -7230,6 +7233,19 @@ const DisplayPartnerPromotion = (props) => { else if (String(mylocaltraining.session_status) === "false") setsessionStatus(false); + if (mylocaltraining.lms_account_automatic && String(mylocaltraining.lms_account_automatic) === "1") { + setlms_account_automatic(true); + } else { + setlms_account_automatic(false); + } + + if (mylocaltraining.ent_account_automatic && String(mylocaltraining.ent_account_automatic) === "1") { + setent_account_automatic(true); + } else { + setent_account_automatic(false); + } + + /* * Update 22/10/2023 : Gestion des champs spécifiques. ils commencent tous par 'my_' @@ -21801,6 +21817,52 @@ const DisplayPartnerPromotion = (props) => { +
+  
+
+ + +   +
+ +
+
+
+
Création automatique compte ENT
+ { + setent_account_automatic(event.target.checked); + } + } + inputProps={{ 'aria-label': 'controlled' }} + /> +
+ +
Création automatique compte LMS
+ { + setlms_account_automatic(event.target.checked); + } + } + inputProps={{ 'aria-label': 'controlled' }} + /> +
+
+ +
+ +
+   +
+ {/* -- début champs specifiques **/}   @@ -21881,56 +21943,11 @@ const DisplayPartnerPromotion = (props) => { -   -
- -
-
-
-
Création automatique compte ENT
- { - setent_account_automatic(event.target.checked); - } - } - inputProps={{ 'aria-label': 'controlled' }} - /> -
- -
Création automatique compte LMS
- { - setlms_account_automatic(event.target.checked); - } - } - inputProps={{ 'aria-label': 'controlled' }} - /> -
-
- -
- - - - -
-   -
- - {sessionChanged &&
/!\ Pensez à enregistrer les modifications
} - {String(props.check_user_acces_right("session", "write")) === "1" &&
+ {String(props.check_user_acces_right("session", "write")) === "1" &&
@@ -22561,6 +22578,50 @@ const DisplayPartnerPromotion = (props) => {
+
+  
+
+ + +   +
+ +
+
+
+
Création automatique compte ENT
+ { + setent_account_automatic(event.target.checked); + } + } + inputProps={{ 'aria-label': 'controlled' }} + /> +
+ +
Création automatique compte LMS
+ { + setlms_account_automatic(event.target.checked); + } + } + inputProps={{ 'aria-label': 'controlled' }} + /> +
+
+ +
+ +
+   +
+ {/* -- début champs specifiques **/}   @@ -26514,7 +26575,7 @@ const DisplayPartnerPromotion = (props) => {

  - + {

- {String(props.check_user_acces_right("session", "write")) === "1" &&
+ {String(props.check_user_acces_right("session", "write")) === "1" &&
-
-  
-
- - -   -
- -
-
-
-
Création automatique compte ENT
- { - setent_account_automatic(event.target.checked); - } - } - inputProps={{ 'aria-label': 'controlled' }} - /> -
- -
Création automatique compte LMS
- { - setlms_account_automatic(event.target.checked); - } - } - inputProps={{ 'aria-label': 'controlled' }} - /> -
-
- -
@@ -22586,13 +22624,57 @@ const DisplayPartnerSession = (props) => {
+
+  
+
+ + +   +
+ +
+
+
+
Création automatique compte ENT
+ { + setent_account_automatic(event.target.checked); + } + } + inputProps={{ 'aria-label': 'controlled' }} + /> +
+ +
Création automatique compte LMS
+ { + setlms_account_automatic(event.target.checked); + } + } + inputProps={{ 'aria-label': 'controlled' }} + /> +
+
+ +
+ +
+   +
+ {/* -- début champs specifiques **/}   {rows_champs_specifics && rows_champs_specifics.length > 0 &&
+ Champs spécifiques b
}