diff --git a/Controleur/ControleurAjaxhabilitation.php b/Controleur/ControleurAjaxhabilitation.php index 75b3f127..28714929 100644 --- a/Controleur/ControleurAjaxhabilitation.php +++ b/Controleur/ControleurAjaxhabilitation.php @@ -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, diff --git a/Js/fonctions.js b/Js/fonctions.js index 0ad462b5..7464de59 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -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(` +
+
+ Loading... +
+ + Veuillez patienter... / Please wait... + +
+ `); + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitation/afficheraccessousmenus/", + type : 'post', + data: donnees, + error: function(errorData) { + }, + success: function(data) + { + div_attente.html(data); + }, + complete: function() { + } + }); } \ No newline at end of file diff --git a/Modele/Utilisateur.php b/Modele/Utilisateur.php index e5026b4a..63c38211 100644 --- a/Modele/Utilisateur.php +++ b/Modele/Utilisateur.php @@ -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); + } } \ No newline at end of file diff --git a/Vue/Ajaxhabilitation/afficheraccessousmenus.php b/Vue/Ajaxhabilitation/afficheraccessousmenus.php new file mode 100644 index 00000000..1630bb27 --- /dev/null +++ b/Vue/Ajaxhabilitation/afficheraccessousmenus.php @@ -0,0 +1,144 @@ +
+
+ +
+
+
+
+
+ + + + +
+
+ +
+
+
+ +
+ +
+ +
+ + + + + + + + + +
+ + + +
+
+
+
+ +
+
+
+
+
+ + + + +
+
+ +
+
+
+ +
+ +
+ +
+ + + + + + + + + +
+ + + +
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 1b8d50d3..baa1e58b 100644 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -263,7 +263,7 @@ controlerPlafondBeneficiaire : - +