diff --git a/SIRH/__pycache__/__init__.cpython-310.pyc b/SIRH/__pycache__/__init__.cpython-310.pyc index 92d486c..754af56 100644 Binary files a/SIRH/__pycache__/__init__.cpython-310.pyc and b/SIRH/__pycache__/__init__.cpython-310.pyc differ diff --git a/SIRH/__pycache__/settings.cpython-310.pyc b/SIRH/__pycache__/settings.cpython-310.pyc index 3f3bbb0..0b4bf31 100644 Binary files a/SIRH/__pycache__/settings.cpython-310.pyc and b/SIRH/__pycache__/settings.cpython-310.pyc differ diff --git a/SIRH/__pycache__/urls.cpython-310.pyc b/SIRH/__pycache__/urls.cpython-310.pyc index 7058e38..dc00624 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 6611fc5..6835a9e 100644 Binary files a/SIRH/__pycache__/views.cpython-310.pyc and b/SIRH/__pycache__/views.cpython-310.pyc differ diff --git a/SIRH/__pycache__/wsgi.cpython-310.pyc b/SIRH/__pycache__/wsgi.cpython-310.pyc index e1f658c..5c859c6 100644 Binary files a/SIRH/__pycache__/wsgi.cpython-310.pyc and b/SIRH/__pycache__/wsgi.cpython-310.pyc differ diff --git a/SIRH/urls.py b/SIRH/urls.py index 50b9078..ba5be4b 100644 --- a/SIRH/urls.py +++ b/SIRH/urls.py @@ -41,7 +41,7 @@ urlpatterns = [ name='deconnexion' ), path( - 'employé/', + 'gestion-employe/', include("gestion_employe.urls") ), path( diff --git a/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc b/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc index 9c2adc8..5d73229 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 eb56ca3..3b53db8 100644 --- a/fonction_utilitaire/fonctions_utilitaire.py +++ b/fonction_utilitaire/fonctions_utilitaire.py @@ -7,7 +7,10 @@ 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)) +except: + pass def solde_conge(employe): """Fonction de calcul du solde de congé restant l'employé""" diff --git a/gestion_conge/__pycache__/__init__.cpython-310.pyc b/gestion_conge/__pycache__/__init__.cpython-310.pyc index 987b2f8..2e4e608 100644 Binary files a/gestion_conge/__pycache__/__init__.cpython-310.pyc and b/gestion_conge/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/admin.cpython-310.pyc b/gestion_conge/__pycache__/admin.cpython-310.pyc index 2c9ad77..8403b94 100644 Binary files a/gestion_conge/__pycache__/admin.cpython-310.pyc and b/gestion_conge/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/apps.cpython-310.pyc b/gestion_conge/__pycache__/apps.cpython-310.pyc index 609f119..f5e111f 100644 Binary files a/gestion_conge/__pycache__/apps.cpython-310.pyc and b/gestion_conge/__pycache__/apps.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/forms.cpython-310.pyc b/gestion_conge/__pycache__/forms.cpython-310.pyc index 647d273..a383b85 100644 Binary files a/gestion_conge/__pycache__/forms.cpython-310.pyc and b/gestion_conge/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/models.cpython-310.pyc b/gestion_conge/__pycache__/models.cpython-310.pyc index 2f5b81c..4106b10 100644 Binary files a/gestion_conge/__pycache__/models.cpython-310.pyc and b/gestion_conge/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/urls.cpython-310.pyc b/gestion_conge/__pycache__/urls.cpython-310.pyc index 1341087..1366049 100644 Binary files a/gestion_conge/__pycache__/urls.cpython-310.pyc and b/gestion_conge/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/views.cpython-310.pyc b/gestion_conge/__pycache__/views.cpython-310.pyc index 176c828..0707546 100644 Binary files a/gestion_conge/__pycache__/views.cpython-310.pyc and b/gestion_conge/__pycache__/views.cpython-310.pyc differ diff --git a/gestion_conge/migrations/0001_initial.py b/gestion_conge/migrations/0001_initial.py index 6a7e09d..fad7f87 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-04-17 12:03 +# Generated by Django 5.2.13 on 2026-07-03 18:13 import django.db.models.deletion from django.db import migrations, models diff --git a/gestion_employe/__pycache__/__init__.cpython-310.pyc b/gestion_employe/__pycache__/__init__.cpython-310.pyc index 7ef245d..662a150 100644 Binary files a/gestion_employe/__pycache__/__init__.cpython-310.pyc and b/gestion_employe/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/admin.cpython-310.pyc b/gestion_employe/__pycache__/admin.cpython-310.pyc index b3b000c..363ddf7 100644 Binary files a/gestion_employe/__pycache__/admin.cpython-310.pyc and b/gestion_employe/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/forms.cpython-310.pyc b/gestion_employe/__pycache__/forms.cpython-310.pyc index a88d33a..97052b4 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__/models.cpython-310.pyc b/gestion_employe/__pycache__/models.cpython-310.pyc index afc99ae..0cae160 100644 Binary files a/gestion_employe/__pycache__/models.cpython-310.pyc and b/gestion_employe/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/urls.cpython-310.pyc b/gestion_employe/__pycache__/urls.cpython-310.pyc index 93ed628..9d78655 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 583bcce..fd6ee13 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/migrations/0001_initial.py b/gestion_employe/migrations/0001_initial.py index 26edccb..f5eaf71 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-04-17 12:03 +# Generated by Django 5.2.13 on 2026-07-03 18:13 import django.db.models.deletion from django.conf import settings @@ -27,7 +27,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('matricule', models.CharField(blank=True, max_length=10, null=True, unique=True)), - ('fonction', models.CharField(blank=True, choices=[('directeur', 'Directeur'), ('assistant_direction', 'Assistante de direction'), ('comptable', 'Comptable'), ('raf', 'RAF'), ('data_manager', 'Data Manager'), ('logisticien', 'Logisticien'), ('post_doctorant', 'Post-Doctorant'), ('qualiticien', 'Qualiticien'), ('technicien_surface', 'Technicien de surface'), ('chauffeur', 'Chauffeur')], max_length=50, null=True)), + ('fonction', models.CharField(blank=True, choices=[('directeur', 'Directeur'), ('assistant_direction', 'Assistante de direction'), ('assistant_technique_recherche', 'Assistant technique de recherche'), ('comptable', 'Comptable'), ('raf', 'RAF'), ('data_manager', 'Data Manager'), ('logisticien', 'Logisticien'), ('post_doctorant', 'Post-Doctorant'), ('qualiticien', 'Qualiticien'), ('technicien_surface', 'Technicien de surface'), ('chauffeur', 'Chauffeur')], max_length=50, null=True)), ('date_embauche', models.DateField(blank=True, null=True)), ('adresse', models.CharField(blank=True, max_length=100, null=True)), ('telephone', models.CharField(blank=True, max_length=15, null=True)), @@ -48,7 +48,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('numero_contrat', models.CharField(max_length=100, unique=True)), - ('type_contrat', models.CharField(choices=[('contrat_duree_determinee', 'Contrat à Durée Déterminée'), ('contrat_duree_indeterminee', 'Contrat à Durée Indéterminée'), ('contrat_prestation', 'Contrat de Prestation de Service'), ('contrat_stage', 'Contrat de Stage')], max_length=50)), + ('type_contrat', models.CharField(choices=[('contrat_duree_determinee', 'Contrat à Durée Déterminée'), ('contrat_duree_indeterminee', 'Contrat à Durée Indéterminée'), ('contrat_prestation', 'Contrat de Prestation de Service'), ('contrat_stage', 'Contrat de Stage'), ('convention_bourse_entretien', "Convention de bourse d'entretien")], max_length=50)), ('date_debut', models.DateField()), ('date_fin', models.DateField(blank=True, null=True)), ('salaire_mensuel', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)), diff --git a/gestion_employe/migrations/0002_alter_contrat_type_contrat.py b/gestion_employe/migrations/0002_alter_contrat_type_contrat.py deleted file mode 100644 index 4fd9717..0000000 --- a/gestion_employe/migrations/0002_alter_contrat_type_contrat.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 6.0.4 on 2026-04-29 10:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('gestion_employe', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='contrat', - name='type_contrat', - field=models.CharField(choices=[('contrat_duree_determinee', 'Contrat à Durée Déterminée'), ('contrat_duree_indeterminee', 'Contrat à Durée Indéterminée'), ('contrat_prestation', 'Contrat de Prestation de Service'), ('contrat_stage', 'Contrat de Stage'), ('convention_bourse_entretien', "Convention de bourse d'entretien")], max_length=50), - ), - ] diff --git a/gestion_employe/static/gestion_employe/js/mon_profil.js b/gestion_employe/static/gestion_employe/js/mon_profil.js index 77178b4..8ffe818 100644 --- a/gestion_employe/static/gestion_employe/js/mon_profil.js +++ b/gestion_employe/static/gestion_employe/js/mon_profil.js @@ -18,29 +18,34 @@ 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(); +// 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); +// 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); - 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 + +// 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)); +// }); \ No newline at end of file diff --git a/gestion_employe/templates/gestion_employe/monprofil.html b/gestion_employe/templates/gestion_employe/monprofil.html index 3ca4fbf..95da162 100644 --- a/gestion_employe/templates/gestion_employe/monprofil.html +++ b/gestion_employe/templates/gestion_employe/monprofil.html @@ -38,7 +38,7 @@
-
+
{% csrf_token %}
@@ -50,19 +50,19 @@
- +
- +
- +
- @@ -72,27 +72,27 @@
- +
- +
- +
- +
- +
-
- + +
diff --git a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc b/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc index b6fa4ab..4b79428 100644 Binary files a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc and b/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc differ diff --git a/gestion_employe/views.py b/gestion_employe/views.py index 80d902c..b30ac04 100644 --- a/gestion_employe/views.py +++ b/gestion_employe/views.py @@ -191,25 +191,26 @@ def modifier_employer(request): except Employe.DoesNotExist: return JsonResponse({"message": "Employé non trouvé."}) if request.method == "POST": - data = json.loads(request.body) user = User.objects.get(username=request.user) - user.last_name = data['nom'] - user.first_name = data['prenom'] - user.email = data['email'] - employe.telephone = data['telephone'] - employe.adresse = data['adresse'] - employe.sexe = data['sexe'] + user.last_name = request.POST['nom'] + user.first_name = request.POST['prenom'] + user.email = request.POST['email'] + employe.telephone = request.POST['telephone'] + employe.adresse = request.POST['adresse'] + employe.sexe = request.POST['sexe'] if request.FILES.get("photo"): employe.photo = request.FILES["photo"] - if data['date_naissance']: - difference = relativedelta(timezone.now().date(), datetime.strptime(data['date_naissance'], "%Y-%m-%d").date()) + if request.POST['date_naissance']: + difference = relativedelta(timezone.now().date(), datetime.strptime(request.POST['date_naissance'], "%Y-%m-%d").date()) if difference.years >= 18: - employe.date_naissance = data['date_naissance'] + employe.date_naissance = request.POST['date_naissance'] else: - return JsonResponse({"message": "Veuillez entrez une date de naissance correcte."}) + messages.error(request, "Veuillez entrez une date de naissance correcte.") employe.save() user.save() - return JsonResponse({"message": "Profil mis à jour avec succès."}) + messages.success(request, "Profil mis à jour avec succès.") + return redirect("gestion_employe:mon-profil") + def enregistrement_document(request): """Vue pour permettre à un utilisateur de télécharger et enregistrer des documents liés à son profil""" diff --git a/gestion_projet/__pycache__/__init__.cpython-310.pyc b/gestion_projet/__pycache__/__init__.cpython-310.pyc index 48bd83f..6f58d41 100644 Binary files a/gestion_projet/__pycache__/__init__.cpython-310.pyc and b/gestion_projet/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/admin.cpython-310.pyc b/gestion_projet/__pycache__/admin.cpython-310.pyc index 21dd052..07787b7 100644 Binary files a/gestion_projet/__pycache__/admin.cpython-310.pyc and b/gestion_projet/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/forms.cpython-310.pyc b/gestion_projet/__pycache__/forms.cpython-310.pyc index 22bbb9b..a6a63c4 100644 Binary files a/gestion_projet/__pycache__/forms.cpython-310.pyc and b/gestion_projet/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/models.cpython-310.pyc b/gestion_projet/__pycache__/models.cpython-310.pyc index 19a467c..3b93566 100644 Binary files a/gestion_projet/__pycache__/models.cpython-310.pyc and b/gestion_projet/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/urls.cpython-310.pyc b/gestion_projet/__pycache__/urls.cpython-310.pyc index 1a95b18..0b16c0e 100644 Binary files a/gestion_projet/__pycache__/urls.cpython-310.pyc and b/gestion_projet/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/views.cpython-310.pyc b/gestion_projet/__pycache__/views.cpython-310.pyc index ec80360..dda1808 100644 Binary files a/gestion_projet/__pycache__/views.cpython-310.pyc and b/gestion_projet/__pycache__/views.cpython-310.pyc differ diff --git a/gestion_projet/migrations/0001_initial.py b/gestion_projet/migrations/0001_initial.py index c85eb6d..f4dad50 100644 --- a/gestion_projet/migrations/0001_initial.py +++ b/gestion_projet/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.2.13 on 2026-04-17 12:03 +# Generated by Django 5.2.13 on 2026-07-03 18:13 import django.db.models.deletion from django.db import migrations, models diff --git a/gestion_salle/__pycache__/__init__.cpython-310.pyc b/gestion_salle/__pycache__/__init__.cpython-310.pyc index 13c3ba8..d70727c 100644 Binary files a/gestion_salle/__pycache__/__init__.cpython-310.pyc and b/gestion_salle/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/admin.cpython-310.pyc b/gestion_salle/__pycache__/admin.cpython-310.pyc index 4e1b01c..b0a85f3 100644 Binary files a/gestion_salle/__pycache__/admin.cpython-310.pyc and b/gestion_salle/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/apps.cpython-310.pyc b/gestion_salle/__pycache__/apps.cpython-310.pyc index 8c518c8..e1f3990 100644 Binary files a/gestion_salle/__pycache__/apps.cpython-310.pyc and b/gestion_salle/__pycache__/apps.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/forms.cpython-310.pyc b/gestion_salle/__pycache__/forms.cpython-310.pyc index fdcd7e1..8d57e79 100644 Binary files a/gestion_salle/__pycache__/forms.cpython-310.pyc and b/gestion_salle/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/models.cpython-310.pyc b/gestion_salle/__pycache__/models.cpython-310.pyc index ce668cc..8a699eb 100644 Binary files a/gestion_salle/__pycache__/models.cpython-310.pyc and b/gestion_salle/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/urls.cpython-310.pyc b/gestion_salle/__pycache__/urls.cpython-310.pyc index 187924c..637f582 100644 Binary files a/gestion_salle/__pycache__/urls.cpython-310.pyc and b/gestion_salle/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/views.cpython-310.pyc b/gestion_salle/__pycache__/views.cpython-310.pyc index 9efbbda..85a7479 100644 Binary files a/gestion_salle/__pycache__/views.cpython-310.pyc and b/gestion_salle/__pycache__/views.cpython-310.pyc differ diff --git a/gestion_salle/migrations/0001_initial.py b/gestion_salle/migrations/0001_initial.py index f477d96..838585f 100644 --- a/gestion_salle/migrations/0001_initial.py +++ b/gestion_salle/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 5.2.13 on 2026-04-17 12:03 +# Generated by Django 5.2.13 on 2026-07-03 18:13 import django.db.models.deletion from django.db import migrations, models