Bug: Details des reservations
All checks were successful
Organisation/sirh/pipeline/head This commit looks good
All checks were successful
Organisation/sirh/pipeline/head This commit looks good
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -30,4 +30,4 @@ class Reservation(models.Model):
|
|||||||
statut = models.CharField(choices=STATUT, default='en_attente', max_length=25)
|
statut = models.CharField(choices=STATUT, default='en_attente', max_length=25)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.salle} - {self.employe.user.first_name} {self.employe.user.last_name} le {self.date_reservation}"
|
return f"{self.salle} - {self.employe.user.first_name} {self.employe.user.last_name}"
|
||||||
@@ -15,7 +15,6 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
|||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
currentReservationId = data.id_reservation;
|
currentReservationId = data.id_reservation;
|
||||||
console.log(data);
|
|
||||||
$("id_reservation_detail").value = data.id_reservation;
|
$("id_reservation_detail").value = data.id_reservation;
|
||||||
$("id_reservation_refus").value = data.id_reservation;
|
$("id_reservation_refus").value = data.id_reservation;
|
||||||
$("id_reservation_zoom").value = data.id_reservation;
|
$("id_reservation_zoom").value = data.id_reservation;
|
||||||
@@ -30,6 +29,10 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
|||||||
$("besoin_ordinateur").checked=data.besoin_ordinateur;
|
$("besoin_ordinateur").checked=data.besoin_ordinateur;
|
||||||
$("lien_zoom").value=data.lien_zoom;
|
$("lien_zoom").value=data.lien_zoom;
|
||||||
|
|
||||||
|
if (data.besoin_zoom === false){
|
||||||
|
$("lien_zoom_container").className = "d-none";
|
||||||
|
}
|
||||||
|
|
||||||
if(data.statut !== "annulee"){
|
if(data.statut !== "annulee"){
|
||||||
$("motif_refus_container").className = "d-none";
|
$("motif_refus_container").className = "d-none";
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -30,8 +30,6 @@ def index(request:HttpRequest):
|
|||||||
motif_reservation = form.cleaned_data.get('motif_reservation')
|
motif_reservation = form.cleaned_data.get('motif_reservation')
|
||||||
besoin_zoom = form.cleaned_data.get('besoin_zoom')
|
besoin_zoom = form.cleaned_data.get('besoin_zoom')
|
||||||
besoin_ordi = form.cleaned_data.get('besoin_ordi')
|
besoin_ordi = form.cleaned_data.get('besoin_ordi')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while date_debut <= date_fin :
|
while date_debut <= date_fin :
|
||||||
reservation = Reservation(
|
reservation = Reservation(
|
||||||
@@ -117,11 +115,12 @@ def liste_reservation_attente(request):
|
|||||||
def detail_reservation(request:HttpRequest, reservation_id:int):
|
def detail_reservation(request:HttpRequest, reservation_id:int):
|
||||||
reservation = Reservation.objects.get(id=reservation_id)
|
reservation = Reservation.objects.get(id=reservation_id)
|
||||||
employe = reservation.employe.user
|
employe = reservation.employe.user
|
||||||
|
|
||||||
reservation_json = {
|
reservation_json = {
|
||||||
'id_reservation': reservation_id,
|
'id_reservation': reservation_id,
|
||||||
'employe': f"{employe.first_name} {employe.last_name}",
|
'employe': f"{employe.first_name} {employe.last_name}",
|
||||||
'salle': reservation.salle,
|
'salle': reservation.salle,
|
||||||
'statut': reservation.statut,
|
'statut': dict(Reservation.STATUT).get(reservation.statut),
|
||||||
'date_evenement': reservation.date_debut.strftime('%Y-%m-%d'),
|
'date_evenement': reservation.date_debut.strftime('%Y-%m-%d'),
|
||||||
'heure_debut': reservation.heure_debut.strftime('%H:%M'),
|
'heure_debut': reservation.heure_debut.strftime('%H:%M'),
|
||||||
'heure_fin': reservation.heure_fin.strftime('%H:%M'),
|
'heure_fin': reservation.heure_fin.strftime('%H:%M'),
|
||||||
@@ -129,7 +128,6 @@ def detail_reservation(request:HttpRequest, reservation_id:int):
|
|||||||
'besoin_zoom': reservation.besoin_zoom,
|
'besoin_zoom': reservation.besoin_zoom,
|
||||||
'besoin_ordinateur': reservation.besoin_ordi,
|
'besoin_ordinateur': reservation.besoin_ordi,
|
||||||
'lien_zoom': reservation.lien_zoom or '',
|
'lien_zoom': reservation.lien_zoom or '',
|
||||||
'motif_refus': reservation.motif_refus or '',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return JsonResponse(reservation_json, safe=True)
|
return JsonResponse(reservation_json, safe=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user