Compare commits
4 Commits
9d9e6c6549
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| b03a4214c0 | |||
| d4f4b7d954 | |||
| 489eeb439f | |||
| 5277b7f355 |
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@@ -39,6 +39,7 @@ pipeline
|
||||
|
||||
python manage.py makemigrations
|
||||
python manage.py migrate
|
||||
python manage.py collectstatic --noinput
|
||||
|
||||
echo $SUDO_PASSWORD | sudo -S chown -R www-data:www-data /var/www/sirh
|
||||
echo "Deploiement reussi"
|
||||
|
||||
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.
@@ -33,11 +33,6 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
||||
$("lien_zoom_container").className = "d-none";
|
||||
}
|
||||
|
||||
if(data.statut !== "annulee"){
|
||||
$("motif_refus_container").className = "d-none";
|
||||
}else{
|
||||
$("motif_refus").value=data.motif_refus;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -164,16 +159,11 @@ const tableau_reservation_attente = new Tabulator("#tableau-reservation-attente"
|
||||
tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
||||
const data = rowData.getData();
|
||||
|
||||
console.log(data);
|
||||
|
||||
if(data.besoin_zoom === false){
|
||||
$("lien_zoom_container").className = 'd-none';
|
||||
}
|
||||
|
||||
// if(data.statut !== "refusee"){
|
||||
// $("motif_refus_container").className = 'd-none';
|
||||
// }
|
||||
|
||||
const id_user = $("current-user-id").dataset.userid;
|
||||
$("id_reservation_detail").value = data.id;
|
||||
$("id_reservation_refus").value = data.id;
|
||||
$("id_reservation_zoom").value = data.id;
|
||||
@@ -189,7 +179,10 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
||||
$("besoin_zoom").checked=data.besoin_zoom;
|
||||
$("besoin_ordinateur").checked=data.besoin_ordi;
|
||||
$("lien_zoom").value=data.lien_zoom;
|
||||
// $("motif_refus").value=data.motif_refus;
|
||||
|
||||
if (id_user != data.employe_id){
|
||||
$("bouton-annuler").className = "d-none";
|
||||
}
|
||||
|
||||
const modal = new bootstrap.Modal($("modalDetailReservation"));
|
||||
bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<!-- Modal d'affichage des détails d'une reservation -->
|
||||
{% load tags_personnaliser %}
|
||||
<div class="modal fade" id="modalDetailReservation" tabindex="-1" aria-labelledby="modalDetailReservationLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@@ -56,11 +57,11 @@
|
||||
{% if appartient_au_departement_informatique %}
|
||||
<button class="btn btn-primary" id="ajoutZoom">Ajout du lien zoom</button>
|
||||
{% endif %}
|
||||
{% if appartient_direction and reservation.statut == "en_attente" %}
|
||||
{% if user|has_group:'direction' %}
|
||||
<button class="btn btn-danger" id="refuserReservation" data-lienrefus="{% url 'gestion_salle:refuser-reservation' %}">Refuser</button>
|
||||
<button class="btn btn-success" id="bouton-valider">Valider</button>
|
||||
{% endif %}
|
||||
<span id="current-user-id" data-user-id="{{ request.user.id }}"></span>
|
||||
<span id="current-user-id" data-userid="{{ request.user.id }}"></span>
|
||||
<button class="btn btn-danger" id="bouton-annuler">Annuler</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -71,13 +71,15 @@ def index(request: HttpRequest):
|
||||
current_date += timedelta(days=1)
|
||||
|
||||
messages.success(request, "Réservation(s) créée(s) avec succès.")
|
||||
|
||||
print(fonctions_utilitaire.EMAIL_ASSISTANTE_DE_DIRECTION)
|
||||
if fonctions_utilitaire.EMAIL_ASSISTANTE_DE_DIRECTION:
|
||||
fonctions_utilitaire.envoyer_mail(
|
||||
sujet = "Reservation de salle",
|
||||
message = f"""
|
||||
Une nouvelle demande de réservation de la {dict(Reservation.TYPE_CHOICES).get(salle)} a été effectuée par {employe.user.first_name} {employe.user.last_name} du {form.cleaned_data.get('date_debut').strftime('%d/%m/%Y')} au {form.cleaned_data.get('date_fin').strftime('%d/%m/%Y')} pour motif "{motif}".
|
||||
Veuillez vous connecter à la plateforme pour plus de détails.""",
|
||||
destinataires = list(fonctions_utilitaire.EMAIL_ASSISTANTE_DE_DIRECTION)
|
||||
destinataires = fonctions_utilitaire.EMAIL_ASSISTANTE_DE_DIRECTION
|
||||
)
|
||||
return redirect('gestion_salle:reservation-salle')
|
||||
|
||||
@@ -100,6 +102,7 @@ Veuillez vous connecter à la plateforme pour plus de détails.""",
|
||||
}
|
||||
|
||||
return render(request, "gestion_salle/index.html", context)
|
||||
|
||||
def liste_reservation(request:HttpRequest):
|
||||
"""Vue d'affichage des creneaux disponibles"""
|
||||
reservations = Reservation.objects.filter(statut = "validee")
|
||||
@@ -130,7 +133,9 @@ def liste_reservation_attente(request):
|
||||
{
|
||||
**model_to_dict(reservation),
|
||||
"employe": f"{reservation.employe.user.first_name} {reservation.employe.user.last_name}",
|
||||
"salle": dict(Reservation.TYPE_CHOICES).get(reservation.salle)
|
||||
"employe_id": reservation.employe.user.id,
|
||||
"salle": dict(Reservation.TYPE_CHOICES).get(reservation.salle),
|
||||
'statut': dict(Reservation.STATUT).get(reservation.statut),
|
||||
} for reservation in reservations
|
||||
]
|
||||
|
||||
@@ -155,6 +160,7 @@ def detail_reservation(request:HttpRequest, reservation_id:int):
|
||||
'besoin_ordinateur': reservation.besoin_ordi,
|
||||
'lien_zoom': reservation.lien_zoom or '',
|
||||
}
|
||||
|
||||
return JsonResponse(reservation_json, safe=True)
|
||||
|
||||
@login_required
|
||||
@@ -213,6 +219,7 @@ def valider_reservation(request: HttpRequest):
|
||||
|
||||
reservation.statut = 'validee'
|
||||
reservation.save()
|
||||
|
||||
if fonctions_utilitaire.EMAIL_ASSISTANTE_DE_DIRECTION:
|
||||
fonctions_utilitaire.envoyer_mail(
|
||||
sujet = "Reservation de salle",
|
||||
|
||||
Reference in New Issue
Block a user