fs
This commit is contained in:
parent
9f4722285a
commit
b6a01b9741
|
|
@ -823,4 +823,24 @@ body {
|
|||
|
||||
.animate__bounceIn {
|
||||
animation-name: bounceIn;
|
||||
}
|
||||
}
|
||||
|
||||
/* Critical CSS Inline (optionnel pour les performances) */
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* Prévenir le FOUC (Flash of Unstyled Content) */
|
||||
.js-loading *,
|
||||
.js-loading *:before,
|
||||
.js-loading *:after {
|
||||
animation-play-state: paused !important;
|
||||
}
|
||||
211
Vue/gabarit.php
211
Vue/gabarit.php
|
|
@ -117,6 +117,14 @@ $retourVue = $infovue['lienRetour'];
|
|||
|
||||
<!-- Context Panel -->
|
||||
<?php include 'contexte.php'; ?>
|
||||
|
||||
<button class="btn btn-primary btn-context-toggle shadow-lg"
|
||||
id="showSideNav"
|
||||
title="<?= _("Afficher le contexte") ?>"
|
||||
style="position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 1005; border-radius: 20px 0 0 20px; padding: 12px 8px; background: #0088cf; color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;">
|
||||
<i class="fas fa-chevron-left me-1"></i>
|
||||
<i class="fas fa-info-circle"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- ======= Modals ======= -->
|
||||
|
|
@ -211,80 +219,118 @@ $retourVue = $infovue['lienRetour'];
|
|||
<button id="btn_pop_dernier_messagerie" type="button" class="d-none" data-bs-toggle="modal" data-bs-target="#popderniermessagerie"></button>
|
||||
|
||||
<!-- ======= Scripts ======= -->
|
||||
|
||||
<!-- Core Libraries -->
|
||||
<script src="Bootstrap/js/jquery.min.js"></script>
|
||||
<script src="Bootstrap/js/jquery-ui.js"></script>
|
||||
<script src="Bootstrap/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- ======= Scripts ======= -->
|
||||
<script src="Bootstrap/js/jquery.min.js"></script>
|
||||
<script src="Bootstrap/js/jquery-ui.js"></script>
|
||||
|
||||
<!-- Bootstrap 5 Bundle -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Bootstrap Select (seulement si nécessaire) -->
|
||||
<?php if (isset($needSelectPicker) && $needSelectPicker): ?>
|
||||
<script src="Bootstrap_new/select/js/bootstrap-select.min.js"></script>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- DataTables -->
|
||||
<script src="Bootstrap_new/datatables/datatable.min.js"></script>
|
||||
|
||||
|
||||
<!-- Charts -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
||||
|
||||
<!-- PDF Generation -->
|
||||
<script src="Js/html2pdf.js"></script>
|
||||
|
||||
|
||||
<!-- Select2 -->
|
||||
<script src="Bootstrap_new/js/select2.min.js"></script>
|
||||
|
||||
|
||||
<!-- Timer -->
|
||||
<script src="Bootstrap/js/timer.jquery.js"></script>
|
||||
|
||||
|
||||
<!-- SweetAlert2 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<!-- Toastr -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
|
||||
|
||||
|
||||
<!-- Datepicker by language -->
|
||||
<?php if (est_anglophone()) : ?>
|
||||
<script src="Js/datepicker-eng.js"></script>
|
||||
<?php else: ?>
|
||||
<script src="Js/datepicker-fr.js"></script>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<!-- Core Functions -->
|
||||
<script src="Js/fonctions.js?ver=<?= date('Y.m.d.H') ?>"></script>
|
||||
<script src="<?= $_SESSION['dossierSociete'] . '/Js/societe.js' ?>"></script>
|
||||
|
||||
<!-- Animation Library -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.js"></script>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<script src="https://kit.fontawesome.com/your-kit-code.js" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Script d'initialisation amélioré -->
|
||||
<!-- Script d'initialisation -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// Initialisation des tooltips Bootstrap
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
||||
return new bootstrap.Tooltip(tooltipTriggerEl);
|
||||
});
|
||||
console.log("Document ready - Initialisation du gabarit");
|
||||
|
||||
// Initialiser Bootstrap Select
|
||||
if (typeof $.fn.selectpicker !== 'undefined') {
|
||||
$('.selectpicker').selectpicker();
|
||||
console.log("Bootstrap Select initialisé");
|
||||
} else {
|
||||
console.warn("Bootstrap Select n'est pas chargé");
|
||||
}
|
||||
|
||||
// Initialiser Select2
|
||||
if (typeof $.fn.select2 !== 'undefined') {
|
||||
$('.select2').select2({
|
||||
theme: 'bootstrap-5'
|
||||
});
|
||||
console.log("Select2 initialisé");
|
||||
}
|
||||
|
||||
// Gestion du sidebar
|
||||
$('.toggle-sidebar-btn').on('click', function() {
|
||||
console.log("Toggle sidebar cliqué");
|
||||
$('body').toggleClass('toggle-sidebar');
|
||||
$('#sidebar').toggleClass('collapsed');
|
||||
$('.main').toggleClass('expanded');
|
||||
});
|
||||
|
||||
// Gestion de la barre de contexte
|
||||
$("#showSideNav").click(function() {
|
||||
$("#barre_laterale_d").addClass("active");
|
||||
$(this).fadeOut(200);
|
||||
// Animation smooth
|
||||
$('body').css('transition', 'margin-right 0.3s ease');
|
||||
$('body').css('margin-right', '300px');
|
||||
// Gestion de la barre de contexte - version corrigée
|
||||
$(document).on('click', '#showSideNav', function(e) {
|
||||
console.log("Show context panel cliqué");
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
// Vérifier si l'élément existe
|
||||
if ($('#barre_laterale_d').length) {
|
||||
$('#barre_laterale_d').addClass('active');
|
||||
$(this).fadeOut(200);
|
||||
console.log("Panel de contexte activé");
|
||||
} else {
|
||||
console.error("Élément #barre_laterale_d non trouvé");
|
||||
}
|
||||
});
|
||||
|
||||
$("#hideSideNav").click(function() {
|
||||
$("#barre_laterale_d").removeClass("active");
|
||||
$("#showSideNav").fadeIn(200);
|
||||
$('body').css('margin-right', '0');
|
||||
$(document).on('click', '#hideSideNav', function(e) {
|
||||
console.log("Hide context panel cliqué");
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
$('#barre_laterale_d').removeClass('active');
|
||||
$('#showSideNav').fadeIn(200);
|
||||
});
|
||||
|
||||
// Fermer le panneau si on clique en dehors
|
||||
$(document).on('click', function(e) {
|
||||
if ($('#barre_laterale_d').hasClass('active') &&
|
||||
!$(e.target).closest('#barre_laterale_d').length &&
|
||||
!$(e.target).closest('#showSideNav').length) {
|
||||
$('#barre_laterale_d').removeClass('active');
|
||||
$('#showSideNav').fadeIn(200);
|
||||
}
|
||||
});
|
||||
|
||||
// Empêcher la fermeture quand on clique dans le panneau
|
||||
$('#barre_laterale_d').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// Synchronisation du badge de notifications
|
||||
|
|
@ -294,13 +340,6 @@ $retourVue = $infovue['lienRetour'];
|
|||
|
||||
if(count > 0) {
|
||||
badge.text(count).show();
|
||||
// Animation si nouveau message
|
||||
if(count > parseInt(badge.data('last-count') || 0)) {
|
||||
badge.addClass('animate__animated animate__pulse animate__fast');
|
||||
setTimeout(() => {
|
||||
badge.removeClass('animate__animated animate__pulse animate__fast');
|
||||
}, 1000);
|
||||
}
|
||||
badge.data('last-count', count);
|
||||
} else {
|
||||
badge.hide();
|
||||
|
|
@ -312,57 +351,55 @@ $retourVue = $infovue['lienRetour'];
|
|||
syncBadge(); // Première exécution
|
||||
|
||||
// Rafraîchir le gabarit
|
||||
raffraichier_gabarit();
|
||||
|
||||
// Timer pour le rafraîchissement des messages
|
||||
$('#timer').timer({
|
||||
duration: '60s',
|
||||
callback: function() {
|
||||
raffraichier_messagerie();
|
||||
syncBadge();
|
||||
},
|
||||
repeat: true
|
||||
});
|
||||
|
||||
// Toastr configuration
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"progressBar": true,
|
||||
"positionClass": "toast-top-right",
|
||||
"timeOut": "5000",
|
||||
"extendedTimeOut": "1000"
|
||||
};
|
||||
|
||||
// Auto-focus sur les champs de recherche
|
||||
if ($('input[autofocus]').length) {
|
||||
setTimeout(function() {
|
||||
$('input[autofocus]').focus().select();
|
||||
}, 100);
|
||||
if (typeof raffraichier_gabarit === 'function') {
|
||||
raffraichier_gabarit();
|
||||
}
|
||||
|
||||
// Prévenir la perte de données non sauvegardées
|
||||
$(window).on('beforeunload', function() {
|
||||
if ($('.unsaved-changes').length > 0) {
|
||||
return "Vous avez des modifications non sauvegardées. Voulez-vous vraiment quitter ?";
|
||||
}
|
||||
});
|
||||
// Timer pour le rafraîchissement des messages
|
||||
if ($('#timer').length && typeof $.fn.timer !== 'undefined') {
|
||||
$('#timer').timer({
|
||||
duration: '60s',
|
||||
callback: function() {
|
||||
if (typeof raffraichier_messagerie === 'function') {
|
||||
raffraichier_messagerie();
|
||||
}
|
||||
syncBadge();
|
||||
},
|
||||
repeat: true
|
||||
});
|
||||
}
|
||||
|
||||
// Toastr configuration
|
||||
if (typeof toastr !== 'undefined') {
|
||||
toastr.options = {
|
||||
"closeButton": true,
|
||||
"progressBar": true,
|
||||
"positionClass": "toast-top-right",
|
||||
"timeOut": "5000",
|
||||
"extendedTimeOut": "1000"
|
||||
};
|
||||
}
|
||||
|
||||
// Debug: Vérifier que les éléments existent
|
||||
console.log("Éléments trouvés:");
|
||||
console.log("#showSideNav:", $('#showSideNav').length);
|
||||
console.log("#hideSideNav:", $('#hideSideNav').length);
|
||||
console.log("#barre_laterale_d:", $('#barre_laterale_d').length);
|
||||
});
|
||||
|
||||
// Fonction pour marquer les changements non sauvegardés
|
||||
function markUnsaved() {
|
||||
$('form').addClass('unsaved-changes');
|
||||
// Fonction pour ouvrir le panneau depuis d'autres scripts
|
||||
function ouvrirPanneauContexte() {
|
||||
$('#barre_laterale_d').addClass('active');
|
||||
$('#showSideNav').fadeOut(200);
|
||||
}
|
||||
|
||||
// Démarrer l'auto-sauvegarde si besoin
|
||||
function startAutosave(selector, interval = 30000) {
|
||||
setInterval(function() {
|
||||
if ($(selector).hasClass('unsaved-changes')) {
|
||||
$(selector).submit();
|
||||
}
|
||||
}, interval);
|
||||
// Fonction pour fermer le panneau depuis d'autres scripts
|
||||
function fermerPanneauContexte() {
|
||||
$('#barre_laterale_d').removeClass('active');
|
||||
$('#showSideNav').fadeIn(200);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<!-- AJAX Container -->
|
||||
<div id="div_ajaxgabarit" class="d-none"></div>
|
||||
|
||||
|
|
|
|||
129
Vue/head.php
129
Vue/head.php
|
|
@ -1,9 +1,10 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="INTER SANTÉ - Gestionnaire de santé">
|
||||
<meta name="author" content="INTER SANTÉ">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
<base href="<?= $racineWeb ?>">
|
||||
|
||||
|
|
@ -11,63 +12,113 @@
|
|||
<link rel="icon" href="Bootstrap_new/images/favicon.ico" type="image/x-icon">
|
||||
<link rel="apple-touch-icon" href="Bootstrap_new/images/apple-touch-icon.png">
|
||||
|
||||
<!-- Google Fonts -->
|
||||
<!-- Preconnect pour améliorer les performances -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600&display=swap" rel="stylesheet">
|
||||
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net">
|
||||
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600&display=swap" rel="stylesheet" media="print" onload="this.media='all'">
|
||||
|
||||
<!-- Bootstrap 5 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
|
||||
|
||||
<!-- Vendor CSS -->
|
||||
<link href="Bootstrap/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
|
||||
<link href="Bootstrap/vendor/quill/quill.snow.css" rel="stylesheet">
|
||||
<link href="Bootstrap_new/css/datatables.min.css" rel="stylesheet">
|
||||
<link href="Bootstrap_new/css/select2.min.css" rel="stylesheet">
|
||||
<!-- Font Awesome avec fallback -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" integrity="sha512-Avb2QiuDEEvB4bZJYdft2mNjVShBftLdPG8FJ0V7irTLQ8Uo0qcPxh4Plq7G5tGm0rU+1SPhVotteLpBERwTkw==" crossorigin="anonymous" referrerpolicy="no-referrer">
|
||||
|
||||
<!-- Vendor CSS - Chargement différé -->
|
||||
<link href="Bootstrap/vendor/boxicons/css/boxicons.min.css" rel="stylesheet" media="print" onload="this.media='all'">
|
||||
|
||||
<!-- Toastr CSS -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" integrity="sha512-vKMx8UnXk60zUwyUnUPM3HbQo8QfmNx7+ltw8Pm5zLusl1XIfwcxo8DbWCqMGKaWeNxWA8yrx5v3SaVpMvR3CA==" crossorigin="anonymous" referrerpolicy="no-referrer">
|
||||
|
||||
<!-- SweetAlert2 -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/sweetalert2@11.14.1/dist/sweetalert2.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Chart.js -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<!-- Animate.css - version locale recommandée -->
|
||||
<link href="Bootstrap_new/css/animate.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Vendor CSS spécifiques (chargement conditionnel) -->
|
||||
<?php if (strpos($_SERVER['REQUEST_URI'], 'quill') !== false): ?>
|
||||
<link href="Bootstrap/vendor/quill/quill.snow.css" rel="stylesheet">
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- DataTables CSS (seulement si nécessaire) -->
|
||||
<?php if (isset($needDatatables) && $needDatatables): ?>
|
||||
<link href="Bootstrap_new/css/datatables.min.css" rel="stylesheet">
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Select2 CSS (seulement si nécessaire) -->
|
||||
<?php if (isset($needSelect2) && $needSelect2): ?>
|
||||
<link href="Bootstrap_new/css/select2.min.css" rel="stylesheet">
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Chart.js - déplacé en bas du body pour les performances -->
|
||||
|
||||
<!-- Styles personnalisés -->
|
||||
<link href="Bootstrap_new/css/style_moderne.css?ver=<?= date('Y.m.d.H') ?>" rel="stylesheet">
|
||||
|
||||
<!-- Animate.css pour les animations -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
|
||||
<!-- Toastr -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
|
||||
|
||||
|
||||
<title><?= htmlspecialchars($_SESSION['vue']) ?> - INTER SANTÉ</title>
|
||||
<title><?= htmlspecialchars($_SESSION['vue'] ?? 'Dashboard') ?> - INTER SANTÉ</title>
|
||||
|
||||
<!-- Scripts de prévention de clic droit en mode production -->
|
||||
<script type="text/javascript">
|
||||
var modeDev = <?= json_encode($modeDev) ?>;
|
||||
// Marquer le body comme loading
|
||||
document.documentElement.className = 'js-loading';
|
||||
|
||||
var modeDev = <?= json_encode($modeDev ?? '0') ?>;
|
||||
|
||||
// Charger toastr seulement si disponible
|
||||
function safeToastr() {
|
||||
if (typeof toastr !== 'undefined') {
|
||||
return toastr;
|
||||
}
|
||||
return {
|
||||
warning: function(msg) { console.warn(msg); },
|
||||
error: function(msg) { console.error(msg); },
|
||||
success: function(msg) { console.log(msg); },
|
||||
info: function(msg) { console.info(msg); }
|
||||
};
|
||||
}
|
||||
|
||||
if (modeDev != "1") {
|
||||
document.addEventListener('contextmenu', function(e) {
|
||||
e.preventDefault();
|
||||
toastr.warning('<?= _("Le clic droit est désactivé en mode production") ?>');
|
||||
});
|
||||
|
||||
// Prévention des raccourcis clavier
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// Ctrl+U (afficher le code source)
|
||||
if (e.ctrlKey && e.keyCode === 85) {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('contextmenu', function(e) {
|
||||
e.preventDefault();
|
||||
toastr.warning('<?= _("Cette fonctionnalité est désactivée") ?>');
|
||||
}
|
||||
// F12 (outils de développement)
|
||||
if (e.keyCode === 123) {
|
||||
e.preventDefault();
|
||||
toastr.warning('<?= _("Les outils de développement sont désactivés") ?>');
|
||||
}
|
||||
safeToastr().warning('<?= _("Le clic droit est désactivé en mode production") ?>');
|
||||
});
|
||||
|
||||
// Prévention des raccourcis clavier
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// Ctrl+U (afficher le code source)
|
||||
if (e.ctrlKey && e.keyCode === 85) {
|
||||
e.preventDefault();
|
||||
safeToastr().warning('<?= _("Cette fonctionnalité est désactivée") ?>');
|
||||
}
|
||||
// F12 (outils de développement)
|
||||
if (e.keyCode === 123) {
|
||||
e.preventDefault();
|
||||
safeToastr().warning('<?= _("Les outils de développement sont désactivés") ?>');
|
||||
}
|
||||
// Ctrl+Shift+I, Ctrl+Shift+J, Ctrl+Shift+C
|
||||
if (e.ctrlKey && e.shiftKey && [73, 74, 67].includes(e.keyCode)) {
|
||||
e.preventDefault();
|
||||
safeToastr().warning('<?= _("Cette fonctionnalité est désactivée") ?>');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Retirer la classe loading quand la page est chargée
|
||||
window.addEventListener('load', function() {
|
||||
document.documentElement.className = document.documentElement.className.replace('js-loading', '');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Polyfill pour les vieux navigateurs -->
|
||||
<script>
|
||||
// Polyfill pour les fonctions ES6 si nécessaire
|
||||
if (!window.Promise) {
|
||||
document.write('<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
Loading…
Reference in New Issue
Block a user