This commit is contained in:
2026-09-03 14:25:28 +00:00
36 changed files with 292 additions and 252 deletions

Binary file not shown.

View File

@@ -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))

View File

@@ -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

View File

@@ -7,6 +7,7 @@
<div class="alert alert-{% if message.tags == 'error' %}danger{% else %}success{% endif %}">{{message}}</div>
{% endfor %}
{% endif %}
<div class="row d-flex justify-content-center mb-4">
<div class="col text-white bg-danger d-flex flex-column justify-content-center align-items-center border rounded p-4">
<div class="card-header fw-bold">

View File

@@ -8,6 +8,8 @@ class EmployeForm(forms.ModelForm):
class Meta:
model = Employe
fields = (
'departement',
'fonction',
'adresse',
'telephone',
'CV',
@@ -16,6 +18,17 @@ class EmployeForm(forms.ModelForm):
'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:

View File

@@ -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

View File

@@ -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();
})

View File

@@ -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));
});

View File

@@ -8,7 +8,7 @@
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body" id="modalDetailEmployeBody" data-url="{% url 'gestion_employe:enregistrer-detail-employe' %}">
<div class="modal-body" id="modalDetailEmployeBody" data-url="{% url 'gestion_employe:enregistrer-detail-employe' %}" data-url-departements="{% url 'gestion_employe:liste-departements' %}">
<div class="row g-3">
<input type="hidden" id="detail-id">
<div class="col-md-6">
@@ -23,7 +23,12 @@
</div>
<div class="form-group mb-2">
<label>Département :</label>
<input type="text" class="form-control" id="detail-departement">
<select class="form-select" id="detail-departement">
<option value="">-- Sélectionner --</option>
{% for dept in departements %}
<option value="{{ dept.id }}">{{ dept.nom }}</option>
{% endfor %}
</select>
</div>
<div class="form-group mb-2">
<label>Sexe :</label>

View File

@@ -15,7 +15,7 @@ from django.utils import timezone
from fonction_utilitaire import fonctions_utilitaire
from .forms import AffectationForm, ContratForm, FormationForm
from .models import Affectation, Contrat, Employe, Formation
from .models import Affectation, Contrat, Departement, Employe, Formation
@login_required
@@ -42,7 +42,8 @@ def index(request):
'nombre_stage': nombre_stage,
'nombre_expirants': nombre_expirants,
'affectation_form': AffectationForm(),
'contrat_form': ContratForm()
'contrat_form': ContratForm(),
'departements': Departement.objects.all()
})
@login_required
@@ -285,7 +286,7 @@ def creation_contrat(request):
contrat_actif = Contrat.objects.filter(
employe=employe,
date_fin__gte=datetime.date.today()
date_fin__gte=timezone.now().date()
).exists()
if request.method == "POST":
@@ -360,10 +361,30 @@ def enregistrer_detail_employe(request):
except Employe.DoesNotExist:
return JsonResponse({"error": "Employé non trouvé."}, status=404)
employe.fonction = data['fonction']
employe.date_embauche = data['date_embauche']
employe.matricule = data['matricule']
employe.fonction = data.get('fonction')
employe.date_embauche = data.get('date_embauche')
employe.matricule = data.get('matricule')
# Traiter le département
dept_value = data.get('departement')
print(f"[DEBUG] Département brut: {dept_value!r}")
print(f"[DEBUG] Type département: {type(dept_value).__name__}")
print(f"[DEBUG] Est vide: {not dept_value}")
if dept_value and str(dept_value).strip():
try:
dept_id = int(dept_value)
departement = Departement.objects.get(id=dept_id)
employe.departement = departement
except Departement.DoesNotExist:
employe.departement = None
except (ValueError, TypeError) as e:
employe.departement = None
else:
employe.departement = None
employe.save()
return JsonResponse({"message": "Détails de l'employé mis à jour avec succès."})
else:
return JsonResponse({"message": "Méthode non autorisée."}, status=405)
@@ -426,7 +447,7 @@ def liste_employe(request):
"affectations": affectations,
"projet": projets,
"contrats": contrats,
"departement": employe.departement.nom if employe.departement else "",
"departement": employe.departement.id if employe.departement else "",
"fonction": employe.fonction,
"date_embauche": employe.date_embauche,
"adresse": employe.adresse,

View File

@@ -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

View File

@@ -1,4 +1,5 @@
const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur');
let table;
let table;

View File

@@ -1,20 +1,51 @@
<div class="modal fade" id="modalBailleur" tabindex="-1" aria-labelledby="modalBailleurLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-dialog ">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modalBailleurLabel">Ajouter un Bailleur</h5>
<h5 class="modal-title" id="modalBailleurLabel">Gestion des Bailleurs</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body p-4">
<form id="formBailleur" method="POST" action="{% url 'gestion_projet:creation-bailleur' %}">
{% csrf_token %}
{{ form_ajout_bailleur.as_p }}
</form>
</div>
<div class="modal-footer">
<button type="submit" id="btnEnregistrerBailleur" class="btn btn-success"><i class="bi bi-save me-1"></i> Enregistrer</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Annuler</button>
<ul class="nav nav-tabs px-3 pt-2" id="bailleurTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="ajouter-tab" data-bs-toggle="tab"
data-bs-target="#ajouter" type="button" role="tab">
Ajouter
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="liste-tab" data-bs-toggle="tab"
data-bs-target="#liste" type="button" role="tab">
Liste
</button>
</li>
</ul>
<div class="modal-body">
<div class="tab-content pt-3">
<div class="tab-pane fade show active" id="ajouter" role="tabpanel">
<form id="formBailleur" method="POST" action="{% url 'gestion_projet:creation-bailleur' %}">
{% csrf_token %}
{{ form_ajout_bailleur.as_p }}
<button type="submit" class="btn btn-success mt-3" id="btnEnregistrerBailleur">
<i class="bi bi-save me-1"></i> Enregistrer
</button>
</form>
</div>
<div class="tab-pane fade" id="liste" role="tabpanel">
<div class="d-flex justify-content-between align-items-center mb-3">
<h6 class="mb-0">Liste des bailleurs</h6>
</div>
<div class="row">
<div class="col">
<div id="table-bailleurs"
data-url="{% url 'gestion_projet:liste-bailleurs' %}">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -19,6 +19,12 @@ urlpatterns = [
views.creation_projet,
name='creation-projet'
),
path(
'bailleurs/',
views.liste_bailleur,
name='liste-bailleurs'
),
path(
'projet/modifier/<int:projet_id>/',
views.modification_projet,
@@ -114,4 +120,6 @@ urlpatterns = [
views.mises_a_jour_projet,
name='mises-a-jour-projet'
)
]

View File

@@ -146,6 +146,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%"""
@@ -321,6 +337,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"""

View File

@@ -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

View File

@@ -12,7 +12,12 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
const modal = new bootstrap.Modal($("modalDetailReservation"));
modal.show();
fetch (`/gestion-salle/revervation/details/${event.guid}`)
.then(response => response.json())
.then(response => {
if (!response.ok) {
throw new Error(`Erreur HTTP ${response.status}`);
}
return response.json();
})
.then(data => {
currentReservationId = data.id_reservation;
$("id_reservation_detail").value = data.id_reservation;
@@ -21,7 +26,7 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
$("employe").value=data.employe;
$("salle").value=data.salle;
$("statut-reservation").innerHTML=data.statut;
$("date_evenement").value=data.date_evenement;
$("date_debut").value=data.date_debut;
$("heure_debut").value=data.heure_debut;
$("heure_fin").value=data.heure_fin;
$("motif_reservation").value=data.motif_reservation;
@@ -40,6 +45,7 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
}
})
.catch(error => console.error("Impossible de charger les détails de la réservation :", error));
}
});

View File

@@ -55,5 +55,5 @@
{% block 'js' %}
<script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/index.min.js"></script>
<script src="{% static 'gestion_salle/js/index.js' %}"></script>
<script src="{% static 'gestion_salle/js/index.js' %}?v=3"></script>
{% endblock %}

View File

@@ -108,6 +108,7 @@ def liste_reservation(request:HttpRequest):
"""Vue d'affichage des creneaux disponibles"""
reservations = Reservation.objects.filter(statut = "validee")
liste_reservation = []
for reservation in reservations:
print(reservation.statut)
color = None
@@ -118,6 +119,8 @@ def liste_reservation(request:HttpRequest):
else:
color = "#dc3545"
print(dict(Reservation.TYPE_CHOICES).get(reservation.salle))
liste_reservation.append({
"guid": reservation.pk,
"title": dict(Reservation.TYPE_CHOICES).get(reservation.salle),

View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
asgiref==3.11.1
certifi==2026.4.22
charset-normalizer==3.4.7
@@ -21,159 +20,3 @@ tzdata==2026.2
urllib3==2.6.3
webservices==0.7
webservices.naudit==0.7.2
python-decouple
gunicorn
=======
anyio==4.13.0
argon2-cffi==25.1.0
argon2-cffi-bindings==25.1.0
arrow==1.4.0
asgiref==3.11.0
asttokens==3.0.1
async-lru==2.3.0
attrs==26.1.0
Automat==20.2.0
babel==2.18.0
bcrypt==3.2.0
beautifulsoup4==4.14.3
bleach==6.3.0
blinker==1.4
certifi==2026.2.25
cffi==2.0.0
chardet==4.0.0
charset-normalizer==3.4.7
click==8.0.3
cloud-init==25.3
colorama==0.4.4
comm==0.2.3
command-not-found==0.3
configobj==5.0.6
constantly==15.1.0
cryptography==3.4.8
dbus-python==1.2.18
debugpy==1.8.20
decorator==5.2.1
defusedxml==0.7.1
distlib==0.4.0
distro==1.7.0
distro-info==1.1+ubuntu0.2
Django==5.2.10
et_xmlfile==2.0.0
exceptiongroup==1.3.1
executing==2.2.1
fastjsonschema==2.21.2
filelock==3.20.3
fqdn==1.5.1
h11==0.16.0
httpcore==1.0.9
httplib2==0.20.2
httpx==0.28.1
hyperlink==21.0.0
idna==3.3
importlib-metadata==4.6.4
incremental==21.3.0
ipykernel==7.2.0
ipython==8.39.0
isoduration==20.11.0
jedi==0.19.2
jeepney==0.7.1
Jinja2==3.0.3
json5==0.14.0
jsonpatch==1.32
jsonpointer==2.0
jsonschema==4.26.0
jsonschema-specifications==2025.9.1
jupyter-events==0.12.0
jupyter-lsp==2.3.1
jupyter_client==8.8.0
jupyter_core==5.9.1
jupyter_server==2.17.0
jupyter_server_terminals==0.5.4
jupyterlab==4.5.6
jupyterlab_pygments==0.3.0
jupyterlab_server==2.28.0
keyring==23.5.0
lark==1.3.1
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
MarkupSafe==2.0.1
matplotlib-inline==0.2.1
mistune==3.2.0
more-itertools==8.10.0
nbclient==0.10.4
nbconvert==7.17.0
nbformat==5.10.4
nest-asyncio==1.6.0
netifaces==0.11.0
notebook_shim==0.2.4
numpy==2.2.6
oauthlib==3.2.0
openpyxl==3.1.5
overrides==7.7.0
packaging==26.0
pandas==2.3.3
pandocfilters==1.5.1
parso==0.8.6
pexpect==4.9.0
platformdirs==4.5.1
prometheus_client==0.24.1
prompt_toolkit==3.0.52
psutil==7.2.2
ptyprocess==0.7.0
pure_eval==0.2.3
pyasn1==0.4.8
pyasn1-modules==0.2.1
pycparser==3.0
pycurl==7.44.1
Pygments==2.20.0
PyGObject==3.42.1
PyHamcrest==2.0.2
PyJWT==2.3.0
pyOpenSSL==21.0.0
pyparsing==2.4.7
pyrsistent==0.18.1
pyserial==3.5
python-apt==2.4.0+ubuntu4.1
python-dateutil==2.9.0.post0
python-json-logger==4.1.0
pytz==2022.1
PyYAML==5.4.1
pyzmq==27.1.0
referencing==0.37.0
requests==2.33.1
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rfc3987-syntax==1.1.0
rpds-py==0.30.0
SecretStorage==3.3.1
Send2Trash==2.1.0
service-identity==18.1.0
six==1.16.0
soupsieve==2.8.3
sqlparse==0.5.5
ssh-import-id==5.11
stack-data==0.6.3
systemd-python==234
terminado==0.18.1
tinycss2==1.4.0
tomli==2.4.1
tornado==6.5.5
traitlets==5.14.3
Twisted==22.1.0
typing_extensions==4.15.0
tzdata==2025.3
ubuntu-pro-client==8001
ufw==0.36.1
unattended-upgrades==0.1
uri-template==1.3.0
urllib3==1.26.5
virtualenv==20.13.0+ds
wadllib==1.3.6
wcwidth==0.6.0
webcolors==25.10.0
webencodings==0.5.1
websocket-client==1.9.0
zipp==1.0.0
zope.interface==5.4.0
>>>>>>> c28b14f (clean: remove pycache from tracking)

View File

@@ -5,6 +5,7 @@ const url_liste_conge_attente = $("liste-demande-conges").dataset.url
const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
// layout : "fitColumns",
=======
@@ -16,6 +17,9 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
=======
layout : "fitColumns",
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
// layout : "fitColumns",
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
columns: [
{"title": "Nom et Prénom", "field": "prenom_nom"},
{"title": "Date de début", "field": "date_debut", formatter:"datetime", formatterParams:{
@@ -29,6 +33,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
{"title": "Type de congé", "field": "type"},
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
{"title": "Date de la demande", "field": "date_demande", responsive: 1},
=======
@@ -40,6 +45,9 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
=======
{"title": "Date de la demande", "field": "date_demande"},
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
{"title": "Date de la demande", "field": "date_demande", responsive: 1},
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
{"title": "Validation par supérieur hiérarchique", "field": "validation_hierarchique", formatter:"tickCross", formatterParams :{
allowEmpty : true ,
}},
@@ -50,6 +58,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
pagination: true,
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
paginationSize: 5,
=======
@@ -61,6 +70,9 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
=======
paginationSize: 5
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
paginationSize: 5,
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
})
const bouton_demande_conges = $("bouton-demande-conge");

View File

@@ -14,6 +14,7 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", {
paginationSize: 10,
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
responsiveLayout : "hide"
=======
@@ -22,6 +23,9 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", {
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
=======
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
responsiveLayout : "hide"
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
})
fetch(url_liste_employe)

View File

@@ -19,6 +19,7 @@ const tableau_certificat = new Tabulator("#tableau-certificat", {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
const enregistrerProfil = $("enregistrerProfil");
enregistrerProfil.addEventListener("click", (e) => {
@@ -53,30 +54,37 @@ enregistrerProfil.addEventListener("click", (e) => {
=======
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
const enregistrerProfil = $("enregistrerProfil");
enregistrerProfil.addEventListener("click", (e) => {
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);
fetch(url, {
method: 'POST',
method: "POST",
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrftoken
"X-CSRFToken": csrftoken
},
body: JSON.stringify({
"nom": $("nom").value,
"prenom": $("prenom").value,
"email": $("email").value,
"telephone": $("telephone").value,
"adresse": $("adresse").value,
"sexe": $("sexe").value,
"date_naissance": $("date_naissance").value,
})
body: formData
})
.then(response => response.json())
.then(data => alert(data.message))
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
})
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
=======
@@ -85,3 +93,7 @@ enregistrerProfil.addEventListener("click", (e) => {
=======
})
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
.catch(error => console.error("Erreur:", error));
});
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5

View File

@@ -2,6 +2,7 @@ const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur')
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
let table;
=======
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
@@ -9,6 +10,9 @@ let table;
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
=======
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
let table;
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
btnEnregistrerBailleur.addEventListener('click', function() {
const form = document.getElementById('formBailleur');
@@ -33,6 +37,9 @@ btnEnregistrerBailleur.addEventListener('click', function() {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
});
document.addEventListener("DOMContentLoaded", function () {
@@ -61,6 +68,7 @@ document.addEventListener("DOMContentLoaded", function () {
});
<<<<<<< HEAD
=======
});
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
@@ -70,3 +78,5 @@ document.addEventListener("DOMContentLoaded", function () {
=======
});
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5

View File

@@ -18,6 +18,7 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
console.log(data);
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
@@ -27,6 +28,8 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
=======
console.log(data);
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
$("id_reservation_detail").value = data.id_reservation;
$("id_reservation_refus").value = data.id_reservation;
$("id_reservation_zoom").value = data.id_reservation;
@@ -43,6 +46,7 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
if (data.besoin_zoom === false){
$("lien_zoom_container").className = "d-none";
@@ -65,6 +69,12 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
=======
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
if (data.besoin_zoom === false){
$("lien_zoom_container").className = "d-none";
}
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
})
}
});
@@ -113,17 +123,23 @@ $("bouton-annuler").addEventListener("click", (e) => {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
console.log("URL d'annulation :");
console.log($("formulaire-details"))
e.preventDefault();
<<<<<<< HEAD
=======
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
=======
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
=======
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
fetch(
url_annuler,
{
@@ -176,6 +192,7 @@ if($("refuserReservation")){
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
console.log(idRes);
e.preventDefault();
@@ -186,6 +203,11 @@ if($("refuserReservation")){
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
=======
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
console.log(idRes);
e.preventDefault();
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
fetch(url, {
method: "POST",
headers: {
@@ -220,6 +242,7 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
console.log(data);
@@ -232,12 +255,15 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
console.log(data);
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
if(data.besoin_zoom === false){
$("lien_zoom_container").className = 'd-none';
}
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
const id_user = $("current-user-id").dataset.userid;
=======
@@ -256,6 +282,9 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
=======
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
const id_user = $("current-user-id").dataset.userid;
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
$("id_reservation_detail").value = data.id;
$("id_reservation_refus").value = data.id;
$("id_reservation_zoom").value = data.id;
@@ -265,6 +294,7 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
$("statut-reservation").innerHTML=data.statut;
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
$("date_debut").value = data.date_debut;
$("date_fin").value = data.date_fin;
@@ -277,6 +307,10 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
=======
$("date_evenement").value=data.date_debut;
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
$("date_debut").value = data.date_debut;
$("date_fin").value = data.date_fin;
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
$("heure_debut").value=data.heure_debut;
$("heure_fin").value=data.heure_fin;
$("motif_reservation").value=data.motif_reservation;
@@ -286,10 +320,14 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
if (id_user != data.employe_id){
$("bouton-annuler").className = "d-none";
}
<<<<<<< HEAD
=======
$("motif_refus").value=data.motif_refus;
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
@@ -299,6 +337,8 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
=======
$("motif_refus").value=data.motif_refus;
>>>>>>> 6026af5 (Bug : Affichages des conges)
=======
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
const modal = new bootstrap.Modal($("modalDetailReservation"));
bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide();