gar
This commit is contained in:
parent
a7dc057561
commit
753eb4f2c1
28
Controleur/ControleurAccessubmenus.php
Executable file
28
Controleur/ControleurAccessubmenus.php
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Utilisateur.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
|
||||
class ControleurAccessubmenus extends Controleur
|
||||
{
|
||||
private $menuvue;
|
||||
private $utilisateur;
|
||||
|
||||
public function __construct() {
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuVue('Accessubmenus');
|
||||
|
||||
$this->utilisateur = new Utilisateur();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$profil = $this->utilisateur->getListeProfilCode();
|
||||
$menus = array();
|
||||
|
||||
$this->genererVue(array(
|
||||
'profil' => $profil,
|
||||
'menus' => $menus
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -57,26 +57,20 @@ class ControleurAjaxhabilitation extends Controleur
|
|||
}
|
||||
|
||||
|
||||
public function afficheraccessousmenusass()
|
||||
public function afficheraccessousmenus()
|
||||
{
|
||||
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
|
||||
$codeModule = $this->requete->getParametreFormulaire("codeModule");
|
||||
$vue = $this->requete->getParametreFormulaire("vue");
|
||||
|
||||
$menus_accessibles = $this->utilisateur->getSousMenusAccessiblesVue($codeProfil, $vue);
|
||||
$menus_non_accessibles = $this->utilisateur->getSousMenusNonAccessiblesVue($codeProfil,$vue);
|
||||
|
||||
$this->genererVueAjax(array('menus_accessibles' => $menus_accessibles, 'menus_non_accessibles' => $menus_non_accessibles,
|
||||
'codeModule' => $codeModule));
|
||||
$this->genererVueAjax(array(
|
||||
'menus_accessibles' => $menus_accessibles,
|
||||
'menus_non_accessibles' => $menus_non_accessibles
|
||||
));
|
||||
}
|
||||
|
||||
public function listervuemodule()
|
||||
{
|
||||
$codeModule = $this->requete->getParametreFormulaire("codeModule");
|
||||
$listevue = $this->utilisateur->getListeVueModule($codeModule);
|
||||
|
||||
$this->genererVueAjax(array('listevue' => $listevue));
|
||||
}
|
||||
|
||||
public function ajoutertoussousmenusass()
|
||||
{
|
||||
|
|
|
|||
22
Controleur/ControleurAjaxmenusprofil.php
Executable file
22
Controleur/ControleurAjaxmenusprofil.php
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Utilisateur.php';
|
||||
|
||||
class ControleurAjaxmenusprofil extends Controleur
|
||||
{
|
||||
private $utilisateur;
|
||||
|
||||
public function __construct() {
|
||||
$this->utilisateur = new Utilisateur();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
|
||||
$menus = $this->utilisateur->getListeProfil($codeProfil);
|
||||
|
||||
$this->genererVueAjax(array(
|
||||
'menus' => $menus
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -4963,4 +4963,93 @@ function changer_langue()
|
|||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function ajax_menus_profil()
|
||||
{
|
||||
var codeProfil = $("#codeProfil").val();
|
||||
|
||||
if (codeProfil<=" ")
|
||||
{
|
||||
v_msg="Veuillez sélectionner un profil!";
|
||||
v_msgEng="Please select a user profile!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeProfil").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = 'codeProfil='+codeProfil;
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxmenusprofil/",
|
||||
type: 'POST',
|
||||
data: donnees,
|
||||
success: function(data) {
|
||||
$("#div_menu").html(data);
|
||||
},
|
||||
error: function(data) {
|
||||
},
|
||||
complete: function() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function afficher_menu_vue_profil()
|
||||
{
|
||||
codeProfil=$("#codeProfil").val();
|
||||
|
||||
if (codeProfil<=" ")
|
||||
{
|
||||
v_msg="Veuillez sélectionner un profil!";
|
||||
v_msgEng="Please select a user profile!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeProfil").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
vue=$("#vue").val();
|
||||
|
||||
if (vue<=" ")
|
||||
{
|
||||
v_msg="Veuillez sélectionner une vue!";
|
||||
v_msgEng="Please select a view!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#vue").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = 'codeProfil='+codeProfil;
|
||||
donnees += '&vue='+vue;
|
||||
|
||||
var div_attente = $('#div_menu_profil');
|
||||
|
||||
div_attente.html(`
|
||||
<div class="d-flex flex-column align-items-center justify-content-center" style="padding-top:80px;">
|
||||
<div class="spinner-border text-primary" role="status" style="width:3rem; height:3rem;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<span class="mt-3 fs-5 fw-bold">
|
||||
Veuillez patienter... / Please wait...
|
||||
</span>
|
||||
</div>
|
||||
`);
|
||||
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxhabilitation/afficheraccessousmenus/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data)
|
||||
{
|
||||
div_attente.html(data);
|
||||
},
|
||||
complete: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -218,4 +218,57 @@ class Utilisateur extends Modele {
|
|||
$liste = $this->executerRequete($sql, array($codeModule));
|
||||
return $liste->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getListeModule()
|
||||
{
|
||||
if (est_anglophone())
|
||||
{
|
||||
$sql = 'SELECT vue AS `code`, libelleEng AS libelle FROM c_menu WHERE enVigueur = "1" ORDER BY ordre;';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT vue AS `code`, libeleMenu AS libelle FROM c_menu WHERE enVigueur = "1" ORDER BY ordre;';
|
||||
}
|
||||
|
||||
$liste = $this->executerRequete($sql);
|
||||
|
||||
return $liste->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getListeProfil($codeProfil)
|
||||
{
|
||||
|
||||
if (est_anglophone())
|
||||
{
|
||||
$sql = "call sp_c_get_liste_menus_profil_rh_eng(?, ?);";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "call sp_c_get_liste_menus_profil_rh(?, ?);";
|
||||
}
|
||||
|
||||
$menu = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProfil));
|
||||
|
||||
return $menu->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
}
|
||||
|
||||
public function getSousMenusAccessiblesVue($codeProfil, $vue)
|
||||
{
|
||||
$sql = "call sp_c_get_sous_menus_accessibles_vue_rh(?, ?, ?);";
|
||||
|
||||
$menu = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProfil, $vue));
|
||||
|
||||
return $menu->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getSousMenusNonAccessiblesVue($codeProfil, $vue)
|
||||
{
|
||||
$sql = "call sp_c_get_sous_menus_non_accessibles_vue_rh(?, ?, ?);";
|
||||
|
||||
$menu = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProfil, $vue));
|
||||
|
||||
return $menu->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
}
|
||||
95
Vue/Accessubmenus/index.php
Executable file
95
Vue/Accessubmenus/index.php
Executable file
|
|
@ -0,0 +1,95 @@
|
|||
<?php $this->titre = "INTER SANTE - Accès Sous-Menus"; ?>
|
||||
|
||||
<div class="container-fluid py-4 animate__animated animate__fadeIn">
|
||||
|
||||
<div class="d-flex align-items-center mb-4">
|
||||
<div class="bg-info text-white p-3 rounded-3 shadow-sm me-3">
|
||||
<i class="fas fa-list-ul fa-2x"></i>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0 fw-bold"><?= _("Gestion des Sous-Menus") ?></h4>
|
||||
<p class="text-muted small mb-0"><?= _("Définissez quels boutons et actions sont visibles pour chaque profil") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm border-0 mb-4">
|
||||
<div class="card-body p-4 bg-light rounded-3 border">
|
||||
<div class="row g-3 align-items-end">
|
||||
|
||||
<div class="col-md-4">
|
||||
<label for="codeProfil" class="form-label small fw-bold text-uppercase text-info">
|
||||
<i class="fas fa-user-tag me-1"></i> <?= _("Profil") ?>
|
||||
</label>
|
||||
<select class="form-select shadow-xs border-info-subtle" id="codeProfil" name="codeProfil" onChange="ajax_menus_profil();">
|
||||
<?php liste_options($profil, ""); ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<label for="vue" class="form-label small fw-bold text-uppercase text-info">
|
||||
<i class="fas fa-folder-open me-1"></i> <?= _("Menu Principal") ?>
|
||||
</label>
|
||||
<div id="div_menu">
|
||||
<select class="form-select shadow-xs" id="vue" name="vue">
|
||||
<?php liste_options($menus, ""); ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<button type="button" class="btn btn-primary w-100 fw-bold shadow-sm d-flex align-items-center justify-content-center"
|
||||
onclick="afficher_menu_vue_profil();" style="height: 38px;">
|
||||
<i class="fas fa-sync-alt me-2"></i> <?= _("Actualiser la vue") ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_menu_profil" class="min-vh-50 rounded-4 border-dashed d-flex align-items-center justify-content-center bg-white">
|
||||
<div class="text-center py-5">
|
||||
<div class="mb-3">
|
||||
<i class="fas fa-mouse-pointer fa-3x text-muted opacity-25"></i>
|
||||
</div>
|
||||
<h5 class="text-muted fw-light"><?= _("Sélectionnez un profil et un menu pour gérer les boutons") ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Styles spécifiques pour cette interface */
|
||||
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
|
||||
|
||||
.border-dashed {
|
||||
border: 2px dashed #e9ecef !important;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.form-select {
|
||||
border-radius: 8px;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
.form-select:focus {
|
||||
border-color: #0dcaf0;
|
||||
box-shadow: 0 0 0 0.25rem rgba(13, 202, 240, 0.1);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
border-radius: 8px;
|
||||
transition: transform 0.1s ease;
|
||||
}
|
||||
|
||||
.btn-primary:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
/* Ajustement de la zone de contenu quand elle est remplie */
|
||||
#div_menu_profil:not(:has(.text-center)) {
|
||||
border: none !important;
|
||||
background: transparent;
|
||||
display: block !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
<div id="div_menu_profil">
|
||||
|
||||
<div class="row">
|
||||
<div id="div_utilisateur_profil_1" class="col-6" >
|
||||
|
||||
<legend> <?= _("Boutons invisibles")." (".format_N(count($menus_non_accessibles)).")" ?> </legend>
|
||||
<legend> <?= _("Sous-menus non accessibles")." (".format_N(count($menus_non_accessibles)).")" ?> </legend>
|
||||
|
||||
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
|
||||
<thead>
|
||||
|
|
@ -41,7 +40,7 @@
|
|||
|
||||
<div id="div_utilisateur_profil_2" class="col-6" >
|
||||
|
||||
<legend> <?= _("Boutons visibles")." (".format_N(count($menus_accessibles)).")" ?> </legend>
|
||||
<legend> <?= _("Sous-menus accessibles")." (".format_N(count($menus_accessibles)).")" ?> </legend>
|
||||
|
||||
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
|
||||
<thead>
|
||||
|
|
@ -74,7 +73,6 @@
|
|||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
3
Vue/Ajaxmenusprofil/index.php
Normal file
3
Vue/Ajaxmenusprofil/index.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<SELECT style="font-size:10pt;" class="form-select" id="vue" NAME="vue">
|
||||
<?php liste_options($menus,""); ?>
|
||||
</SELECT>
|
||||
|
|
@ -662,7 +662,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
<!-- Application Scripts -->
|
||||
<script src="/Js/fonctions.js?ver=2026.01.16.00"></script>
|
||||
<script src="/Js/fonctions.js?ver=2026.01.16.01"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
raffraichier_gabarit();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user