sert
This commit is contained in:
parent
3477a720a2
commit
272d5dbd9d
|
|
@ -62,8 +62,8 @@ class ControleurAjaxhabilitation extends Controleur
|
|||
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
|
||||
$codeVue = $this->requete->getParametreFormulaire("codeVue");
|
||||
|
||||
$menus_accessibles = $this->utilisateur->getSousMenusAccessiblesVue($codeProfil, $codeVue);
|
||||
$menus_non_accessibles = $this->utilisateur->getSousMenusNonAccessiblesVue($codeProfil,$codeVue);
|
||||
$menus_accessibles = $this->utilisateur->getSousMenusAccessiblesVueRh($codeProfil, $codeVue);
|
||||
$menus_non_accessibles = $this->utilisateur->getSousMenusNonAccessiblesVueRh($codeProfil,$codeVue);
|
||||
|
||||
$this->genererVueAjax(array(
|
||||
'menus_accessibles' => $menus_accessibles,
|
||||
|
|
|
|||
|
|
@ -45112,4 +45112,96 @@ function retirer_un_menu_principal_profil_rh(codeMenu)
|
|||
afficher_menu_principal_profil_rh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
codeVue = $("#codeVue").val();
|
||||
|
||||
if (codeVue<=" ")
|
||||
{
|
||||
v_msg="Veuillez sélectionner une vue!";
|
||||
v_msgEng="Please select a view!";
|
||||
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeVue").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = 'codeProfil='+codeProfil;
|
||||
donnees += '&codeVue='+codeVue;
|
||||
|
||||
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() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -738,4 +738,22 @@ class Utilisateur extends Modele {
|
|||
|
||||
$this->executerRequete($sql, array($codeSociete, $codeProfil, $codeMenu, $user));
|
||||
}
|
||||
|
||||
public function getSousMenusAccessiblesVueRh($codeProfil, $codeVue)
|
||||
{
|
||||
$sql = "call sp_c_get_sous_menus_accessibles_vue_rh(?, ?, ?);";
|
||||
|
||||
$menu = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProfil, $codeVue));
|
||||
|
||||
return $menu->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getSousMenusNonAccessiblesVueRh($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);
|
||||
}
|
||||
}
|
||||
144
Vue/Ajaxhabilitation/afficheraccessousmenus.php
Normal file
144
Vue/Ajaxhabilitation/afficheraccessousmenus.php
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
<div id="div_menu_profil" class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<div id="div_utilisateur_profil_1" class="col-md-6">
|
||||
<div class="panel panel-default" style="box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-radius: 4px;">
|
||||
<div class="panel-heading" style="background-color: #f5f5f5; padding: 12px 15px;">
|
||||
<div class="row">
|
||||
<div class="col-xs-9">
|
||||
<strong style="color: #777; text-transform: uppercase; font-size: 11px;">
|
||||
<span class="glyphicon glyphicon-eye-close" style="margin-right: 8px;"></span>
|
||||
<?= _("Sous-menus non accessibles") ?>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-xs-3 text-right">
|
||||
<span class="badge"><?= format_N(count($menus_non_accessibles)) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-body" style="padding: 10px;">
|
||||
<button type="button" class="btn btn-info btn-sm btn-block"
|
||||
style="font-weight: bold; text-transform: uppercase; font-size: 11px;"
|
||||
onclick="javascript:ajouter_tous_menu_vue_profil();">
|
||||
<?= _("Tout ajouter") ?> <span class="glyphicon glyphicon-chevron-right" style="margin-left: 5px;"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" style="max-height: 450px; overflow-y: auto; border-top: 1px solid #ddd;">
|
||||
<table class="table table-hover" style="margin-bottom: 0;">
|
||||
<tbody>
|
||||
<?php foreach ($menus_non_accessibles as $m):
|
||||
$codeMenu = $m['codeMenu'];
|
||||
$libeleMenu = est_anglophone() ? $m['libelleEng'] : $m['libeleMenu'];
|
||||
?>
|
||||
<tr>
|
||||
<td style="padding-left: 15px; vertical-align: middle; color: #777; border-top: 1px solid #f9f9f9;">
|
||||
<?= $libeleMenu ?>
|
||||
</td>
|
||||
<td class="text-right" style="padding-right: 15px; vertical-align: middle; width: 60px; border-top: 1px solid #f9f9f9;">
|
||||
<button class="btn btn-default btn-xs btn-circle-action"
|
||||
style="color: #5bc0de; border-color: #5bc0de;"
|
||||
title="<?= _("Ajouter") ?>"
|
||||
onClick="javascript:ajouter_un_menu_vue_profil('<?=$codeMenu?>');">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="div_utilisateur_profil_2" class="col-md-6">
|
||||
<div class="panel panel-info" style="box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-radius: 4px; border-color: #d9edf7;">
|
||||
<div class="panel-heading" style="background-color: #d9edf7; padding: 12px 15px; border-color: #d9edf7;">
|
||||
<div class="row">
|
||||
<div class="col-xs-9">
|
||||
<strong style="color: #31708f; text-transform: uppercase; font-size: 11px;">
|
||||
<span class="glyphicon glyphicon-eye-open" style="margin-right: 8px;"></span>
|
||||
<?= _("Sous-menus accessibles") ?>
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-xs-3 text-right">
|
||||
<span class="badge" style="background-color: #31708f;"><?= format_N(count($menus_accessibles)) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-body" style="padding: 10px;">
|
||||
<button type="button" class="btn btn-default btn-sm btn-block"
|
||||
style="font-weight: bold; text-transform: uppercase; font-size: 11px; color: #666;"
|
||||
onclick="javascript:retirer_tous_menu_vue_profil();">
|
||||
<span class="glyphicon glyphicon-chevron-left" style="margin-right: 5px;"></span> <?= _("Tout retirer") ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive" style="max-height: 450px; overflow-y: auto; border-top: 1px solid #d9edf7; background-color: #fff;">
|
||||
<table class="table table-hover" style="margin-bottom: 0;">
|
||||
<tbody>
|
||||
<?php foreach ($menus_accessibles as $m):
|
||||
$codeMenu = $m['codeMenu'];
|
||||
$libeleMenu = est_anglophone() ? $m['libelleEng'] : $m['libeleMenu'];
|
||||
?>
|
||||
<tr>
|
||||
<td class="text-left" style="padding-left: 15px; vertical-align: middle; width: 60px; border-top: 1px solid #f0f7fa;">
|
||||
<button class="btn btn-default btn-xs btn-circle-action"
|
||||
style="color: #777;"
|
||||
title="<?= _("Retirer") ?>"
|
||||
onClick="javascript:retirer_un_menu_vue_profil('<?=$codeMenu?>');">
|
||||
<span class="glyphicon glyphicon-minus"></span>
|
||||
</button>
|
||||
</td>
|
||||
<td style="vertical-align: middle; border-top: 1px solid #f0f7fa;">
|
||||
<strong style="color: #333;"><?= $libeleMenu ?></strong>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Boutons d'action circulaires pour Bootstrap 3 */
|
||||
.btn-circle-action {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
padding: 0;
|
||||
border-radius: 50%;
|
||||
line-height: 28px;
|
||||
text-align: center;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-circle-action:hover {
|
||||
background-color: #5bc0de;
|
||||
color: white !important;
|
||||
border-color: #5bc0de;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/* Animation de fondu */
|
||||
#div_menu_profil {
|
||||
animation: fadeIn 0.4s ease-in;
|
||||
}
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; } to { opacity: 1; }
|
||||
}
|
||||
|
||||
/* Scrollbar pour anciens navigateurs */
|
||||
.table-responsive::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
.table-responsive::-webkit-scrollbar-thumb {
|
||||
background: #ccc;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -263,7 +263,7 @@ controlerPlafondBeneficiaire : <?= $_SESSION['controlerPlafondBeneficiaire'] ?>
|
|||
<script src="Js/datepicker-fr.js"></script>
|
||||
<?php endif; ?>
|
||||
|
||||
<script src="Js/fonctions.js?ver=2026.03.09.15"></script>
|
||||
<script src="Js/fonctions.js?ver=2026.03.09.16"></script>
|
||||
|
||||
<script src="<?= $_SESSION['dossierSociete'].'/Js/societe.js' ?>" > </script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user