diff --git a/Modele/Menuvueutilisateur.php b/Modele/Menuvueutilisateur.php index 84f171b..ba65353 100755 --- a/Modele/Menuvueutilisateur.php +++ b/Modele/Menuvueutilisateur.php @@ -25,4 +25,5 @@ class Menuvueutilisateur extends Modele { // ajouté le 30/07/2019 $_SESSION['vue'] = $vue; } + } \ No newline at end of file diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 5d66ac5..ce9f6c8 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -23,30 +23,30 @@ $imgData = $_SESSION['photoAssureCrypte'] ?? ''; */ if (!function_exists('detectActiveMenu')) { -function detectActiveMenu($activeLink, $menus, $gabary) { - // LOG SIMPLIFIÉE ET FIABLE : - - // 1. ACCUEIL = TOUJOURS menu 0 (priorité absolue) - if ($activeLink == 'Accueil') { - return ['parent' => '0', 'child' => null]; - } - - // 2. Recherche dans les autres menus - foreach ($menus as $key0 => $menuParent) { - $menuChildren = $gabary->get_menus_by_parent_code($menuParent['vue']); + function detectActiveMenu($activeLink, $menus, $gabary) { + // LOG SIMPLIFIÉE ET FIABLE : - // Vérifier chaque enfant - foreach ($menuChildren as $key1 => $menuChild) { - $childLink = explode('/', $menuChild['lienMenu'])[0] ?? ''; - if ($childLink == $activeLink) { - return ['parent' => (string)$key0, 'child' => (string)$key1]; + // 1. ACCUEIL = TOUJOURS menu 0 (priorité absolue) + if ($activeLink == 'Accueil') { + return ['parent' => '0', 'child' => null]; + } + + // 2. Recherche dans les autres menus + foreach ($menus as $key0 => $menuParent) { + $menuChildren = $gabary->get_menus_by_parent_code($menuParent['vue']); + + // Vérifier chaque enfant + foreach ($menuChildren as $key1 => $menuChild) { + $childLink = explode('/', $menuChild['lienMenu'])[0] ?? ''; + if ($childLink == $activeLink) { + return ['parent' => (string)$key0, 'child' => (string)$key1]; + } } } + + // 3. Fallback : premier menu + return ['parent' => '0', 'child' => null]; } - - // 3. Fallback : premier menu - return ['parent' => '0', 'child' => null]; -} } // ============================================ @@ -60,6 +60,12 @@ $activeChildId = $menuData['child']; $imgData = $_SESSION['photoAssureCrypte']; $photoAssureCrypte = $_SESSION['photoAssureCrypte']; +$infovue = $gabary->getInfosVue($_SESSION['vue']); +$descriptionVue = est_anglophone() ? $infovue['DescriptionEng'] : $infovue['Description']; +$retourVue = $infovue['lienRetour']; + +var_dump(array("Descrip =" => $descriptionVue, "retour" => $retourVue)); + ?> @@ -71,7 +77,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte']; - <?= htmlspecialchars($_SESSION['vue'] ?? 'INTER-SANTE') ?> | Portail Santé + <?= htmlspecialchars($_SESSION['vue'] ?? 'INTER-SANTE') ?> | Portail RH Santé @@ -233,6 +239,13 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte']; + +
diff --git a/Vue/gabarit_queries.php b/Vue/gabarit_queries.php index c96f92c..6b3716e 100755 --- a/Vue/gabarit_queries.php +++ b/Vue/gabarit_queries.php @@ -12,7 +12,6 @@ class Gabary extends Modele { return $result; } - function getMenuVueByParent($vue) { @@ -29,7 +28,7 @@ class Gabary extends Modele { $request_body = array($_SESSION['codeSociete'], $_SESSION['codeProfil'], $vue); - //var_dump($request_body); exit(); + //var_dump($request_body); exit(); $execu = $this->executerRequete($sql, $request_body); $menuvue = $execu->fetchAll(); @@ -38,5 +37,15 @@ class Gabary extends Modele { } + public function getInfosVue($vue) + { + $sql = "call sp_c_get_info_vue(?)"; + + $resultat = $this->executerRequete($sql, array($vue)); + + $infovue = $resultat->fetchAll(); + + return $infovue; + } } ?> \ No newline at end of file