df
This commit is contained in:
parent
29bc1d8676
commit
91d693a802
|
|
@ -979,3 +979,31 @@ body {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
content: none !important;
|
content: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Styles pour les chevrons de la sidebar */
|
||||||
|
.sidebar-chevron {
|
||||||
|
transition: transform 0.3s ease;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-chevron-rotated {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Bootstrap gère déjà l'état 'show' du collapse */
|
||||||
|
.collapse.show + .sidebar-chevron-rotated,
|
||||||
|
[aria-expanded="true"] .sidebar-chevron {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Correction pour l'affichage des icônes */
|
||||||
|
.icon-wrapper {
|
||||||
|
min-width: 36px;
|
||||||
|
min-height: 36px;
|
||||||
|
flex-shrink: 0; /* Empêche le rétrécissement */
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-wrapper i {
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
@ -285,24 +285,16 @@ $retourVue = $infovue['lienRetour'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
console.log("=== GABARIT INITIALISATION ===");
|
|
||||||
console.log("jQuery version:", $.fn.jquery);
|
|
||||||
console.log("Bootstrap Select disponible:", typeof $.fn.selectpicker !== 'undefined');
|
|
||||||
console.log("Select2 disponible:", typeof $.fn.select2 !== 'undefined');
|
|
||||||
console.log("Toastr disponible:", typeof toastr !== 'undefined');
|
|
||||||
|
|
||||||
// 1. Initialiser Bootstrap Select IMMÉDIATEMENT
|
// 1. Initialiser Bootstrap Select IMMÉDIATEMENT
|
||||||
if (typeof $.fn.selectpicker !== 'undefined') {
|
if (typeof $.fn.selectpicker !== 'undefined') {
|
||||||
try {
|
try {
|
||||||
$('.selectpicker').selectpicker();
|
$('.selectpicker').selectpicker();
|
||||||
console.log("✅ Bootstrap Select initialisé avec succès");
|
|
||||||
console.log(" Nombre de .selectpicker trouvés:", $('.selectpicker').length);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("❌ Erreur Bootstrap Select:", error);
|
console.error("❌ Erreur Bootstrap Select:", error);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.warn("⚠️ Bootstrap Select non disponible");
|
// Fallback: utiliser Select2
|
||||||
// Fallback: utiliser Select2
|
|
||||||
if (typeof $.fn.select2 !== 'undefined') {
|
if (typeof $.fn.select2 !== 'undefined') {
|
||||||
$('.selectpicker').each(function() {
|
$('.selectpicker').each(function() {
|
||||||
if (!$(this).hasClass('select2-hidden-accessible')) {
|
if (!$(this).hasClass('select2-hidden-accessible')) {
|
||||||
|
|
@ -312,7 +304,7 @@ $retourVue = $infovue['lienRetour'];
|
||||||
}).addClass('selectpicker-fallback');
|
}).addClass('selectpicker-fallback');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log("✅ Fallback Select2 appliqué aux .selectpicker");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -321,7 +313,6 @@ $retourVue = $infovue['lienRetour'];
|
||||||
$('.select2').select2({
|
$('.select2').select2({
|
||||||
theme: 'bootstrap-5'
|
theme: 'bootstrap-5'
|
||||||
});
|
});
|
||||||
console.log("✅ Select2 initialisé");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Gestion du sidebar
|
// 3. Gestion du sidebar
|
||||||
|
|
@ -332,23 +323,15 @@ $retourVue = $infovue['lienRetour'];
|
||||||
|
|
||||||
// 4. Gestion de la barre de contexte - VERSION SIMPLIFIÉE ET ROBUSTE
|
// 4. Gestion de la barre de contexte - VERSION SIMPLIFIÉE ET ROBUSTE
|
||||||
function initContextPanel() {
|
function initContextPanel() {
|
||||||
console.log("Initialisation du panneau de contexte...");
|
|
||||||
|
|
||||||
var $panel = $('#barre_laterale_d');
|
var $panel = $('#barre_laterale_d');
|
||||||
var $showBtn = $('#showSideNav');
|
var $showBtn = $('#showSideNav');
|
||||||
var $hideBtn = $('#hideSideNav');
|
var $hideBtn = $('#hideSideNav');
|
||||||
|
|
||||||
// Vérifier que les éléments existent
|
// Vérifier que les éléments existent
|
||||||
if (!$panel.length || !$showBtn.length || !$hideBtn.length) {
|
if (!$panel.length || !$showBtn.length || !$hideBtn.length) {
|
||||||
console.error("❌ Éléments du panneau de contexte non trouvés");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("✅ Éléments trouvés:");
|
|
||||||
console.log(" - Panel:", $panel.length);
|
|
||||||
console.log(" - Bouton show:", $showBtn.length);
|
|
||||||
console.log(" - Bouton hide:", $hideBtn.length);
|
|
||||||
|
|
||||||
// S'assurer que le panel est caché au départ
|
// S'assurer que le panel est caché au départ
|
||||||
$panel.removeClass('active');
|
$panel.removeClass('active');
|
||||||
$showBtn.show();
|
$showBtn.show();
|
||||||
|
|
@ -372,7 +355,6 @@ $retourVue = $infovue['lienRetour'];
|
||||||
$hideBtn.off('click').on('click', function(e) {
|
$hideBtn.off('click').on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
console.log("Bouton hide cliqué");
|
|
||||||
|
|
||||||
$panel.removeClass('active');
|
$panel.removeClass('active');
|
||||||
$showBtn.show();
|
$showBtn.show();
|
||||||
|
|
@ -386,7 +368,6 @@ $retourVue = $infovue['lienRetour'];
|
||||||
if ($panel.hasClass('active') &&
|
if ($panel.hasClass('active') &&
|
||||||
!$(e.target).closest('#barre_laterale_d').length &&
|
!$(e.target).closest('#barre_laterale_d').length &&
|
||||||
!$(e.target).is('#showSideNav')) {
|
!$(e.target).is('#showSideNav')) {
|
||||||
console.log("Clic en dehors du panel");
|
|
||||||
$panel.removeClass('active');
|
$panel.removeClass('active');
|
||||||
$showBtn.show();
|
$showBtn.show();
|
||||||
$('body').removeClass('context-panel-open');
|
$('body').removeClass('context-panel-open');
|
||||||
|
|
@ -397,8 +378,6 @@ $retourVue = $infovue['lienRetour'];
|
||||||
$panel.off('click').on('click', function(e) {
|
$panel.off('click').on('click', function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("✅ Panneau de contexte initialisé");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialiser le panneau de contexte
|
// Initialiser le panneau de contexte
|
||||||
|
|
@ -412,26 +391,6 @@ $retourVue = $infovue['lienRetour'];
|
||||||
'cursor': 'pointer'
|
'cursor': 'pointer'
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Ajouter un bouton de test debug (à enlever en production)
|
|
||||||
if (typeof modeDev !== 'undefined' && modeDev == "1") {
|
|
||||||
$('body').append(
|
|
||||||
'<button id="debugTestPanel" style="position:fixed; bottom:20px; left:20px; z-index:9999; padding:10px; background:red; color:white; border:none; border-radius:5px;">DEBUG: Test Panel</button>'
|
|
||||||
);
|
|
||||||
|
|
||||||
$('#debugTestPanel').on('click', function() {
|
|
||||||
var $panel = $('#barre_laterale_d');
|
|
||||||
if ($panel.hasClass('active')) {
|
|
||||||
$panel.removeClass('active');
|
|
||||||
$('#showSideNav').show();
|
|
||||||
console.log("DEBUG: Panel fermé");
|
|
||||||
} else {
|
|
||||||
$panel.addClass('active');
|
|
||||||
$('#showSideNav').hide();
|
|
||||||
console.log("DEBUG: Panel ouvert");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// 6. Synchronisation du badge de notifications
|
// 6. Synchronisation du badge de notifications
|
||||||
function syncBadge() {
|
function syncBadge() {
|
||||||
var count = parseInt($("#msgNonLus").val()) || 0;
|
var count = parseInt($("#msgNonLus").val()) || 0;
|
||||||
|
|
@ -459,10 +418,7 @@ $retourVue = $infovue['lienRetour'];
|
||||||
"timeOut": "5000",
|
"timeOut": "5000",
|
||||||
"extendedTimeOut": "1000"
|
"extendedTimeOut": "1000"
|
||||||
};
|
};
|
||||||
console.log("✅ Toastr configuré");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("=== GABARIT INITIALISATION TERMINÉE ===");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fonctions globales pour le panneau de contexte
|
// Fonctions globales pour le panneau de contexte
|
||||||
|
|
|
||||||
|
|
@ -15,17 +15,21 @@
|
||||||
<div class="sidebar-body">
|
<div class="sidebar-body">
|
||||||
<ul class="sidebar-nav list-unstyled" id="sidebar-nav">
|
<ul class="sidebar-nav list-unstyled" id="sidebar-nav">
|
||||||
<?php foreach ($menus as $key0 => $menuParent): ?>
|
<?php foreach ($menus as $key0 => $menuParent): ?>
|
||||||
<?php $menuChildrenLevelOne = $gabary->get_menus_by_parent_code($menuParent['vue']); ?>
|
<?php
|
||||||
|
$menuChildrenLevelOne = $gabary->get_menus_by_parent_code($menuParent['vue']);
|
||||||
|
$hasChildren = sizeof($menuChildrenLevelOne) > 0;
|
||||||
|
$isActiveParent = strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1);
|
||||||
|
?>
|
||||||
|
|
||||||
<?php if (sizeof($menuChildrenLevelOne) > 0): ?>
|
<?php if ($hasChildren): ?>
|
||||||
<!-- Menu avec sous-menus -->
|
<!-- Menu avec sous-menus -->
|
||||||
<li class="nav-item mb-1">
|
<li class="nav-item mb-1">
|
||||||
<a class="nav-link d-flex align-items-center justify-content-between py-3 px-4
|
<a class="nav-link d-flex align-items-center justify-content-between py-3 px-4
|
||||||
<?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'active-main' : '' ?>"
|
<?= $isActiveParent ? 'active-main' : '' ?>"
|
||||||
data-bs-toggle="collapse"
|
data-bs-toggle="collapse"
|
||||||
href="#menu-<?= $menuParent['codeMenu'] . $key0 ?>"
|
href="#menu-<?= $menuParent['codeMenu'] . $key0 ?>"
|
||||||
role="button"
|
role="button"
|
||||||
aria-expanded="<?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'true' : 'false' ?>"
|
aria-expanded="<?= $isActiveParent ? 'true' : 'false' ?>"
|
||||||
aria-controls="menu-<?= $menuParent['codeMenu'] . $key0 ?>">
|
aria-controls="menu-<?= $menuParent['codeMenu'] . $key0 ?>">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<div class="icon-wrapper bg-primary bg-opacity-10 rounded-circle d-flex align-items-center justify-content-center me-3"
|
<div class="icon-wrapper bg-primary bg-opacity-10 rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||||
|
|
@ -34,25 +38,26 @@
|
||||||
</div>
|
</div>
|
||||||
<span class="fw-medium"><?= $menuParent['libeleMenu'] ?></span>
|
<span class="fw-medium"><?= $menuParent['libeleMenu'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
<!-- Icône qui change selon l'état ouvert/fermé -->
|
<!-- Icône avec rotation CSS pure -->
|
||||||
<i class="fas <?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'fa-chevron-up' : 'fa-chevron-down' ?> transition-transform"></i>
|
<i class="fas fa-chevron-down sidebar-chevron <?= $isActiveParent ? 'sidebar-chevron-rotated' : '' ?>"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="collapse <?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'show' : '' ?>"
|
<div class="collapse <?= $isActiveParent ? 'show' : '' ?>"
|
||||||
id="menu-<?= $menuParent['codeMenu'] . $key0 ?>">
|
id="menu-<?= $menuParent['codeMenu'] . $key0 ?>">
|
||||||
<ul class="list-unstyled ps-4 py-2 bg-light rounded">
|
<ul class="list-unstyled ps-4 py-2 bg-light rounded">
|
||||||
<?php foreach ($menuChildrenLevelOne as $key1 => $menuChild): ?>
|
<?php foreach ($menuChildrenLevelOne as $key1 => $menuChild): ?>
|
||||||
<?php
|
<?php
|
||||||
$link_clean = explode('/', $menuChild['lienMenu'])[0];
|
$link_clean = explode('/', $menuChild['lienMenu'])[0];
|
||||||
$activeLink = $_SESSION['firstLevelMenu'];
|
$activeLink = $_SESSION['firstLevelMenu'] ?? '';
|
||||||
|
$isActiveChild = $link_clean == $activeLink;
|
||||||
?>
|
?>
|
||||||
<li class="mb-1">
|
<li class="mb-1">
|
||||||
<a class="nav-link-sub d-flex align-items-center py-2 px-3 rounded
|
<a class="nav-link-sub d-flex align-items-center py-2 px-3 rounded
|
||||||
<?= $link_clean == $activeLink ? 'active-submenu bg-primary text-white' : 'text-dark' ?>"
|
<?= $isActiveChild ? 'active-submenu bg-primary text-white' : 'text-dark' ?>"
|
||||||
href="<?= $menuChild['lienMenu'] ?>">
|
href="<?= $menuChild['lienMenu'] ?>">
|
||||||
<i class="fas fa-circle me-2" style="font-size: 0.5rem;"></i>
|
<i class="fas fa-circle me-2" style="font-size: 0.5rem;"></i>
|
||||||
<span><?= $menuChild['libeleMenu'] ?></span>
|
<span><?= $menuChild['libeleMenu'] ?></span>
|
||||||
<?php if ($link_clean == $activeLink): ?>
|
<?php if ($isActiveChild): ?>
|
||||||
<i class="fas fa-arrow-right ms-auto"></i>
|
<i class="fas fa-arrow-right ms-auto"></i>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -65,10 +70,9 @@
|
||||||
<!-- Menu sans sous-menus (comme Quitter) -->
|
<!-- Menu sans sous-menus (comme Quitter) -->
|
||||||
<li class="nav-item mb-1">
|
<li class="nav-item mb-1">
|
||||||
<a class="nav-link d-flex align-items-center justify-content-between py-3 px-4
|
<a class="nav-link d-flex align-items-center justify-content-between py-3 px-4
|
||||||
<?= strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1) ? 'active-main' : '' ?>"
|
<?= $isActiveParent ? 'active-main' : '' ?>"
|
||||||
href="<?= $menuParent['lienMenu'] ?>">
|
href="<?= $menuParent['lienMenu'] ?>">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<!-- Conteneur d'icône identique aux autres menus -->
|
|
||||||
<div class="icon-wrapper bg-primary bg-opacity-10 rounded-circle d-flex align-items-center justify-content-center me-3"
|
<div class="icon-wrapper bg-primary bg-opacity-10 rounded-circle d-flex align-items-center justify-content-center me-3"
|
||||||
style="width: 36px; height: 36px;">
|
style="width: 36px; height: 36px;">
|
||||||
<i class="<?= $menuParent['icone'] ?> text-primary"></i>
|
<i class="<?= $menuParent['icone'] ?> text-primary"></i>
|
||||||
|
|
@ -76,7 +80,7 @@
|
||||||
<span class="fw-medium"><?= $menuParent['libeleMenu'] ?></span>
|
<span class="fw-medium"><?= $menuParent['libeleMenu'] ?></span>
|
||||||
</div>
|
</div>
|
||||||
<!-- Flèche uniquement si le menu est actif -->
|
<!-- Flèche uniquement si le menu est actif -->
|
||||||
<?php if (strtolower($menuParent['libeleMenu']) == strtolower($activeLevel1)): ?>
|
<?php if ($isActiveParent): ?>
|
||||||
<i class="fas fa-arrow-right ms-auto text-primary"></i>
|
<i class="fas fa-arrow-right ms-auto text-primary"></i>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -95,7 +99,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3 text-center">
|
<div class="mt-3 text-center">
|
||||||
<small class="text-muted">v<?= $_SESSION['version_C'] ?? '1.0.4' ?></small>
|
<small class="text-muted">v<?= $_SESSION['version_C'] ?? '1.0.0' ?></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user