diff --git a/SIRH/__pycache__/settings.cpython-310.pyc b/SIRH/__pycache__/settings.cpython-310.pyc index b25a13a..a449f30 100644 Binary files a/SIRH/__pycache__/settings.cpython-310.pyc and b/SIRH/__pycache__/settings.cpython-310.pyc differ diff --git a/SIRH/__pycache__/sso.cpython-310.pyc b/SIRH/__pycache__/sso.cpython-310.pyc index 652cc77..a243941 100644 Binary files a/SIRH/__pycache__/sso.cpython-310.pyc and b/SIRH/__pycache__/sso.cpython-310.pyc differ diff --git a/SIRH/__pycache__/urls.cpython-310.pyc b/SIRH/__pycache__/urls.cpython-310.pyc index e38103f..9a962a7 100644 Binary files a/SIRH/__pycache__/urls.cpython-310.pyc and b/SIRH/__pycache__/urls.cpython-310.pyc differ diff --git a/SIRH/__pycache__/views.cpython-310.pyc b/SIRH/__pycache__/views.cpython-310.pyc index 1f7ad03..c9589ae 100644 Binary files a/SIRH/__pycache__/views.cpython-310.pyc and b/SIRH/__pycache__/views.cpython-310.pyc differ diff --git a/SIRH/views.py b/SIRH/views.py index 7d7a618..f181c11 100644 --- a/SIRH/views.py +++ b/SIRH/views.py @@ -1,13 +1,13 @@ -from django.contrib.auth import logout -from django.shortcuts import redirect -from django.urls import reverse_lazy - - -def connexion(request): - """Redirige vers le serveur SSO pour l'authentification.""" - return redirect(reverse_lazy("simple-sso-login")) - -def deconnexion(request): - """Gérez la déconnexion des utilisateurs.""" - logout(request) - return redirect("http://authentification.cerfig.org/login") +from django.contrib.auth import logout +from django.shortcuts import redirect +from django.urls import reverse_lazy + + +def connexion(request): + """Redirige vers le serveur SSO pour l'authentification.""" + return redirect(reverse_lazy("simple-sso-login")) + +def deconnexion(request): + """Gérez la déconnexion des utilisateurs.""" + logout(request) + return redirect("http://authentification.cerfig.org/login") diff --git a/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc b/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc index b08bd00..48d389b 100644 Binary files a/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc and b/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc differ diff --git a/fonction_utilitaire/fonctions_utilitaire.py b/fonction_utilitaire/fonctions_utilitaire.py index 8d71710..e7ea8aa 100644 --- a/fonction_utilitaire/fonctions_utilitaire.py +++ b/fonction_utilitaire/fonctions_utilitaire.py @@ -7,7 +7,6 @@ QUOTA_CONGE_ANNUEL = 30 NOMBRE_PAGINATION = 8 DEBUT_RAPPEL = 60 DUREE_FIN_CONTRAT = 90 -EMAIL_ASSISTANTE_DE_DIRECTION = list(Employe.objects.filter(fonction="assistant_direction").values_list('user__email', flat=True)) try: EMAIL_ASSISTANTE_DE_DIRECTION = list(Employe.objects.filter(fonction="assistant_direction").values_list('user__email', flat=True)) diff --git a/gestion_conge/migrations/0001_initial.py b/gestion_conge/migrations/0001_initial.py index 79acba5..4bdb298 100644 --- a/gestion_conge/migrations/0001_initial.py +++ b/gestion_conge/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.2.13 on 2026-09-01 10:51 +# Generated by Django 5.2.13 on 2026-09-03 14:33 import django.db.models.deletion from django.db import migrations, models diff --git a/gestion_conge/templates/gestion_conge/index.html b/gestion_conge/templates/gestion_conge/index.html index 4ac2390..30a2595 100644 --- a/gestion_conge/templates/gestion_conge/index.html +++ b/gestion_conge/templates/gestion_conge/index.html @@ -7,6 +7,7 @@
{{message}}
{% endfor %} {% endif %} +
diff --git a/gestion_employe/__pycache__/forms.cpython-310.pyc b/gestion_employe/__pycache__/forms.cpython-310.pyc index 226c96e..6db5546 100644 Binary files a/gestion_employe/__pycache__/forms.cpython-310.pyc and b/gestion_employe/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/urls.cpython-310.pyc b/gestion_employe/__pycache__/urls.cpython-310.pyc index b79276e..c537b22 100644 Binary files a/gestion_employe/__pycache__/urls.cpython-310.pyc and b/gestion_employe/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/views.cpython-310.pyc b/gestion_employe/__pycache__/views.cpython-310.pyc index b139809..f0c137a 100644 Binary files a/gestion_employe/__pycache__/views.cpython-310.pyc and b/gestion_employe/__pycache__/views.cpython-310.pyc differ diff --git a/gestion_employe/forms.py b/gestion_employe/forms.py index 027742e..1e0c42e 100644 --- a/gestion_employe/forms.py +++ b/gestion_employe/forms.py @@ -8,6 +8,8 @@ class EmployeForm(forms.ModelForm): class Meta: model = Employe fields = ( + 'departement', + 'fonction', 'adresse', 'telephone', 'CV', @@ -15,7 +17,18 @@ class EmployeForm(forms.ModelForm): 'rib', 'photo', 'casier_judiciaire' - ) + ) + widgets = { + 'departement': forms.Select(attrs={'class': 'form-select'}), + 'fonction': forms.Select(attrs={'class': 'form-select'}), + 'adresse': forms.TextInput(attrs={'class': 'form-control'}), + 'telephone': forms.TextInput(attrs={'class': 'form-control'}), + 'CV': forms.FileInput(attrs={'class': 'form-control'}), + 'diplome': forms.FileInput(attrs={'class': 'form-control'}), + 'rib': forms.FileInput(attrs={'class': 'form-control'}), + 'photo': forms.FileInput(attrs={'class': 'form-control'}), + 'casier_judiciaire': forms.FileInput(attrs={'class': 'form-control'}), + } class AffectationForm(forms.ModelForm): class Meta: diff --git a/gestion_employe/migrations/0001_initial.py b/gestion_employe/migrations/0001_initial.py index 99015b4..ac760a5 100644 --- a/gestion_employe/migrations/0001_initial.py +++ b/gestion_employe/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.2.13 on 2026-09-01 10:51 +# Generated by Django 5.2.13 on 2026-09-03 14:33 import django.db.models.deletion from django.conf import settings diff --git a/gestion_employe/static/gestion_employe/js/index.js b/gestion_employe/static/gestion_employe/js/index.js index a37e664..23f088e 100644 --- a/gestion_employe/static/gestion_employe/js/index.js +++ b/gestion_employe/static/gestion_employe/js/index.js @@ -29,6 +29,8 @@ fetch(url_liste_employe) tableau_liste_employe.on("rowClick", function (row, rowData) { const data = rowData.getData(); + console.log('Employé cliqué:', data); + document.getElementById('detail-id').value = data.id; document.getElementById('detail-matricule').value = data.matricule; document.getElementById('detail-employe').value = data.employe; @@ -211,23 +213,41 @@ $("enregistrerDetail").addEventListener("click", function() { const fonction = document.getElementById('detail-fonction').value; const dateEmbauche = document.getElementById('detail-dateEmbauche').value; const matricule = document.getElementById('detail-matricule').value; + const departement = document.getElementById('detail-departement').value; + + console.log('=== ENREGISTREMENT DÉTAILS ==='); + console.log('ID:', id_); + console.log('Fonction:', fonction); + console.log('Date embauche:', dateEmbauche); + console.log('Matricule:', matricule); + console.log('Département (valeur brute):', departement); + console.log('Département (type):', typeof departement); + console.log('Département est vide:', !departement); const url_enregistrer_detail = $("modalDetailEmployeBody").dataset.url; + + const payload = { + "id": id_, + "fonction": fonction, + "date_embauche": dateEmbauche, + "matricule": matricule, + "departement": departement + }; + + console.log('Payload JSON:', payload); + console.log('Payload stringifié:', JSON.stringify(payload)); + fetch(url_enregistrer_detail, { method: "POST", headers: { "Content-Type": "application/json", "X-CSRFToken": document.querySelector('[name=csrfmiddlewaretoken]').value }, - body: JSON.stringify({ - "id": id_, - "fonction": fonction, - "date_embauche": dateEmbauche, - "matricule": matricule - }) + body: JSON.stringify(payload) }) .then(response => response.json()) .then(data => { + console.log('Réponse du serveur:', data); alert(data.message); location.reload(); }) diff --git a/gestion_employe/static/gestion_employe/js/mon_profil.js b/gestion_employe/static/gestion_employe/js/mon_profil.js index 6ff0f57..99ec969 100644 --- a/gestion_employe/static/gestion_employe/js/mon_profil.js +++ b/gestion_employe/static/gestion_employe/js/mon_profil.js @@ -18,37 +18,31 @@ const tableau_certificat = new Tabulator("#tableau-certificat", { }) const enregistrerProfil = $("enregistrerProfil"); -// enregistrerProfil.addEventListener("click", (e) => { +enregistrerProfil.addEventListener("click", (e) => { + const url = $("information-personnelles").dataset.url; + const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value; -// const url = $("information-personnelles").dataset.url; -// const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value; + const formData = new FormData(); + formData.append("nom", $("nom").value); + formData.append("prenom", $("prenom").value); + formData.append("email", $("email").value); + formData.append("telephone", $("telephone").value); + formData.append("adresse", $("adresse").value); + formData.append("sexe", $("sexe").value); + formData.append("date_naissance", $("date_naissance").value); + const photoInput = $("photo"); + if (photoInput.files.length > 0) { + formData.append("photo", photoInput.files[0]); + } - // const formData = new FormData(); - // formData.append("nom", $("nom").value); - // formData.append("prenom", $("prenom").value); - // formData.append("email", $("email").value); - // formData.append("telephone", $("telephone").value); - // formData.append("adresse", $("adresse").value); - // formData.append("sexe", $("sexe").value); - // formData.append("date_naissance", $("date_naissance").value); - // const photoInput = $("photo"); - // if (photoInput.files.length > 0) { - // formData.append("photo", photoInput.files[0]); - // } - - -// console.log("---------------------------------------------") -// console.log("Données du formulaire:", url); -// console.log("Données du formulaire:", formData); - -// fetch(url, { -// method: "POST", -// headers: { -// "X-CSRFToken": csrftoken -// }, -// body: formData -// }) -// .then(response => response.json()) -// .then(data => alert(data.message)) -// .catch(error => console.error("Erreur:", error)); -// }); + fetch(url, { + method: "POST", + headers: { + "X-CSRFToken": csrftoken + }, + body: formData + }) + .then(response => response.json()) + .then(data => alert(data.message)) + .catch(error => console.error("Erreur:", error)); +}); \ No newline at end of file diff --git a/gestion_employe/templates/gestion_employe/parts/modalDetailEmploye.html b/gestion_employe/templates/gestion_employe/parts/modalDetailEmploye.html index 7552b33..ffac7f5 100644 --- a/gestion_employe/templates/gestion_employe/parts/modalDetailEmploye.html +++ b/gestion_employe/templates/gestion_employe/parts/modalDetailEmploye.html @@ -8,7 +8,7 @@
-