ger
This commit is contained in:
parent
2293832811
commit
fc2e0ea425
45
Controleur/ControleurFicheuserrhclient.php
Executable file
45
Controleur/ControleurFicheuserrhclient.php
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
require_once 'Framework/Controleur.php';
|
||||
require_once 'Modele/Client.php';
|
||||
require_once 'Modele/Menuvueutilisateur.php';
|
||||
require_once 'Modele/Ouinon.php';
|
||||
require_once 'Modele/Langue.php';
|
||||
|
||||
class ControleurFicheuserrhclient extends Controleur {
|
||||
private $menuvue;
|
||||
private $client;
|
||||
private $langue;
|
||||
private $oui_non;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->menuvue = new Menuvueutilisateur();
|
||||
$this->menuvue->getMenuVue("Ficheuserrhclient");
|
||||
|
||||
$this->client = new Client();
|
||||
$this->oui_non = new Ouinon();
|
||||
$this->langue = new Langue();
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
$idUtilisateur = $this->requete->getParametreFormulaire("id");
|
||||
$user_actif = $this->oui_non->getListe();
|
||||
$user_actVisible = $this->oui_non->getListe();
|
||||
$langue = $this->langue->getListe();
|
||||
$user_AffectionVisible = $this->oui_non->getListe();
|
||||
|
||||
$user_rh = $this->client->getunuserrhclient($idUtilisateur);
|
||||
$user_profil = $this->client->getListeProfilRh();
|
||||
|
||||
$this->genererVue(array(
|
||||
'user_rh' => $user_rh,
|
||||
'user_actif' => $user_actif,
|
||||
'user_actVisible' => $user_actVisible,
|
||||
'langue' => $langue,
|
||||
'user_AffectionVisible' => $user_AffectionVisible,
|
||||
'user_profil' => $user_profil
|
||||
));
|
||||
}
|
||||
}
|
||||
309
Js/fonctions.js
309
Js/fonctions.js
|
|
@ -4214,4 +4214,313 @@ function ajax_contexter_police(){
|
|||
function ouvrir_vue(vue)
|
||||
{
|
||||
window.location.assign($("#racineWeb" ).val()+vue+"/");
|
||||
}
|
||||
|
||||
function afficher_users_client_id(idUtilisateur)
|
||||
{
|
||||
window.location.assign($("#racineWeb" ).val()+"Ficheuserrhclient/"+idUtilisateur+"/");
|
||||
}
|
||||
|
||||
function retour_a_users_rh_client()
|
||||
{
|
||||
window.location.assign($("#racineWeb" ).val()+"Usersrhclient/");
|
||||
}
|
||||
|
||||
function enregistrer_modif_user_gc()
|
||||
{
|
||||
idUtilisateur = $("#idUtilisateur").val();
|
||||
nom = $("#nom").val();
|
||||
prenoms = $("#prenoms").val();
|
||||
actif = $("#actif").val();
|
||||
actVisible = $("#actVisibleUser").val();
|
||||
codeLangue = $("#codeLangueUser").val();
|
||||
AffectionVisible = $("#AffectionVisibleUser").val();
|
||||
|
||||
telephone = $("#telephone").val();
|
||||
email = $("#email").val();
|
||||
|
||||
|
||||
if (nom<=" ")
|
||||
{
|
||||
v_msg="Veuillez saisir le nom!";
|
||||
v_msgEng="Please enter the name!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#nom").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (actif<=" ")
|
||||
{
|
||||
v_msg="Utilisateur actif oui ou non?";
|
||||
v_msgEng="Is the user active yes or no?";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#actif").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if(codeLangue<=" ")
|
||||
{
|
||||
v_msg="Veuillez indiquer la langue!";
|
||||
v_msgEng="Please select the language";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeLangueUser").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (actVisible<=" ")
|
||||
{
|
||||
v_msg="Actes visbles oui ou non?";
|
||||
v_msgEng="Acts are visible yes or no?";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#actVisibleUser").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (AffectionVisible<=" ")
|
||||
{
|
||||
v_msg="Affections visbles oui ou non?";
|
||||
v_msgEng="Affections are visible yes or no?";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#AffectionVisible").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!verifMailValeur(email))
|
||||
{
|
||||
v_msg="Veuillez revoir l'adresse mail!";
|
||||
v_msgEng="Please review the email address!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#email").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
donnees = 'idUtilisateur=' + idUtilisateur;
|
||||
donnees += '&nom=' + nom;
|
||||
donnees += '&prenoms=' + prenoms;
|
||||
donnees += '&actif=' + actif;
|
||||
donnees += '&actVisible=' + actVisible;
|
||||
donnees += '&codeLangue=' + codeLangue;
|
||||
donnees += '&AffectionVisible=' + AffectionVisible;
|
||||
donnees += '&telephone='+telephone+'&email='+email;
|
||||
|
||||
v_msg="Confirmez-vous ces modifications?";
|
||||
v_msgEng="Do you confirm these modifications?";
|
||||
|
||||
|
||||
confirm_ebene(v_msg, v_msgEng)
|
||||
.then((isConfirmed) => {
|
||||
if (isConfirmed) {
|
||||
// L'utilisateur a confirmé
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxgcassureur/enregistrermodifusergc/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
// $('#div_test_gabarit').html(data);
|
||||
},
|
||||
complete: function() {
|
||||
retour_a_users_gc();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// L'utilisateur a annulé
|
||||
console.log("Confirmation refusée");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function creer_user_gc()
|
||||
{
|
||||
codeGcAssureur = $("#codeGcAssureur").val();
|
||||
codeUtilisateur = $("#codeUtilisateur").val();
|
||||
codeUtilisateur = codeUtilisateur.trim();
|
||||
codeUtilisateur = supprimer_espace_string(codeUtilisateur);
|
||||
codeUtilisateur = codeUtilisateur.toLowerCase();
|
||||
|
||||
codeModeGenerationPass = $("#codeModeGenerationPass").val();
|
||||
codeModeEnvoiPass = $("#codeModeEnvoiPass").val();
|
||||
|
||||
nom = $("#nom").val();
|
||||
prenoms = $("#prenoms").val();
|
||||
telephone = $("#telephone").val();
|
||||
email = $("#email").val();
|
||||
|
||||
codeLangue = $("#codeLangueUser").val();
|
||||
actVisible = $("#actVisibleUser").val();
|
||||
AffectionVisible = $("#AffectionVisibleUser").val();
|
||||
|
||||
nvmdp = $("#nvmdp").val();
|
||||
cfnvmdp = $("#cfnvmdp").val();
|
||||
|
||||
if(nom<=" ")
|
||||
{
|
||||
v_msg="Veuillez indiquer le nom!";
|
||||
v_msgEng="Please enter the name!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#nom").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if(codeGcAssureur<=" ")
|
||||
{
|
||||
v_msg="Veuillez sélectionner un garant!";
|
||||
v_msgEng="Please select a guarantor!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(codeUtilisateur<=" ")
|
||||
{
|
||||
v_msg="Veuillez indiquer le login!";
|
||||
v_msgEng="Please enter the login!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeUtilisateur").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(codeLangue<=" ")
|
||||
{
|
||||
v_msg="Veuillez indiquer la langue!";
|
||||
v_msgEng="Please select the language";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeLangueUser").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (actVisible<=" ")
|
||||
{
|
||||
v_msg="Actes visbles oui ou non?";
|
||||
v_msgEng="Acts are visible yes or no?";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#actVisibleUser").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (AffectionVisible<=" ")
|
||||
{
|
||||
v_msg="Affections visbles oui ou non?";
|
||||
v_msgEng="Affections are visible yes or no?";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#AffectionVisibleUser").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((codeModeEnvoiPass=="1" || codeModeEnvoiPass=="2") && (telephone <=" ") )
|
||||
{
|
||||
v_msg="Veuillez revoir le téléphone!";
|
||||
v_msgEng="Please review the phone!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#telephone").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((codeModeEnvoiPass=="0" || codeModeEnvoiPass=="2") && (email <=" ") )
|
||||
{
|
||||
v_msg="Veuillez revoir l'adresse mail!";
|
||||
v_msgEng="Please review the email address!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#email").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if(codeModeGenerationPass=="0")
|
||||
{
|
||||
if(nvmdp<=" ")
|
||||
{
|
||||
v_msg="Veuillez indiquer le mot de passe!";
|
||||
v_msgEng="Please enter the password!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#nvmdp").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if(nvmdp != cfnvmdp)
|
||||
{
|
||||
v_msg="Veuillez confirmer votre mot de passe!";
|
||||
v_msgEng="Please confirm your password!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#cfnvmdp").focus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!verifMailValeur(email))
|
||||
{
|
||||
v_msg="Veuillez revoir l'adresse mail!";
|
||||
v_msgEng="Please review the email address!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#email").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
motPass = nvmdp;
|
||||
|
||||
donnees = 'codeGcAssureur='+codeGcAssureur+'&codeUtilisateur='+codeUtilisateur;
|
||||
donnees += '&nom='+nom+'&prenoms='+prenoms;
|
||||
donnees += '&telephone='+telephone+'&email='+email+'&motPass='+motPass;
|
||||
donnees += '&codeLangue='+codeLangue+'&actVisible='+actVisible;
|
||||
donnees += '&AffectionVisible='+AffectionVisible;
|
||||
donnees += '&codeModeGenerationPass='+codeModeGenerationPass;
|
||||
donnees += '&codeModeEnvoiPass='+codeModeEnvoiPass;
|
||||
|
||||
v_msg="Confirmez-vous ce nouvel utilisateur?";
|
||||
v_msgEng="Do you confirm this new user?";
|
||||
|
||||
confirm_ebene(v_msg, v_msgEng)
|
||||
.then((isConfirmed) => {
|
||||
if (isConfirmed) {
|
||||
$.ajax({
|
||||
url: $("#racineWeb").val()+"Ajaxgcassureur/creerusergc/",
|
||||
type : 'post',
|
||||
data: donnees,
|
||||
error: function(errorData) {
|
||||
},
|
||||
success: function(data) {
|
||||
$('#div_unicite_login').html(data);
|
||||
},
|
||||
complete: function()
|
||||
{
|
||||
uniciteLogin = $("#uniciteLogin").val();
|
||||
if(uniciteLogin==1)
|
||||
{
|
||||
v_msg="Utilisateur ( "+codeUtilisateur+" ) créé avec succès!";
|
||||
v_msgEng="User ( "+codeUtilisateur+" ) created succssfully!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
retour_a_users_gc();
|
||||
}
|
||||
else
|
||||
{
|
||||
v_msg="Login " + codeUtilisateur +" déjà utilisé!";
|
||||
v_msgEng="Login " + codeUtilisateur +" already in use!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
$("#codeUtilisateur").focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -296,4 +296,26 @@ class Client extends Modele {
|
|||
|
||||
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getunuserrhclient($idUtilisateur)
|
||||
{
|
||||
$sql = 'call sp_un_user_rh_client(?)';
|
||||
|
||||
$resultat = $this->executerRequete($sql, array($idUtilisateur));
|
||||
|
||||
return $resultat->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getListeProfilRh()
|
||||
{
|
||||
if (est_anglophone()){
|
||||
$sql = 'call sp_get_liste_profil_rh_eng()';
|
||||
}else{
|
||||
$sql = 'call sp_get_liste_profil_rh()';
|
||||
}
|
||||
|
||||
$resultat = $this->executerRequete($sql);
|
||||
|
||||
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
||||
73
Vue/Ficheuserrhclient/index.php
Executable file
73
Vue/Ficheuserrhclient/index.php
Executable file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
$this->titre = "ISA WEB - Modifier Utilisteur Portail RH";
|
||||
|
||||
$idClient = $this->nettoyer($user_rh['idClient']);
|
||||
$idUtilisateur = $user_rh['id'];
|
||||
$codeUtilisateur = $user_rh['codeUtilisateur'];
|
||||
$actif = $user_rh['actif'];
|
||||
$actVisible = $user_rh['actVisible'];
|
||||
$reInit = $user_rh['reInit'];
|
||||
$codeLangue = $user_rh['codeLangue'];
|
||||
$AffectionVisible = $user_rh['AffectionVisible'];
|
||||
$codeProfil = $user_rh['codeProfil'];
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
|
||||
<input class="sr-only" type="text" id="idUtilisateur" name="idUtilisateur" value="<?= $idUtilisateur ?>" >
|
||||
<input class="sr-only" type="text" id="idClient" name="idClient" value="<?= $idClient ?>" >
|
||||
|
||||
<legend> <?= _("Modifier Utilisateur") . ": " . $codeUtilisateur ?> </legend>
|
||||
|
||||
<table class="table table-responsive table-condensed" style="font-size:10pt;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="10%" class="required"> <?= _("Nom") ?> </td>
|
||||
<td width="40%" ><INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="nom" NAME="nom" value="<?=$this->nettoyer( $user_rh['nom'])?>" required AUTOCOMPLETE="OFF" autofocus ></td>
|
||||
|
||||
<td width="12%" align="center" > <?= _("Prénoms") ?> </td>
|
||||
<td colspan="3" ><INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="prenoms" NAME="prenoms" value="<?=$this->nettoyer( $user_rh['prenoms'])?>" ></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="required"> <?= _("Téléphone") ?> </td>
|
||||
<td><INPUT style='font-size:10pt;' class="form-control" TYPE="tel" id="telephone" NAME="telephone" value="<?=$this->nettoyer( $user_rh['telephone'])?>" required></td>
|
||||
|
||||
<td align="center" class="required"> E-mail </td>
|
||||
<td colspan="3" > <INPUT style='font-size:10pt;' class="form-control" TYPE="email" id="email" NAME="email" value="<?=$this->nettoyer( $user_rh['email'])?>" required> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <?= _("Profil/Rôle") ?> </td>
|
||||
<td>
|
||||
<SELECT style="font-size:10pt;" class="form-control" id="codeProfil" NAME="codeProfil" >
|
||||
<?php liste_options($user_profil, $codeProfil, true); ?>
|
||||
</SELECT>
|
||||
</td>
|
||||
|
||||
<td align="center"> <?= _("Actif?") ?> </td>
|
||||
<td>
|
||||
<SELECT style="font-size:10pt;" class="form-control" id="actif" NAME="actif" >
|
||||
<?php liste_options($user_actif, $actif, true); ?>
|
||||
</SELECT>
|
||||
</td>
|
||||
|
||||
<td align="center"> <?= _("Langue") ?> </td>
|
||||
<td>
|
||||
<SELECT style="font-size:10pt;" class="form-select" id="codeLangueUser" NAME="codeLangueUser" >
|
||||
<?php liste_options($langue, $codeLangue, true); ?>
|
||||
</SELECT>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> <input id="btn_enreg" name="btn_enreg" class = "form-control btn btn-primary" type="button" value="<?= _("Enregistrer") ?>" onClick="javascript:enregistrer_modif_user_rh();" style='font-size:10pt;' > </td>
|
||||
|
||||
<td> </td>
|
||||
<td colspan="3" > <input class = "form-control btn btn-warning" type="button" value="<?= _("Annuler") ?>" onClick="javascript:retour_a_users_rh_client();" style='font-size:9pt;' > </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
@ -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.13.00"></script>
|
||||
<script src="/Js/fonctions.js?ver=2026.01.14.00"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
raffraichier_gabarit();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user