diff --git a/Controleur/ControleurAccessubmenus.php b/Controleur/ControleurAccessubmenus.php new file mode 100755 index 0000000..db6e434 --- /dev/null +++ b/Controleur/ControleurAccessubmenus.php @@ -0,0 +1,28 @@ +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 + )); + } +} \ No newline at end of file diff --git a/Controleur/ControleurAjaxchangerlangue.php b/Controleur/ControleurAjaxchangerlangue.php new file mode 100755 index 0000000..26f67c2 --- /dev/null +++ b/Controleur/ControleurAjaxchangerlangue.php @@ -0,0 +1,21 @@ +utilisateur = new Utilisateur(); + } + + public function index() + { + } + + public function changerlangue() + { + $this->utilisateur->changerlangueutilisateur(); + } + +} \ No newline at end of file diff --git a/Controleur/ControleurAjaxhabilitation.php b/Controleur/ControleurAjaxhabilitation.php index 4c798fe..70443a3 100755 --- a/Controleur/ControleurAjaxhabilitation.php +++ b/Controleur/ControleurAjaxhabilitation.php @@ -57,94 +57,52 @@ 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"); + $codeVue = $this->requete->getParametreFormulaire("codeVue"); - $menus_accessibles = $this->utilisateur->getSousMenusAccessiblesVue($codeProfil, $vue); - $menus_non_accessibles = $this->utilisateur->getSousMenusNonAccessiblesVue($codeProfil,$vue); + $menus_accessibles = $this->utilisateur->getSousMenusAccessiblesVue($codeProfil, $codeVue); + $menus_non_accessibles = $this->utilisateur->getSousMenusNonAccessiblesVue($codeProfil,$codeVue); - $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 ajoutertoussousmenusrh() + { + $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); + $codeVue = $this->requete->getParametreFormulaire("codeVue"); + + $this->utilisateur->ajoutertoussousmenusrh($codeProfil, $codeVue); } - public function ajoutertoussousmenusass() + public function retirertoussousmenusrh() { $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); - $vue = $this->requete->getParametreFormulaire("vue"); + $codeVue = $this->requete->getParametreFormulaire("codeVue"); - $this->utilisateur->ajoutertoussousmenusass($codeProfil, $vue); - } - - public function retirertoussousmenusass() - { - $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); - $vue = $this->requete->getParametreFormulaire("vue"); - - $this->utilisateur->retirertoussousmenusass($codeProfil, $vue); + $this->utilisateur->retirertoussousmenusrh($codeProfil, $codeVue); } - public function ajouterunsousmenusass() + public function ajouterunsousmenurh() { $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); - $vue = $this->requete->getParametreFormulaire("vue"); + $codeVue = $this->requete->getParametreFormulaire("codeVue"); $codeMenu = $this->requete->getParametreFormulaire("codeMenu"); - $this->utilisateur->ajouterunsousmenusass($codeProfil, $vue, $codeMenu); + $this->utilisateur->ajouterunsousmenurh($codeProfil, $codeVue, $codeMenu); } - public function retirerunsousmenusass() + public function retirerunsousmenurh() { $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); - $vue = $this->requete->getParametreFormulaire("vue"); + $codeVue = $this->requete->getParametreFormulaire("codeVue"); $codeMenu = $this->requete->getParametreFormulaire("codeMenu"); - $this->utilisateur->retirerunsousmenusass($codeProfil, $vue, $codeMenu); - } - - public function creerprofilass() - { - $libelle = $this->requete->getParametreFormulaire("libelle"); - $libelleEng = $this->requete->getParametreFormulaire("libelleEng"); - - $this->utilisateur->creerprofilass($libelle, $libelleEng); - } - - public function transfererdroitsprofilassureur() - { - $codeProfilSource = $this->requete->getParametreFormulaire("codeProfilSource"); - $codeProfilDest = $this->requete->getParametreFormulaire("codeProfilDest"); - - $this->utilisateur->transfererdroitsprofilassureur($codeProfilSource, $codeProfilDest); - - // $this->genererVueAjax(); - } - - public function batchviderprofilass() - { - $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); - - $this->utilisateur->batchviderprofilass($codeProfil); - } - - public function batchattribuerdroitsreferenceass() - { - $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); - - $this->utilisateur->batchattribuerdroitsreferenceass($codeProfil); - } - - public function ajaxlisteusersass() - { - $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); - $nom = $this->requete->getParametreFormulaire("nom"); - $prenoms = $this->requete->getParametreFormulaire("prenoms"); - $codePointVente = $this->requete->getParametreFormulaire("codePointVente"); - - $users = $this->utilisateur->getusersassueurfiltre($codeProfil, $nom, $prenoms, $codePointVente); - - $this->genererVueAjax(array('users' => $users)); + $this->utilisateur->retirerunsousmenurh($codeProfil, $codeVue, $codeMenu); } } \ No newline at end of file diff --git a/Controleur/ControleurAjaxmenusprofil.php b/Controleur/ControleurAjaxmenusprofil.php new file mode 100755 index 0000000..8a0cb11 --- /dev/null +++ b/Controleur/ControleurAjaxmenusprofil.php @@ -0,0 +1,22 @@ +utilisateur = new Utilisateur(); + } + + public function index() + { + $codeProfil = $this->requete->getParametreFormulaire("codeProfil"); + $menus = $this->utilisateur->getListeProfil($codeProfil); + + $this->genererVueAjax(array( + 'menus' => $menus + )); + } +} \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index 2566e1d..c97b5b5 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -4928,3 +4928,305 @@ function retirer_un_menu_principal_profil_rh(codeMenu) } }); } + +function changer_langue() +{ + codeLangue = $("#codeLangue").val(); + + v_msg="Attention, vous serez déconnecté! Confirmez-vous le changement de langue?"; + v_msgEng="Attention, you will be logged out! Do you confirm the language change?"; + + + confirm_ebene(v_msg, v_msgEng) + .then((isConfirmed) => { + if (isConfirmed) { + // L'utilisateur a confirmé + $.ajax({ + url: $("#racineWeb").val()+"Ajaxchangerlangue/changerlangue/", + type : 'post', + // data: donnees, + error: function(errorData) + { + }, + success: function(data) + { + // $("#div_test_gabarit").html(data); + }, + complete: function() + { + window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/"); + } + }); + } else { + // L'utilisateur a annulé + console.log("Confirmation refusée"); + } + }); + +} + +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(); + $('#div_menu_profil').html(data); + 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() { + } + }); +} + +function ajouter_tous_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; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitation/ajoutertoussousmenusrh/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_profil(); + } + }); +} + +function ajouter_un_menu_vue_profil(codeMenu) +{ + 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; + donnees += '&codeMenu='+codeMenu; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitation/ajouterunsousmenurh/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_profil(); + } + }); +} + +function retirer_tous_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; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitation/retirertoussousmenusrh/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_profil(); + } + }); +} + +function retirer_un_menu_vue_profil(codeMenu) +{ + debugger; + + 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; + donnees += '&codeMenu='+codeMenu; + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxhabilitation/retirerunsousmenurh/", + type: 'POST', + data: donnees, + success: function(data) { + }, + error: function(data) { + }, + complete: function() { + afficher_menu_vue_profil(); + } + }); +} \ No newline at end of file diff --git a/Modele/Utilisateur.php b/Modele/Utilisateur.php index 3c00b6c..112af95 100755 --- a/Modele/Utilisateur.php +++ b/Modele/Utilisateur.php @@ -203,4 +203,111 @@ class Utilisateur extends Modele { $this->executerRequete($sql, array($codeSociete, $codeProfil, $codeMenu, $user)); } + + public function getListeVueModule($codeModule) + { + if (est_anglophone()) + { + $sql = 'call sp_c_get_vues_module_rh_eng(?);'; + } + else + { + $sql = 'call sp_c_get_vues_module_rh(?);'; + } + + $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, $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 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); + } + + public function ajoutertoussousmenusrh($codeProfil, $codeVue) + { + $codeSociete = $_SESSION['codeSociete']; + $user = $_SESSION['login']; + + $sql = 'call sp_c_ajouter_tous_sous_menus_profil_rh(?, ?, ?, ?)'; + + $this->executerRequete($sql, array($codeSociete, $codeProfil, $codeVue, $user)); + } + + public function ajouterunsousmenurh($codeProfil, $codeVue, $codeMenu) + { + $codeSociete = $_SESSION['codeSociete']; + $user = $_SESSION['login']; + + $sql = 'call sp_c_ajouter_un_sous_menus_profil_rh(?, ?, ?, ?, ?)'; + + $this->executerRequete($sql, array($codeSociete, $codeProfil, $codeVue, $codeMenu, $user)); + } + + public function retirertoussousmenusrh($codeProfil, $codeVue) + { + $codeSociete = $_SESSION['codeSociete']; + $user = $_SESSION['login']; + + $sql = 'call sp_c_retirer_tous_sous_menus_profil_rh(?, ?, ?, ?)'; + + $this->executerRequete($sql, array($codeSociete, $codeProfil, $codeVue, $user)); + } + + public function retirerunsousmenurh($codeProfil, $codeVue, $codeMenu) + { + $codeSociete = $_SESSION['codeSociete']; + $user = $_SESSION['login']; + + $sql = 'call sp_c_retirer_un_sous_menus_profil_rh(?, ?, ?, ?, ?)'; + + $this->executerRequete($sql, array($codeSociete, $codeProfil, $codeVue, $codeMenu, $user)); + } } \ No newline at end of file diff --git a/Vue/Accessubmenus/index.php b/Vue/Accessubmenus/index.php new file mode 100755 index 0000000..d455c74 --- /dev/null +++ b/Vue/Accessubmenus/index.php @@ -0,0 +1,95 @@ +titre = "INTER SANTE - Accès Sous-Menus"; ?> + +
+ +
+
+ +
+
+

+

+
+
+ +
+
+
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+
+
+
+ +
+ + \ No newline at end of file diff --git a/Vue/Ajaxhabilitation/afficheraccessousmenus.php b/Vue/Ajaxhabilitation/afficheraccessousmenus.php new file mode 100755 index 0000000..1dd94de --- /dev/null +++ b/Vue/Ajaxhabilitation/afficheraccessousmenus.php @@ -0,0 +1,118 @@ +
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+ +
+ + + + + + + + + +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ +
+ +
+ +
+ + + + + + + + + +
+ +
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/Vue/Ajaxhabilitation/afficheraccessousmenusass.php b/Vue/Ajaxhabilitation/afficheraccessousmenusass.php deleted file mode 100755 index 2833011..0000000 --- a/Vue/Ajaxhabilitation/afficheraccessousmenusass.php +++ /dev/null @@ -1,80 +0,0 @@ -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
=>
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
<=
- -
-
-
diff --git a/Vue/Ajaxmenusprofil/index.php b/Vue/Ajaxmenusprofil/index.php new file mode 100644 index 0000000..de293bf --- /dev/null +++ b/Vue/Ajaxmenusprofil/index.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Vue/Roles/index.php b/Vue/Roles/index.php index afc9346..8f51092 100755 --- a/Vue/Roles/index.php +++ b/Vue/Roles/index.php @@ -14,8 +14,8 @@
-
-