{% if employe.CV %}
diff --git a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc b/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc
deleted file mode 100644
index de89fbc..0000000
Binary files a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc and /dev/null differ
diff --git a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-312.pyc b/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-312.pyc
deleted file mode 100644
index 17d6b77..0000000
Binary files a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-312.pyc and /dev/null differ
diff --git a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-314.pyc b/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-314.pyc
deleted file mode 100644
index 831b289..0000000
Binary files a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-314.pyc and /dev/null differ
diff --git a/gestion_employe/views.py b/gestion_employe/views.py
index e8e6374..fb40eec 100644
--- a/gestion_employe/views.py
+++ b/gestion_employe/views.py
@@ -1,5 +1,5 @@
import json
-from datetime import timedelta, datetime
+from datetime import date, timedelta, datetime
from dateutil.relativedelta import relativedelta
from django.utils import timezone
@@ -122,26 +122,41 @@ def mon_profil(request):
try:
employe = Employe.objects.get(user__username=request.user)
except Employe.DoesNotExist:
- messages.error(request, "Impossible d'acceder au menu 'Mon profil' car votre profil Utilisateur n'est lié à aucun profil Employé. Veuillez contacter l'Administrateur.")
+ messages.error(
+ request,
+ "Impossible d'acceder au menu 'Mon profil' car votre profil Utilisateur n'est lié à aucun profil Employé. Veuillez contacter l'Administrateur."
+ )
return redirect("gestion_conges:conge")
-
+
contrats = Contrat.objects.filter(employe=employe, statut='actif').first()
+
projets = Affectation.objects.filter(
- employe = employe,
- date_fin_daffectation__gte = timezone.now().date()
+ employe=employe,
+ date_fin_daffectation__gte=timezone.now().date()
).select_related('projet')
+ has_contrat = contrats is not None
+ expiration_contrat = False
+ contrat_nb_jours_restant = None
+
+ if contrats:
+ nb_jours = contrats.nombre_jours_restant
+ contrat_nb_jours_restant = nb_jours
+ expiration_contrat = nb_jours <= fonctions_utilitaire.DUREE_FIN_CONTRAT
+
return render(
- request,
- 'gestion_employe/monprofil.html',
+ request,
+ 'gestion_employe/monprofil.html',
{
'employe': employe,
+
'contrats': [{
**model_to_dict(contrats),
"type_contrat": dict(Contrat.TYPE_CONTRAT).get(contrats.type_contrat),
"statut": dict(Contrat.STATUT_CONTRAT).get(contrats.statut),
"fichier_contrat": contrats.fichier_contrat.url if contrats.fichier_contrat else "",
- } if contrats else []],
+ }] if contrats else [],
+
'projets': [
{
**model_to_dict(a.projet),
@@ -151,12 +166,13 @@ def mon_profil(request):
"pourcentage_temps_affectation": a.pourcentage_temps_affectation
} for a in projets
],
+
"formation_form": FormationForm(),
- "expiration_contrat": contrats.nombre_jours_restant <= fonctions_utilitaire.DUREE_FIN_CONTRAT if contrats else False,
- "contrat_nb_jours_restant": contrats.nombre_jours_restant if contrats else None
+ "has_contrat": has_contrat,
+ "expiration_contrat": expiration_contrat,
+ "contrat_nb_jours_restant": contrat_nb_jours_restant
}
)
-
@login_required
def modifier_mot_passe(request):
"""Vue pour permettre à un utilisateur de modifier son mot de passe et ses informations de profil"""
@@ -176,7 +192,6 @@ def modifier_mot_passe(request):
messages.success(request, "Mot de passe modifié avec succès.")
return redirect("gestion_employe:mon-profil")
-
def modifier_employer(request):
"""Vue pour permettre à un utilisateur de modifier les informations d'un employé"""
try:
@@ -192,7 +207,8 @@ def modifier_employer(request):
employe.telephone = data['telephone']
employe.adresse = data['adresse']
employe.sexe = data['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 difference.years >= 18:
@@ -201,18 +217,18 @@ def modifier_employer(request):
return JsonResponse({"message": "Veuillez entrez une date de naissance correcte."})
employe.save()
user.save()
-
return JsonResponse({"message": "Profil mis à jour avec succès."})
def enregistrement_document(request):
- employe = Employe.objects.get(user__username=request.user)
+ employe = Employe.objects.get(user=request.user)
if request.method == "POST":
- employe.CV = request.FILES["cv"] if 'cv' in request.FILES else employe.CV
- employe.diplome = request.FILES["diplome"] if 'diplome' in request.FILES else employe.diplome
- employe.rib = request.FILES["rib"] if 'rib' in request.FILES else employe.rib
- employe.casier_judiciaire = request.FILES["casier_judiciaire"] if 'casier_judiciaire' in request.FILES else employe.casier_judiciaire
- messages.success(request, "Documents enregistrés avec succès.")
+ if request.FILES.get("photo"):employe.photo = request.FILES["photo"]
+ if "cv" in request.FILES:employe.CV = request.FILES["cv"]
+ if "diplome" in request.FILES: employe.diplome = request.FILES["diplome"]
+ if "rib" in request.FILES: employe.rib = request.FILES["rib"]
+ if "casier_judiciaire" in request.FILES:employe.casier_judiciaire = request.FILES["casier_judiciaire"]
employe.save()
+ messages.success(request, "Documents enregistrés avec succès.")
return redirect("gestion_employe:mon-profil")
@@ -240,14 +256,25 @@ def suppression_affectation(request):
return JsonResponse({"message": "Affectation supprimée avec succès."})
def creation_contrat(request):
- """Vue pour permettre à un utilisateur de créer un contrat pour un employé"""
+ """Créer un contrat pour un employé (avec contrôle d'existence de contrat actif)"""
+
try:
employe = Employe.objects.get(id=request.POST.get('employe_id'))
except Employe.DoesNotExist:
messages.error(request, "Employé non trouvé.")
return redirect('employe-index')
-
+ contrat_actif = Contrat.objects.filter(
+ employe=employe,
+ date_fin__gte=date.today()
+ ).exists()
+
if request.method == "POST":
+ if contrat_actif:
+ messages.error(
+ request,
+ "Impossible de créer un contrat : cet employé a déjà un contrat actif."
+ )
+ return redirect('gestion_employe:index')
form = ContratForm(request.POST, request.FILES)
if form.is_valid():
contrat = form.save(commit=False)
@@ -256,9 +283,13 @@ def creation_contrat(request):
messages.success(request, "Contrat créé avec succès.")
return redirect('gestion_employe:index')
messages.error(request, "Formulaire non valide")
+
else:
form = ContratForm(initial={'employe': employe})
- return render(request, 'gestion_employe/index.html', {'contrat_form': form})
+
+ return render(request, 'gestion_employe/index.html', {
+ 'contrat_form': form
+ })
@login_required
def enregistrer_detail_employe(request):
diff --git a/gestion_projet/__pycache__/__init__.cpython-310.pyc b/gestion_projet/__pycache__/__init__.cpython-310.pyc
deleted file mode 100644
index 466a5f3..0000000
Binary files a/gestion_projet/__pycache__/__init__.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/__init__.cpython-312.pyc b/gestion_projet/__pycache__/__init__.cpython-312.pyc
deleted file mode 100644
index 8423da3..0000000
Binary files a/gestion_projet/__pycache__/__init__.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/__init__.cpython-313.pyc b/gestion_projet/__pycache__/__init__.cpython-313.pyc
deleted file mode 100644
index 3ef0681..0000000
Binary files a/gestion_projet/__pycache__/__init__.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/__init__.cpython-314.pyc b/gestion_projet/__pycache__/__init__.cpython-314.pyc
deleted file mode 100644
index 191e40a..0000000
Binary files a/gestion_projet/__pycache__/__init__.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/admin.cpython-310.pyc b/gestion_projet/__pycache__/admin.cpython-310.pyc
deleted file mode 100644
index 63d8b4a..0000000
Binary files a/gestion_projet/__pycache__/admin.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/admin.cpython-312.pyc b/gestion_projet/__pycache__/admin.cpython-312.pyc
deleted file mode 100644
index c527bb0..0000000
Binary files a/gestion_projet/__pycache__/admin.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/admin.cpython-313.pyc b/gestion_projet/__pycache__/admin.cpython-313.pyc
deleted file mode 100644
index 4673092..0000000
Binary files a/gestion_projet/__pycache__/admin.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/admin.cpython-314.pyc b/gestion_projet/__pycache__/admin.cpython-314.pyc
deleted file mode 100644
index 26641d2..0000000
Binary files a/gestion_projet/__pycache__/admin.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/apps.cpython-310.pyc b/gestion_projet/__pycache__/apps.cpython-310.pyc
deleted file mode 100644
index 11b794a..0000000
Binary files a/gestion_projet/__pycache__/apps.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/apps.cpython-313.pyc b/gestion_projet/__pycache__/apps.cpython-313.pyc
deleted file mode 100644
index e5fe762..0000000
Binary files a/gestion_projet/__pycache__/apps.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/apps.cpython-314.pyc b/gestion_projet/__pycache__/apps.cpython-314.pyc
deleted file mode 100644
index b9a762f..0000000
Binary files a/gestion_projet/__pycache__/apps.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/forms.cpython-310.pyc b/gestion_projet/__pycache__/forms.cpython-310.pyc
deleted file mode 100644
index 851629a..0000000
Binary files a/gestion_projet/__pycache__/forms.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/forms.cpython-312.pyc b/gestion_projet/__pycache__/forms.cpython-312.pyc
deleted file mode 100644
index f59f146..0000000
Binary files a/gestion_projet/__pycache__/forms.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/forms.cpython-313.pyc b/gestion_projet/__pycache__/forms.cpython-313.pyc
deleted file mode 100644
index 26adeae..0000000
Binary files a/gestion_projet/__pycache__/forms.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/forms.cpython-314.pyc b/gestion_projet/__pycache__/forms.cpython-314.pyc
deleted file mode 100644
index ee43e1d..0000000
Binary files a/gestion_projet/__pycache__/forms.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/models.cpython-310.pyc b/gestion_projet/__pycache__/models.cpython-310.pyc
deleted file mode 100644
index 2eb446c..0000000
Binary files a/gestion_projet/__pycache__/models.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/models.cpython-312.pyc b/gestion_projet/__pycache__/models.cpython-312.pyc
deleted file mode 100644
index 234597d..0000000
Binary files a/gestion_projet/__pycache__/models.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/models.cpython-313.pyc b/gestion_projet/__pycache__/models.cpython-313.pyc
deleted file mode 100644
index 495a805..0000000
Binary files a/gestion_projet/__pycache__/models.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/models.cpython-314.pyc b/gestion_projet/__pycache__/models.cpython-314.pyc
deleted file mode 100644
index 09c9670..0000000
Binary files a/gestion_projet/__pycache__/models.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/urls.cpython-310.pyc b/gestion_projet/__pycache__/urls.cpython-310.pyc
deleted file mode 100644
index e10f409..0000000
Binary files a/gestion_projet/__pycache__/urls.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/urls.cpython-312.pyc b/gestion_projet/__pycache__/urls.cpython-312.pyc
deleted file mode 100644
index b941eb2..0000000
Binary files a/gestion_projet/__pycache__/urls.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/urls.cpython-313.pyc b/gestion_projet/__pycache__/urls.cpython-313.pyc
deleted file mode 100644
index 5836f28..0000000
Binary files a/gestion_projet/__pycache__/urls.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/urls.cpython-314.pyc b/gestion_projet/__pycache__/urls.cpython-314.pyc
deleted file mode 100644
index a8efb99..0000000
Binary files a/gestion_projet/__pycache__/urls.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/views.cpython-310.pyc b/gestion_projet/__pycache__/views.cpython-310.pyc
deleted file mode 100644
index 17b2d31..0000000
Binary files a/gestion_projet/__pycache__/views.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/views.cpython-312.pyc b/gestion_projet/__pycache__/views.cpython-312.pyc
deleted file mode 100644
index 4bc400f..0000000
Binary files a/gestion_projet/__pycache__/views.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/views.cpython-313.pyc b/gestion_projet/__pycache__/views.cpython-313.pyc
deleted file mode 100644
index 4b5562b..0000000
Binary files a/gestion_projet/__pycache__/views.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/__pycache__/views.cpython-314.pyc b/gestion_projet/__pycache__/views.cpython-314.pyc
deleted file mode 100644
index 012a9c3..0000000
Binary files a/gestion_projet/__pycache__/views.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0001_initial.cpython-310.pyc b/gestion_projet/migrations/__pycache__/0001_initial.cpython-310.pyc
deleted file mode 100644
index 7db5fc2..0000000
Binary files a/gestion_projet/migrations/__pycache__/0001_initial.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0001_initial.cpython-312.pyc b/gestion_projet/migrations/__pycache__/0001_initial.cpython-312.pyc
deleted file mode 100644
index 7f3b259..0000000
Binary files a/gestion_projet/migrations/__pycache__/0001_initial.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0001_initial.cpython-313.pyc b/gestion_projet/migrations/__pycache__/0001_initial.cpython-313.pyc
deleted file mode 100644
index c3a8ad9..0000000
Binary files a/gestion_projet/migrations/__pycache__/0001_initial.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0001_initial.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0001_initial.cpython-314.pyc
deleted file mode 100644
index 47ee6a3..0000000
Binary files a/gestion_projet/migrations/__pycache__/0001_initial.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_alter_domainederecherche_options.cpython-310.pyc b/gestion_projet/migrations/__pycache__/0002_alter_domainederecherche_options.cpython-310.pyc
deleted file mode 100644
index 53ae779..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_alter_domainederecherche_options.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_alter_domainederecherche_options.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0002_alter_domainederecherche_options.cpython-314.pyc
deleted file mode 100644
index 2dc0098..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_alter_domainederecherche_options.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_alter_projet_budget_alter_projet_budget_rh.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0002_alter_projet_budget_alter_projet_budget_rh.cpython-314.pyc
deleted file mode 100644
index cfd5cf5..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_alter_projet_budget_alter_projet_budget_rh.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_documentprojet_dernier_alerte_mail.cpython-310.pyc b/gestion_projet/migrations/__pycache__/0002_documentprojet_dernier_alerte_mail.cpython-310.pyc
deleted file mode 100644
index e61e26f..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_documentprojet_dernier_alerte_mail.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_documentprojet_dernier_alerte_mail.cpython-313.pyc b/gestion_projet/migrations/__pycache__/0002_documentprojet_dernier_alerte_mail.cpython-313.pyc
deleted file mode 100644
index 5844683..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_documentprojet_dernier_alerte_mail.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_domainederecherche_remove_projet_domaine_recherche_and_more.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0002_domainederecherche_remove_projet_domaine_recherche_and_more.cpython-314.pyc
deleted file mode 100644
index a87a34d..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_domainederecherche_remove_projet_domaine_recherche_and_more.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_projet_volets.cpython-313.pyc b/gestion_projet/migrations/__pycache__/0002_projet_volets.cpython-313.pyc
deleted file mode 100644
index f9e500b..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_projet_volets.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0002_remove_activiteprojet_livrables_and_more.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0002_remove_activiteprojet_livrables_and_more.cpython-314.pyc
deleted file mode 100644
index a430fe5..0000000
Binary files a/gestion_projet/migrations/__pycache__/0002_remove_activiteprojet_livrables_and_more.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0003_alter_domainederecherche_nom.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0003_alter_domainederecherche_nom.cpython-314.pyc
deleted file mode 100644
index 23891b6..0000000
Binary files a/gestion_projet/migrations/__pycache__/0003_alter_domainederecherche_nom.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-310.pyc b/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-310.pyc
deleted file mode 100644
index 0127eb1..0000000
Binary files a/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-313.pyc b/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-313.pyc
deleted file mode 100644
index fc771dc..0000000
Binary files a/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-314.pyc
deleted file mode 100644
index 33326ca..0000000
Binary files a/gestion_projet/migrations/__pycache__/0003_remove_documentprojet_dernier_alerte_mail_and_more.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0004_delete_plan.cpython-310.pyc b/gestion_projet/migrations/__pycache__/0004_delete_plan.cpython-310.pyc
deleted file mode 100644
index dc6ab2a..0000000
Binary files a/gestion_projet/migrations/__pycache__/0004_delete_plan.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0004_delete_plan.cpython-313.pyc b/gestion_projet/migrations/__pycache__/0004_delete_plan.cpython-313.pyc
deleted file mode 100644
index 4cb2d12..0000000
Binary files a/gestion_projet/migrations/__pycache__/0004_delete_plan.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0004_remove_activiteprojet_livrables.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0004_remove_activiteprojet_livrables.cpython-314.pyc
deleted file mode 100644
index ca7e542..0000000
Binary files a/gestion_projet/migrations/__pycache__/0004_remove_activiteprojet_livrables.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0005_alter_livrableslivres_nom_delete_livrableattendu.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0005_alter_livrableslivres_nom_delete_livrableattendu.cpython-314.pyc
deleted file mode 100644
index d1a11ac..0000000
Binary files a/gestion_projet/migrations/__pycache__/0005_alter_livrableslivres_nom_delete_livrableattendu.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0006_activiteprojet_motif_changement_budget.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0006_activiteprojet_motif_changement_budget.cpython-314.pyc
deleted file mode 100644
index 3f26612..0000000
Binary files a/gestion_projet/migrations/__pycache__/0006_activiteprojet_motif_changement_budget.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0007_alter_domainederecherche_nom.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0007_alter_domainederecherche_nom.cpython-314.pyc
deleted file mode 100644
index 9558ba9..0000000
Binary files a/gestion_projet/migrations/__pycache__/0007_alter_domainederecherche_nom.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/0008_remove_domainederecherche_id_and_more.cpython-314.pyc b/gestion_projet/migrations/__pycache__/0008_remove_domainederecherche_id_and_more.cpython-314.pyc
deleted file mode 100644
index 7835b14..0000000
Binary files a/gestion_projet/migrations/__pycache__/0008_remove_domainederecherche_id_and_more.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/__init__.cpython-310.pyc b/gestion_projet/migrations/__pycache__/__init__.cpython-310.pyc
deleted file mode 100644
index f1b89ae..0000000
Binary files a/gestion_projet/migrations/__pycache__/__init__.cpython-310.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/__init__.cpython-312.pyc b/gestion_projet/migrations/__pycache__/__init__.cpython-312.pyc
deleted file mode 100644
index cfb6f8c..0000000
Binary files a/gestion_projet/migrations/__pycache__/__init__.cpython-312.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/__init__.cpython-313.pyc b/gestion_projet/migrations/__pycache__/__init__.cpython-313.pyc
deleted file mode 100644
index 56a1444..0000000
Binary files a/gestion_projet/migrations/__pycache__/__init__.cpython-313.pyc and /dev/null differ
diff --git a/gestion_projet/migrations/__pycache__/__init__.cpython-314.pyc b/gestion_projet/migrations/__pycache__/__init__.cpython-314.pyc
deleted file mode 100644
index a1c65e9..0000000
Binary files a/gestion_projet/migrations/__pycache__/__init__.cpython-314.pyc and /dev/null differ
diff --git a/gestion_projet/static/gestion_projet/js/enregistrement_bailleur.js b/gestion_projet/static/gestion_projet/js/enregistrement_bailleur.js
index afe12ea..c09f502 100644
--- a/gestion_projet/static/gestion_projet/js/enregistrement_bailleur.js
+++ b/gestion_projet/static/gestion_projet/js/enregistrement_bailleur.js
@@ -1,4 +1,5 @@
const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur');
+let table;
btnEnregistrerBailleur.addEventListener('click', function() {
const form = document.getElementById('formBailleur');
@@ -20,4 +21,31 @@ btnEnregistrerBailleur.addEventListener('click', function() {
alert('Ce bailleur existe déjà dans la base de données.');
}
});
-});
\ No newline at end of file
+});
+
+document.addEventListener("DOMContentLoaded", function () {
+
+ table = new Tabulator("#table-bailleurs", {
+ ajaxURL: "/gestion-projet/bailleurs/",
+ layout: "fitColumns",
+ pagination: "local",
+ paginationSize: 5,
+
+ columns: [
+ {title: "#", formatter: "rownum", width: 60},
+ {title: "Organisme", field: "nom_organisme"},
+ {title: "Contact", field: "contact"},
+ {title: "Email", field: "email"},
+ {title: "Pays", field: "pays"},
+ ],
+ rowDblClick: function(e, row) {
+ const data = row.getData();
+
+ if (confirm(`Voulez-vous vraiment supprimer ${data.nom_organisme} ?`)) {
+ supprimerBailleur(data.id);
+ }
+ }
+ });
+
+});
+
diff --git a/gestion_projet/templates/gestion_projet/parts/creation_bailleur.html b/gestion_projet/templates/gestion_projet/parts/creation_bailleur.html
index 6fe4194..2f31a37 100644
--- a/gestion_projet/templates/gestion_projet/parts/creation_bailleur.html
+++ b/gestion_projet/templates/gestion_projet/parts/creation_bailleur.html
@@ -1,20 +1,51 @@
-
+
-
-
-
-
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
Liste des bailleurs
+
+
+
+
+
diff --git a/gestion_projet/urls.py b/gestion_projet/urls.py
index 6e3f087..06e898e 100644
--- a/gestion_projet/urls.py
+++ b/gestion_projet/urls.py
@@ -19,6 +19,12 @@ urlpatterns = [
views.creation_projet,
name='creation-projet'
),
+ path(
+ 'bailleurs/',
+ views.liste_bailleur,
+ name='liste-bailleurs'
+ ),
+
path(
'projet/modifier/
/',
views.modification_projet,
@@ -84,6 +90,7 @@ urlpatterns = [
views.liste_activites_projet,
name='liste-activites-projet'
),
+
# path(
# 'projet/ajout-de-document/',
# views.ajouter_document_projet,
@@ -119,4 +126,6 @@ urlpatterns = [
views.mises_a_jour_projet,
name='mises-a-jour-projet'
)
-]
\ No newline at end of file
+
+]
+
diff --git a/gestion_projet/views.py b/gestion_projet/views.py
index 69bd619..80a4ba4 100644
--- a/gestion_projet/views.py
+++ b/gestion_projet/views.py
@@ -2,6 +2,7 @@ from datetime import date
from decimal import Decimal, InvalidOperation
from django.http import JsonResponse
from django.shortcuts import redirect, render
+from django.urls import reverse
from django.utils import timezone
from django.contrib import messages
from django.contrib.auth.decorators import login_required
@@ -143,6 +144,22 @@ def creation_bailleur(request):
return JsonResponse({'success': True})
return JsonResponse({'success': False})
+@login_required
+def liste_bailleur(request):
+ """ Vue pour retourner la liste de tous les bailleurs """
+ bailleurs = Bailleur.objects.all().order_by('-id')
+ data = []
+ for b in bailleurs:
+ data.append({
+ "id": b.id,
+ "nom_organisme": b.nom_organisme,
+ "contact": b.contact,
+ "email": b.email,
+ "pays": b.pays,
+ })
+ return JsonResponse(data, safe=False)
+
+
@login_required
def ajouter_financement_projet(request):
"""Ajoute un financement à un projet en vérifiant que le total ne dépasse pas 100%"""
@@ -318,6 +335,7 @@ def activites_projet(request):
}
return render(request, 'gestion_projet/suivi_activite.html', context)
+
@login_required
def ajouter_activite_projet(request):
"""Vue pour ajouter une activité à un projet spécifique via un formulaire"""
diff --git a/gestion_salle/__pycache__/__init__.cpython-310.pyc b/gestion_salle/__pycache__/__init__.cpython-310.pyc
deleted file mode 100644
index a040c2e..0000000
Binary files a/gestion_salle/__pycache__/__init__.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/__init__.cpython-312.pyc b/gestion_salle/__pycache__/__init__.cpython-312.pyc
deleted file mode 100644
index 4c62c82..0000000
Binary files a/gestion_salle/__pycache__/__init__.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/__init__.cpython-314.pyc b/gestion_salle/__pycache__/__init__.cpython-314.pyc
deleted file mode 100644
index 7dd37dd..0000000
Binary files a/gestion_salle/__pycache__/__init__.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/admin.cpython-310.pyc b/gestion_salle/__pycache__/admin.cpython-310.pyc
deleted file mode 100644
index a7419b4..0000000
Binary files a/gestion_salle/__pycache__/admin.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/admin.cpython-312.pyc b/gestion_salle/__pycache__/admin.cpython-312.pyc
deleted file mode 100644
index d6e0805..0000000
Binary files a/gestion_salle/__pycache__/admin.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/admin.cpython-314.pyc b/gestion_salle/__pycache__/admin.cpython-314.pyc
deleted file mode 100644
index ddb3e7d..0000000
Binary files a/gestion_salle/__pycache__/admin.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/apps.cpython-310.pyc b/gestion_salle/__pycache__/apps.cpython-310.pyc
deleted file mode 100644
index 6854d0a..0000000
Binary files a/gestion_salle/__pycache__/apps.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/apps.cpython-312.pyc b/gestion_salle/__pycache__/apps.cpython-312.pyc
deleted file mode 100644
index 4de27f1..0000000
Binary files a/gestion_salle/__pycache__/apps.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/apps.cpython-314.pyc b/gestion_salle/__pycache__/apps.cpython-314.pyc
deleted file mode 100644
index b4cf115..0000000
Binary files a/gestion_salle/__pycache__/apps.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/forms.cpython-310.pyc b/gestion_salle/__pycache__/forms.cpython-310.pyc
deleted file mode 100644
index c3cd657..0000000
Binary files a/gestion_salle/__pycache__/forms.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/forms.cpython-312.pyc b/gestion_salle/__pycache__/forms.cpython-312.pyc
deleted file mode 100644
index 9377c42..0000000
Binary files a/gestion_salle/__pycache__/forms.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/forms.cpython-314.pyc b/gestion_salle/__pycache__/forms.cpython-314.pyc
deleted file mode 100644
index 2a248df..0000000
Binary files a/gestion_salle/__pycache__/forms.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/models.cpython-310.pyc b/gestion_salle/__pycache__/models.cpython-310.pyc
deleted file mode 100644
index c090075..0000000
Binary files a/gestion_salle/__pycache__/models.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/models.cpython-312.pyc b/gestion_salle/__pycache__/models.cpython-312.pyc
deleted file mode 100644
index 41919b6..0000000
Binary files a/gestion_salle/__pycache__/models.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/models.cpython-314.pyc b/gestion_salle/__pycache__/models.cpython-314.pyc
deleted file mode 100644
index b030a0d..0000000
Binary files a/gestion_salle/__pycache__/models.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/urls.cpython-310.pyc b/gestion_salle/__pycache__/urls.cpython-310.pyc
deleted file mode 100644
index 76fe8ba..0000000
Binary files a/gestion_salle/__pycache__/urls.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/urls.cpython-312.pyc b/gestion_salle/__pycache__/urls.cpython-312.pyc
deleted file mode 100644
index ba22adf..0000000
Binary files a/gestion_salle/__pycache__/urls.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/urls.cpython-314.pyc b/gestion_salle/__pycache__/urls.cpython-314.pyc
deleted file mode 100644
index 3ea239f..0000000
Binary files a/gestion_salle/__pycache__/urls.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/views.cpython-310.pyc b/gestion_salle/__pycache__/views.cpython-310.pyc
deleted file mode 100644
index 08067b6..0000000
Binary files a/gestion_salle/__pycache__/views.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/views.cpython-312.pyc b/gestion_salle/__pycache__/views.cpython-312.pyc
deleted file mode 100644
index 657bbc9..0000000
Binary files a/gestion_salle/__pycache__/views.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/__pycache__/views.cpython-314.pyc b/gestion_salle/__pycache__/views.cpython-314.pyc
deleted file mode 100644
index 3b9d496..0000000
Binary files a/gestion_salle/__pycache__/views.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/0001_initial.cpython-310.pyc b/gestion_salle/migrations/__pycache__/0001_initial.cpython-310.pyc
deleted file mode 100644
index d61d965..0000000
Binary files a/gestion_salle/migrations/__pycache__/0001_initial.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/0001_initial.cpython-312.pyc b/gestion_salle/migrations/__pycache__/0001_initial.cpython-312.pyc
deleted file mode 100644
index 2e6dc3e..0000000
Binary files a/gestion_salle/migrations/__pycache__/0001_initial.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/0001_initial.cpython-314.pyc b/gestion_salle/migrations/__pycache__/0001_initial.cpython-314.pyc
deleted file mode 100644
index c50a1ed..0000000
Binary files a/gestion_salle/migrations/__pycache__/0001_initial.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/0002_remove_reservation_motif_refus.cpython-310.pyc b/gestion_salle/migrations/__pycache__/0002_remove_reservation_motif_refus.cpython-310.pyc
deleted file mode 100644
index 261d5a6..0000000
Binary files a/gestion_salle/migrations/__pycache__/0002_remove_reservation_motif_refus.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/0002_remove_reservation_motif_refus.cpython-314.pyc b/gestion_salle/migrations/__pycache__/0002_remove_reservation_motif_refus.cpython-314.pyc
deleted file mode 100644
index 4440f36..0000000
Binary files a/gestion_salle/migrations/__pycache__/0002_remove_reservation_motif_refus.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/0003_alter_reservation_statut.cpython-310.pyc b/gestion_salle/migrations/__pycache__/0003_alter_reservation_statut.cpython-310.pyc
deleted file mode 100644
index 32a50e8..0000000
Binary files a/gestion_salle/migrations/__pycache__/0003_alter_reservation_statut.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/__init__.cpython-310.pyc b/gestion_salle/migrations/__pycache__/__init__.cpython-310.pyc
deleted file mode 100644
index 9e810d5..0000000
Binary files a/gestion_salle/migrations/__pycache__/__init__.cpython-310.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/__init__.cpython-312.pyc b/gestion_salle/migrations/__pycache__/__init__.cpython-312.pyc
deleted file mode 100644
index 1378976..0000000
Binary files a/gestion_salle/migrations/__pycache__/__init__.cpython-312.pyc and /dev/null differ
diff --git a/gestion_salle/migrations/__pycache__/__init__.cpython-314.pyc b/gestion_salle/migrations/__pycache__/__init__.cpython-314.pyc
deleted file mode 100644
index 9122029..0000000
Binary files a/gestion_salle/migrations/__pycache__/__init__.cpython-314.pyc and /dev/null differ
diff --git a/gestion_salle/static/gestion_salle/js/index.js b/gestion_salle/static/gestion_salle/js/index.js
index 8b5bff8..44cb922 100644
--- a/gestion_salle/static/gestion_salle/js/index.js
+++ b/gestion_salle/static/gestion_salle/js/index.js
@@ -167,9 +167,9 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
$("lien_zoom_container").className = 'd-none';
}
- if(data.statut !== "refusee"){
- $("motif_refus_container").className = 'd-none';
- }
+ // if(data.statut !== "refusee"){
+ // $("motif_refus_container").className = 'd-none';
+ // }
$("id_reservation_detail").value = data.id;
$("id_reservation_refus").value = data.id;
@@ -178,14 +178,15 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
$("employe").value=data.employe;
$("salle").value=data.salle;
$("statut-reservation").innerHTML=data.statut;
- $("date_evenement").value=data.date_debut;
+ $("date_debut").value = data.date_debut;
+ $("date_fin").value = data.date_fin;
$("heure_debut").value=data.heure_debut;
$("heure_fin").value=data.heure_fin;
$("motif_reservation").value=data.motif_reservation;
$("besoin_zoom").checked=data.besoin_zoom;
$("besoin_ordinateur").checked=data.besoin_ordi;
$("lien_zoom").value=data.lien_zoom;
- $("motif_refus").value=data.motif_refus;
+ // $("motif_refus").value=data.motif_refus;
const modal = new bootstrap.Modal($("modalDetailReservation"));
bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide();
diff --git a/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html b/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html
index fb84ee8..86e1006 100644
--- a/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html
+++ b/gestion_salle/templates/gestion_salle/parts/modalDetailResevation.html
@@ -21,8 +21,12 @@
-
-
+
+
+
+
+
+
@@ -48,24 +52,19 @@
-
-
-
-
{% if appartient_au_departement_informatique %}
{% endif %}
{% if appartient_direction and reservation.statut == "en_attente" %}
- {% endif %}
-
- {% if appartient_direction %}
{% endif %}
+
+