From 4934b42ed9a0db38bc4469773e68767878bf003d Mon Sep 17 00:00:00 2001 From: Soriba SYLLA Date: Wed, 29 Jul 2026 10:26:22 +0000 Subject: [PATCH 1/2] Implementation de sso --- SIRH/__pycache__/settings.cpython-310.pyc | Bin 3074 -> 3345 bytes SIRH/__pycache__/urls.cpython-310.pyc | Bin 1519 -> 1362 bytes SIRH/__pycache__/views.cpython-310.pyc | Bin 1249 -> 123 bytes SIRH/settings.py | 16 ++++-- SIRH/sso.py | 33 ++++++++++++ SIRH/templates/SIRH/BASE.html | 3 +- SIRH/templates/SIRH/login.html | 13 ++--- .../SIRH/parts/menu_application.html | 8 +++ SIRH/templates/SIRH/parts/menu_principal.html | 17 ++++--- SIRH/urls.py | 47 ++++++++---------- SIRH/views.py | 37 -------------- .../fonctions_utilitaire.cpython-310.pyc | Bin 2234 -> 2135 bytes fonction_utilitaire/fonctions_utilitaire.py | 2 +- gestion_conge/migrations/0001_initial.py | 2 +- .../static/gestion_conge/js/index.js | 6 +-- .../templates/gestion_conge/index.html | 11 +++- gestion_employe/migrations/0001_initial.py | 6 +-- .../0002_alter_contrat_type_contrat.py | 18 ------- .../static/gestion_employe/js/index.js | 1 + gestion_projet/migrations/0001_initial.py | 2 +- .../__pycache__/views.cpython-310.pyc | Bin 7588 -> 7588 bytes gestion_salle/migrations/0001_initial.py | 2 +- requirements.txt | 5 +- 23 files changed, 114 insertions(+), 115 deletions(-) create mode 100644 SIRH/sso.py create mode 100644 SIRH/templates/SIRH/parts/menu_application.html delete mode 100644 gestion_employe/migrations/0002_alter_contrat_type_contrat.py diff --git a/SIRH/__pycache__/settings.cpython-310.pyc b/SIRH/__pycache__/settings.cpython-310.pyc index 3f3bbb0a7221aeb8669254ba37b24a0ad9a238e3..85ec63c7cec8a11458c7909421c08f842e386c1c 100644 GIT binary patch delta 697 zcmZutO-~w86y*U`z<`K?D59eH4T2(yb|Wga2$6=7Dcp@w?qe7_FoZ!VrioEf_hynV z8W+`F*Zze5hHhAQ)kS|pAJe9*zL$4y&bjy8cXMyu_v1F%YPIOtx%m;Pe0AL0CdlRe zif}FH(E3Ecjy4#=K}sr)FT>P~b{s}&IhKz2)e*YU*Kqmp!=P^ zafV|!{?F-o)Z@g1UL@eEIa$WbDknRH;gp8c8u~Px>0A?>edy~IqaWwk7k-@Aa6!XG zkqAZ@#U*g#GK`@E#@X}W3QVve10EfCSqyq~Y^+IKg(=2DOr6Fs_;3woa2;kb0)E_p zIgG+QZo&d?!6L?BiFI0bVLzZag;hjk3)( z+$#1@6ZiAS{tCIaD`K@S(V(KpK}idGxe~CoojItW+}%yYF8SD6_#pP0tCn*uY4hy-0^;d% zCR(cIuu{QDE6(q~f_6K9kl*4Ij>b#d`4-8x!J7mghG;BJd?_@(%gxK z!{LxZ8<(^Zy7K)$jkGA&YV^G**VJDoBq5bEe^9&TpNHmj<}i7Dn#-oUgB+JReUnY{ z@sq@9DpBa#G$FT_PVQ^m(&Jnr%O|pba?G2_o%GD=H_L4w*IOc|rUs(qPQ4j$>P=Sl T^FU$DXw(~tb`5`{#!Tclx2wfN delta 451 zcmYL_Jx?1!5QcB=&gZi^AN~Y?V?GQv4upgdenN5IzK?zdo zSlduoN}xy`$rVkc)Tz_(7x)Vl8C;NE&9k$!@4GwNe(`hO?IaR$O~%h(_o0{SyJdRQ zZw2Q_a5B)~UK6J<&S@lldYk#4^oS*{npKRNQ-y=x91v}P3~J=;*f&Ft`Nbeq&o?2uZj68{j7ZEn4K?X~xIHq~YPPW>7CWO)xh mPwhBs#gCGjn(a8`P|~n1*GTKOX}Y$qzBvcuhDraYP5%J&Ky3s7 diff --git a/SIRH/__pycache__/urls.cpython-310.pyc b/SIRH/__pycache__/urls.cpython-310.pyc index 7058e388eec67f8ee10a7de85632d7028eeb512e..a7fb81b32cab95d61c62731a843bbabb7eab030b 100644 GIT binary patch delta 388 zcmXZWJ5R$f5CCA?b(+LZ+O$IlBpz#p#6w8TKoyCK3Qz)-=n_?p35iOA;;_Kbp({%j ziLru#fsx+<6Qf5qCVl}GZm6w0eP{b@|IkljCZn7`;yg*!xrpnYc&_bqZAVn*K0QC^v|HYheIcqv?Xen`wH4$;WZLCu(k3Nc-%9)BbpGN|NsAlU!FWTFRm|r-!WjV{Xx;=wLg#Ut{0cj z5u>q{*ex3w%w%J+lejGx8JseUyOGCi=3G|5xkKlb&IjkSYU#!~VZi_mFx;zwo+$Ms z=&4eF0zF;oI>%8p8Xw@EHN(fa9R+Y|Y~~Wzjn)MFylXUOfBn9}k(sHE3cC%Yt&A%b zieC1N;0qAYqmUnG+R!u#N<0jS literal 1249 zcmY*Zzi-?&6c(wIPN!S~2X&IE1>40C3h1^BMNt%RfVM-NATB!Ga!|z=A6-(sl9baP zWT1e%cIwnE0Xo!s<}Cg%IJQ&&g`z_rDciLP=<$0`kMGCFC+WL)%LLcyyMM*~EJ^+f z%FRVl`5Yhn1O-nxk%=NpqUe&UbeWQ1qjI9MWv23F9`#gCRk17(Pk8oovYhdpPjN4K zahO!IzcEr$rGDP@ZVjCiZR5aaQXh%V=eX(KRn+GOIu6Dc2DmWLx{CNhfwj#M*p`GK zmurGM)}HL+V}D06B*$3kcho#ZL|#))-;h&siBrUMAm+h9EpzGX$$)jfp(Jq`qU?+w zCN3Y6fee)Azoe(>kn(Atn8%mC#ckgqJ)YVpm+xk`-?;+gq-P=ajF)EwBVXsJ?)1N6 zsU^ep#l;^6m~2?9yAFO3x?>zH>z$CoB00UWtT};}T~QG{EJ&0Rn7Me15*&-MPA<-k zco{ey!!Wtmv@LAh|AvNbv=mN!-vi@&S6R@#juHIi`Ln~X{X{iF`nl3>#bLE+tcC4| z-#{;nvttqHDDYH(zf*-q&j508LHn#LJrP>&_v>O0Yk!L?^5>k*a#T zivtq6Um=|cKZ#pa`dooqYiK_-m5p9#APX->eT!I-0{CVpxF z8M6)#1ZvDY_)bED=ZV=x<)050Ypq~mwE?-X!mJmEU%mKpaU$TAtv5gVk(*V}LpIA$ zl-ZojNkQkNB=_jJ=TR$BE2(*iPPfKAjDDyyj{6P*hXa2`aL5QJVaO`l@1gm6s`$nE z&A~#(Zm?d*9xH0XS2VUt%>95vOQU#z$nS8tjuKn=2(31pDriB>BLoN49seFbZn`5~ zqpvgK+d6#Yk=BvR;E$n3AG_AZwY{?=`GIGD@Amn4MUjJ;;YLxhyjWTBsnWcc@L6ES NhX2`avNMwU{(p
+ {% include 'parts/menu_application.html' %} {% include 'parts/menu_principal.html' %} -
+
{% block 'contenu' %} {% endblock %}
diff --git a/SIRH/templates/SIRH/login.html b/SIRH/templates/SIRH/login.html index 801af39..d8dac08 100644 --- a/SIRH/templates/SIRH/login.html +++ b/SIRH/templates/SIRH/login.html @@ -24,15 +24,16 @@ {% endfor %} {% endif %} {% csrf_token %} +
- - + +
- - - + + +
diff --git a/SIRH/templates/SIRH/parts/menu_application.html b/SIRH/templates/SIRH/parts/menu_application.html new file mode 100644 index 0000000..e07de74 --- /dev/null +++ b/SIRH/templates/SIRH/parts/menu_application.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/SIRH/templates/SIRH/parts/menu_principal.html b/SIRH/templates/SIRH/parts/menu_principal.html index 41bee0e..54e0a9d 100644 --- a/SIRH/templates/SIRH/parts/menu_principal.html +++ b/SIRH/templates/SIRH/parts/menu_principal.html @@ -13,35 +13,36 @@ {% endif %}
- {{ user.username }} + {{ user.first_name }} {{ user.last_name }}
- + Mon profil {% if user|has_group:"ressource_humaine" or user|has_group:"direction" %} - + Tableau de bord {% endif %} {% if user|has_group:"ressource_humaine" or user|has_group:"direction" %} - + Gestion des Projets {% endif %} - + Gestion des congés {% if user|is_chef_projet %} - + Suivi des Activités {% endif %} - + Réservation - + {% comment %} {% url 'deconnexion' %} {% endcomment %} + Déconnexion
\ No newline at end of file diff --git a/SIRH/urls.py b/SIRH/urls.py index 50b9078..3b51ad8 100644 --- a/SIRH/urls.py +++ b/SIRH/urls.py @@ -16,32 +16,29 @@ Including another URLconf """ from django.contrib import admin from django.urls import include, path -from django.conf.urls.static import static +# from django.conf.urls.static import static from django.conf import settings -# from simple_sso.sso_server.server import Server -from . import views +from .sso import SIRHClient -# server_sso = Server() +client_sirh = SIRHClient( + settings.SSO_SERVER, + settings.SSO_PUBLIC_KEY, + settings.SSO_PRIVATE_KEY +) -urlpatterns = [ +urlpatterns = [ + # path('login/', + # views.login_view, + # name='login' + # ), + # path( + # 'deconnexion/', + # views.deconnexion_view, + # name='deconnexion' + # ), path( '', - views.login_view, - name='index' - ), - - path('login/', - views.login_view, - name='login' - ), - path( - 'deconnexion/', - views.deconnexion_view, - name='deconnexion' - ), - path( - 'employé/', include("gestion_employe.urls") ), path( @@ -59,9 +56,7 @@ urlpatterns = [ path( 'admin/', admin.site.urls - ), - # path( - # 'sso', - # include(server_sso.get_urls()) - # ) -] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + ), + path("client/", include(client_sirh.get_urls())), +] +# + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/SIRH/views.py b/SIRH/views.py index 77a057d..e69de29 100644 --- a/SIRH/views.py +++ b/SIRH/views.py @@ -1,37 +0,0 @@ -from django.contrib.auth import authenticate, login, logout -from django.shortcuts import render, redirect -from django.contrib import messages - -def login_view(request): - """ - Gère la connexion des utilisateurs avec redirection selon le rôle et - vérification de l'acceptation de la politique d'utilisation. - """ - if request.method == 'POST': - email = request.POST.get('mail') - password = request.POST.get('mot_de_passe') - - if not (email and password): - messages.error(request, "Veuillez remplir tous les champs.") - return render(request, 'login.html') - - user = authenticate(request, username=email, password=password) - - if user is None: - messages.error(request, "Nom d’utilisateur ou mot de passe incorrect.") - return render(request, 'login.html') - - if not user.is_active: - messages.error(request, "Compte inactif. Contactez l'administrateur.") - return render(request, 'login.html') - - login(request, user) - - return redirect("gestion_conges:conge") - - return render(request, 'login.html') - -def deconnexion_view(request): - """Gère la déconnexion de l'utilisateur.""" - logout(request) - return redirect('login') \ No newline at end of file diff --git a/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc b/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc index 9c2adc8297f452a4dfa9f3184f11de6500098e43..dae81941abfcbc9d54efb4f892fcc323a0caf915 100644 GIT binary patch delta 401 zcmdlbcwIm{pO=@50SG$0d9q447#JRdILLqr$Z-JT;*g2j)^aHvDV!|~QQRq9DcnGs zCxs`47fAD_@C7qy@=sjgv{{mI0wW{$*ZCdcIzAeqLIU#^ejEa+-V~ao&{F;*!j~#FE6! zqSWFdklG>*5P@u#IGZk`{$y9S<5IV{ON&#B;^R|u6Ekx(8E>(qt@9PL^g@ z7BB$mWC0P9AVO-gAG@S7H;{QtFgYVNtvEgPZgJS;=BJeAq}nk8dBq|?f`>tXk%y6mnS~Jq KIhZ*ld3XV;WK#|R delta 502 zcmY+9F-yZh7>0B4YNAPO+K8fv3Jwxuozzwc?pfLKf_&VG_F})9Xq6yU&ak4_K`hH2pBzxgr^@M}B(!bWVsZcGctFA(?~? ziC6WV6vb`NrL;GwXZ+cCHY!eOg?QqQ-Z-<;$P8%s@j)`TpTu=m5+}KF*FoQcfTv;X zr@jor8Qx_jM0c;pT#3w!uiSHc?3S{iufCLRC<}d(oCQg Z1*=3Vj=rhb#3Zzb5}ad1SM?Fo`T=Kda>f7v diff --git a/fonction_utilitaire/fonctions_utilitaire.py b/fonction_utilitaire/fonctions_utilitaire.py index eb56ca3..f079369 100644 --- a/fonction_utilitaire/fonctions_utilitaire.py +++ b/fonction_utilitaire/fonctions_utilitaire.py @@ -7,7 +7,7 @@ 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)) +# EMAIL_ASSISTANTE_DE_DIRECTION = list(Employe.objects.filter(fonction="assistant_direction").values_list('user__email', flat=True)) def solde_conge(employe): """Fonction de calcul du solde de congé restant l'employé""" diff --git a/gestion_conge/migrations/0001_initial.py b/gestion_conge/migrations/0001_initial.py index 6a7e09d..e498b12 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-06-16 11:06 import django.db.models.deletion from django.db import migrations, models diff --git a/gestion_conge/static/gestion_conge/js/index.js b/gestion_conge/static/gestion_conge/js/index.js index 1d156cf..5308791 100644 --- a/gestion_conge/static/gestion_conge/js/index.js +++ b/gestion_conge/static/gestion_conge/js/index.js @@ -3,7 +3,7 @@ const $ = (element) => document.getElementById(element); const url_liste_conge_attente = $("liste-demande-conges").dataset.url const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", { - layout : "fitColumns", + // layout : "fitColumns", columns: [ {"title": "Nom et Prénom", "field": "prenom_nom"}, {"title": "Date de début", "field": "date_debut", formatter:"datetime", formatterParams:{ @@ -15,7 +15,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", { outputFormat:"dd/MM/yy", }}, {"title": "Type de congé", "field": "type"}, - {"title": "Date de la demande", "field": "date_demande"}, + {"title": "Date de la demande", "field": "date_demande", responsive: 1}, {"title": "Validation par supérieur hiérarchique", "field": "validation_hierarchique", formatter:"tickCross", formatterParams :{ allowEmpty : true , }}, @@ -24,7 +24,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", { }}, ], pagination: true, - paginationSize: 5 + paginationSize: 5, }) const bouton_demande_conges = $("bouton-demande-conge"); diff --git a/gestion_conge/templates/gestion_conge/index.html b/gestion_conge/templates/gestion_conge/index.html index 17d1ff6..30a2595 100644 --- a/gestion_conge/templates/gestion_conge/index.html +++ b/gestion_conge/templates/gestion_conge/index.html @@ -7,6 +7,7 @@
{{message}}
{% endfor %} {% endif %} +
@@ -32,11 +33,17 @@
{{ nombre_conges_valide }}
-
+
+ +
+

Liste des demandes de congé

-
+
+ +
+
diff --git a/gestion_employe/migrations/0001_initial.py b/gestion_employe/migrations/0001_initial.py index 26edccb..3c27a92 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-06-16 11:06 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/index.js b/gestion_employe/static/gestion_employe/js/index.js index 95eb1d8..ba451c1 100644 --- a/gestion_employe/static/gestion_employe/js/index.js +++ b/gestion_employe/static/gestion_employe/js/index.js @@ -12,6 +12,7 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", { // ajaxURL: url_liste_employe, pagination: true, paginationSize: 10, + responsiveLayout : "hide" }) fetch(url_liste_employe) diff --git a/gestion_projet/migrations/0001_initial.py b/gestion_projet/migrations/0001_initial.py index c85eb6d..350818e 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-06-16 11:06 import django.db.models.deletion from django.db import migrations, models diff --git a/gestion_salle/__pycache__/views.cpython-310.pyc b/gestion_salle/__pycache__/views.cpython-310.pyc index 9efbbdabc1aedd12f8db19c3bc224f8aa23e91ba..a1476aea09aef55cf347b330cd5edf63ac639ad1 100644 GIT binary patch delta 19 ZcmZ2ty~LU;pO=@50SF92Hge691pqEf1X2J1 delta 19 ZcmZ2ty~LU;pO=@50SJBvZRDCI3ji|%1sebW diff --git a/gestion_salle/migrations/0001_initial.py b/gestion_salle/migrations/0001_initial.py index f477d96..ceff4f8 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-06-16 11:06 import django.db.models.deletion from django.db import migrations, models diff --git a/requirements.txt b/requirements.txt index a0fb268..b4b76bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,7 @@ numpy==2.2.6 pandas==2.3.3 pillow==12.2.0 python-dateutil==2.9.0.post0 +python-decouple==3.8 pytz==2026.1.post1 requests==2.33.1 six==1.17.0 @@ -17,5 +18,5 @@ sqlparse==0.5.5 typing_extensions==4.15.0 tzdata==2026.2 urllib3==2.6.3 -python-decouple -gunicorn +webservices==0.7 +webservices.naudit==0.7.2 From 643205a4bbf0fb6c32693d00af0e7cb2327c5485 Mon Sep 17 00:00:00 2001 From: Soriba SYLLA Date: Tue, 4 Aug 2026 09:34:31 +0000 Subject: [PATCH 2/2] Premiere implementation de sso --- SIRH/__pycache__/__init__.cpython-310.pyc | Bin 126 -> 123 bytes SIRH/__pycache__/settings.cpython-310.pyc | Bin 3345 -> 3200 bytes SIRH/__pycache__/urls.cpython-310.pyc | Bin 1362 -> 1359 bytes SIRH/__pycache__/wsgi.cpython-310.pyc | Bin 523 -> 520 bytes SIRH/settings.py | 43 ++++++++---------- .../SIRH/parts/menu_application.html | 6 +-- SIRH/templates/SIRH/parts/menu_principal.html | 4 +- .../fonctions_utilitaire.cpython-310.pyc | Bin 2135 -> 2132 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 135 -> 132 bytes .../__pycache__/admin.cpython-310.pyc | Bin 176 -> 173 bytes .../__pycache__/apps.cpython-310.pyc | Bin 427 -> 424 bytes .../__pycache__/forms.cpython-310.pyc | Bin 861 -> 858 bytes .../__pycache__/models.cpython-310.pyc | Bin 1287 -> 1284 bytes .../__pycache__/urls.cpython-310.pyc | Bin 554 -> 551 bytes .../__pycache__/views.cpython-310.pyc | Bin 6053 -> 6050 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 137 -> 134 bytes .../__pycache__/admin.cpython-310.pyc | Bin 628 -> 625 bytes .../__pycache__/forms.cpython-310.pyc | Bin 2742 -> 2739 bytes .../__pycache__/models.cpython-310.pyc | Bin 5607 -> 5604 bytes .../__pycache__/urls.cpython-310.pyc | Bin 1511 -> 1508 bytes .../__pycache__/views.cpython-310.pyc | Bin 14436 -> 14433 bytes .../tags_personnaliser.cpython-310.pyc | Bin 1120 -> 1117 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 136 -> 133 bytes .../__pycache__/admin.cpython-310.pyc | Bin 441 -> 438 bytes .../__pycache__/forms.cpython-310.pyc | Bin 4554 -> 4551 bytes .../__pycache__/models.cpython-310.pyc | Bin 7657 -> 7654 bytes .../__pycache__/urls.cpython-310.pyc | Bin 2349 -> 2346 bytes .../__pycache__/views.cpython-310.pyc | Bin 16653 -> 16650 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 135 -> 132 bytes .../__pycache__/admin.cpython-310.pyc | Bin 176 -> 173 bytes .../__pycache__/apps.cpython-310.pyc | Bin 370 -> 367 bytes .../__pycache__/forms.cpython-310.pyc | Bin 1556 -> 1553 bytes .../__pycache__/models.cpython-310.pyc | Bin 1502 -> 1499 bytes .../__pycache__/urls.cpython-310.pyc | Bin 929 -> 926 bytes .../__pycache__/views.cpython-310.pyc | Bin 7588 -> 7585 bytes staticfiles/gestion_conge/js/index.js | 6 +-- staticfiles/gestion_employe/js/index.js | 1 + staticfiles/gestion_employe/js/mon_profil.js | 32 +++++++------ .../js/enregistrement_bailleur.js | 30 +++++++++++- staticfiles/gestion_salle/js/index.js | 33 ++++++++------ 40 files changed, 93 insertions(+), 62 deletions(-) diff --git a/SIRH/__pycache__/__init__.cpython-310.pyc b/SIRH/__pycache__/__init__.cpython-310.pyc index 92d486cc0f049ea40a94cbcb8e03ab405436c939..95c1059ee5917b770e059c1ec6daad3fc6901aaf 100644 GIT binary patch delta 31 lcmb=c=E>*fZcZgMrxAshf?*M&)0^JRLZ-A}`gpDLKJR;mfd^hpEV8kZq;Zd>g-pqGGFPNbB zfhi!+Kp#0{enbL-{yW0pei*<5FbG4W>+m%qIMPN-8?9{|+g?T(iR#>o5c$|2fg(5>IU=dG}%ud)TSi;lb zz%$^)v*5yWu#D$n1uuXb+h7$hk}h^w!%Jkf^=pJ3CK7Crz{xwX3+M!8+kAS5FhWTM zsTK#C=G_Dr$RxQ`BFXwQF)kDgMH5eU)f-y*(DAJxsmVvyhoG1h3uPzdoVjei#EVdI zo?TTgPMaFPFBA1f*mjUguw1i?FmZ1paTw$LZFVn~NVbD`j7!>(q#+$`>ZY2Fl2L4v zX=_B>t{_bRD! zrO0AW6-TaE`RJmQKR6B?mJV{!<(KEd=FXYtg+IP}8H}F=gPv6QB3^U*(yP*yFB(Y( zxyt2bsSt{tlr~R8QO{{|xppeK>nCLn3sLOe+Dz?6>h2R+KHqk^WWFLhvX}A+FUrEP zkk86OS#;)k=~yT@%Ti%`%j2r>Qk9on%E!(f6i|%%Ioh_YjOt3Xq*Gq&4jGjo%F0*W zcjZf$e@&Vvuay=EG);as;7x^-nE)4yWY~x|6n;-h`>lElevP@RS;9`G zLuvJTq(?m}t-4!fqD@H4Xbp^xW=x1iTAF@lelyREk=D{k{ZDnuXZ?neVbEXIqL%&v Dgu~vy delta 995 zcmZutOHUg~5T0%ZGZ>qP!`p#`1PJC~8;rq_3lltqhw)@RV~6y`GOo5g#(10=gM%+5 ziWKcN8trApVaY9L&iNxFt#a7>g4P4M%D%tu&`#)uKIpyViwJyh zhiUphAPvF51!G7*43Yub4nuDd3?E@52O}_gQ|Z6NaQ6ahhzwQ-SZ0hV$KN7`_Z+bE&s7W;+i7zY z%DHM$55i&aFqc1~RWO6*%ZgT~k*1rG|Gop*c1g*nJ4wmrlj6Q)UAp||-ngiWPeet^ zwkZ2om{z2e-FK6HCMwEvITgR9*p?ObR`^U#sR5TU#3nL^8Q8qjLb$2qodUk4a|F$8 zC|}KVoTBqaCQ>adzBr(yMr(zbwkyK(d|_8smY-w}UQ~AW%sok2N|orzZsH_*mM4mjX49#J1znQ$N9Xi{?TbrWVmhH_w^H(cR@xVL5+6B3X|1;f-zGvO{g{SK-Jlig z@2;uMcZ}sZ!Q(+5)Y~Swy4!qM-~})5#=H+`Zv0IsDA5dZ)H delta 37 rcmX@lb%~2RpO=@50SHph7;ogh#=;}3pOK%Ns$ZO6l$ta76-z1r!AuK@ diff --git a/SIRH/__pycache__/wsgi.cpython-310.pyc b/SIRH/__pycache__/wsgi.cpython-310.pyc index e1f658ca81013663e025ae4eeb9cf88612a8bc31..dae042cccd7c5dc79c90a8cb43c24bed1b2526c4 100644 GIT binary patch delta 35 pcmeBX>0sf>=jG*M0D|+^GqX1G9AV^?(l1La(l0MBpL~Z=9{{BC3WNXv delta 38 scmeBR>1N@{=jG*M0D{_me=;}n9AV^<)z8S!P1P^XFG|gse3MZh0Ldl`&Hw-a diff --git a/SIRH/settings.py b/SIRH/settings.py index a07e0fc..df3bb06 100644 --- a/SIRH/settings.py +++ b/SIRH/settings.py @@ -24,9 +24,10 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = config('DEBUG', default=False, cast=bool) +DEBUG = config('DEBUG', default=True, cast=bool) -ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]).split(',') +ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]).split(',') +CSRF_TRUSTED_ORIGINS = config("CSRF_TRUSTED_ORIGINS", default=[]).split(",") # Application definition @@ -77,24 +78,16 @@ WSGI_APPLICATION = 'SIRH.wsgi.application' # https://docs.djangoproject.com/en/5.2/ref/settings/#databases -if config('ENVIRONMENT') == 'local': - DATABASES = { +DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } - } -else: - DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.mysql', - 'NAME': config('DATABASE_NAME'), - 'USER': config('DATABASE_USER'), - 'PASSWORD': config('DATABASE_PASSWORD'), - 'HOST': config('DATABASE_HOST'), - 'PORT': config('DATABASE_PORT'), - } + 'ENGINE': 'django.db.backends.mysql', + 'NAME': config("DB_NAME"), + 'USER': config("DB_USER"), + 'PASSWORD': config("DB_PASSWORD"), + 'HOST': config("DB_HOST"), + 'PORT': config("DB_PORT", cast=int), } +} # Password validation # https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators @@ -151,10 +144,10 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' # LOGIN_URL = '/client/' LOGIN_URL = 'simple-sso-login' -SSO_PRIVATE_KEY = 'wV3nf1YXeZpepf8iJAdWcfJOS4BVXYlIKsKES2RheuJLu5ycgm0ZK3zgdw9ODjdo' # Designe la clé privée -SSO_PUBLIC_KEY = 'E8vV810D8HSmhUwl6abuZALhO5fmUdjjd3wAVCFZyyDX7SsSeAf9XwVyKZ5brilt' # Designe la clé publique -SSO_SERVER = 'http://localhost:8000/server/' -SSO_LOGOUT_URL = 'http://localhost:8000/deconnexion' +SSO_PRIVATE_KEY = 'D2brFY3LnNDLQBBnvYPXAn185Wi9EpPvnHsUosjEZ9vZMyEtXqkcVfFWkVbN0xpG' +SSO_PUBLIC_KEY = 'm9JDP3uGPmGG9ULqPw2BY3ryBNMTGRsuukgIOhk7lIN9lT0wlr2zhoRZiNZ28UCM' +SSO_SERVER = 'http://test-authentification.cerfig.org:89/server/' +#SSO_LOGOUT_URL = 'http://test-authentification.cerfig.org:89/deconnexion' # Configuration de l'email EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' @@ -162,6 +155,6 @@ EMAIL_HOST = 'ssl0.ovh.net' EMAIL_PORT = 465 EMAIL_USE_SSL = True EMAIL_USE_TLS = False -EMAIL_HOST_USER = 'support.it@cerfig.org' -EMAIL_HOST_PASSWORD = 'Cerfig2025' -DEFAULT_FROM_EMAIL = EMAIL_HOST_USER \ No newline at end of file +EMAIL_HOST_USER = config("EMAIL_HOST_USER") +EMAIL_HOST_PASSWORD = config("EMAIL_HOST_PASSWORD") +DEFAULT_FROM_EMAIL = EMAIL_HOST_USER diff --git a/SIRH/templates/SIRH/parts/menu_application.html b/SIRH/templates/SIRH/parts/menu_application.html index e07de74..46b6ab4 100644 --- a/SIRH/templates/SIRH/parts/menu_application.html +++ b/SIRH/templates/SIRH/parts/menu_application.html @@ -1,8 +1,8 @@ \ No newline at end of file +
diff --git a/SIRH/templates/SIRH/parts/menu_principal.html b/SIRH/templates/SIRH/parts/menu_principal.html index 54e0a9d..ddf1e44 100644 --- a/SIRH/templates/SIRH/parts/menu_principal.html +++ b/SIRH/templates/SIRH/parts/menu_principal.html @@ -42,7 +42,7 @@ Réservation {% comment %} {% url 'deconnexion' %} {% endcomment %} - + Déconnexion -
\ No newline at end of file + diff --git a/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc b/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc index dae81941abfcbc9d54efb4f892fcc323a0caf915..eb6291db7a8c0e31ff9113b68f13e71544dc27ed 100644 GIT binary patch delta 35 pcmcaEa7BPSpO=@50SFqdWp3m?&%|k|UzS*;UtV6m`599oD*(4`3l#tW delta 38 scmca2a9w~qpO=@50SG$0c{XyNXX3HZ&&bbB)i2I3O3m5)n5mEz0L8%zSO5S3 diff --git a/gestion_conge/__pycache__/__init__.cpython-310.pyc b/gestion_conge/__pycache__/__init__.cpython-310.pyc index 987b2f8dfd8e4b3bc3c7f842c2a83262f093ccf0..bb6608d0253385e1e3be8fd467287206eeffc1e7 100644 GIT binary patch delta 33 ncmZo?Y+>Zd=jG*M0D^{VnOPHgtU1;7%My$9%gf6r2Aco?g6jza delta 36 qcmZo+Y-i-j=jG*M0D{_me=;ZXSo3JKEr1rRGcwFaZFm>xPg%;pO=@50SIdM{mGojlg^{ApOK%Ns$ZO6l$tZK#t;CwHVZ%i diff --git a/gestion_conge/__pycache__/apps.cpython-310.pyc b/gestion_conge/__pycache__/apps.cpython-310.pyc index 609f119ab8c7873be59ef4c65de73a91cca827b5..111e72c07199811904621c07c31a06ee85095f7a 100644 GIT binary patch delta 35 pcmZ3@yn>l0pO=@50SFqdWoB*Ukz(Xj)-Ove(l0MBpKQcf2>_aM32^`b delta 38 scmZ3%yqcLOpO=@50SIdM{mIX#)J>6e$6Z~nu?%>)3fZVH0{ delta 39 tcmZqSYUkp~=jG*M0D{_me=;}nJYnL|(9g)vP1P^XFG|hX{F8~B2>{uv3>^Rf diff --git a/gestion_conge/__pycache__/urls.cpython-310.pyc b/gestion_conge/__pycache__/urls.cpython-310.pyc index 13410875a806db51ac8d70b72271b52a8f77546b..5616d7fa923e94e974d8207368988679a1cf181a 100644 GIT binary patch delta 35 pcmZ3*vYdq{pO=@50SFqdWoB*U*}}-FtY4N`q+ecMKKTq|8~~-m3W@*# delta 38 scmZ3^vWkT#pO=@50SIdM{mIV0LNns%>V!Z diff --git a/gestion_employe/__pycache__/__init__.cpython-310.pyc b/gestion_employe/__pycache__/__init__.cpython-310.pyc index 7ef245dd2b37a82a6dda2dd1795392271af4053e..6ec686352a793424010bfc5adc3feb201ae231a3 100644 GIT binary patch delta 33 ncmeBVY-8lf=jG*M0D}5!nOPHgtT{FH%My$9%gf6r2Acr@gK-H7 delta 36 qcmZo;>}2H0=jG*M0D{_me=;ZXSo7%UXXNLm>KEr1rRGcwFarRpm=MbpO=@50SM}^WoB*U31{L|(=SUb(l0MB-<;3n&H(_i7z!T% delta 39 tcmdlix=oZPpO=@50SIdM{mIBs5diZt43Pi; diff --git a/gestion_employe/__pycache__/urls.cpython-310.pyc b/gestion_employe/__pycache__/urls.cpython-310.pyc index 93ed628222ab9eb45626344d179ca0b930fdfc56..7e541c80f4e66c15f72b9951379f6a4e6d0021da 100644 GIT binary patch delta 35 pcmaFP{e+t*pO=@50SM}^WoB*U`Od|253xWUu diff --git a/gestion_projet/__pycache__/__init__.cpython-310.pyc b/gestion_projet/__pycache__/__init__.cpython-310.pyc index 48bd83f6db8eee71c967ab168b4c0dcfb6fb8caf..065b575bc85baacb46d7130a5de2c7246f73242c 100644 GIT binary patch delta 33 ncmeBRY-Qxh=jG*M0D^PZGqWc0SaWLVmn9bImzS4M3^oM-iDL;> delta 36 qcmZo=>|o@{=jG*M0D{_me=;ZXSo3J>XXNLm>KEr1rRGcwFa-drLJFV& diff --git a/gestion_projet/__pycache__/admin.cpython-310.pyc b/gestion_projet/__pycache__/admin.cpython-310.pyc index 21dd0522e1c49e71433e49752baf8f6796002c25..4bbfbced8c2fb8e0ae4874c9059d68fc40894440 100644 GIT binary patch delta 35 pcmdnVyp5SBpO=@50SL}r&&=A$!_3I3s$Z5^q+ecMK3SS^9sr|#3Dp1q delta 38 scmdnSypx$HpO=@50SIdM{mIpnil}X918CM delta 39 tcmX@Ed`g)opO=@50SIdM{mIx!MbHKS%d`ur delta 40 ucmeBbV(e{VZd=jG*M0D}5!nOPHgtU1;7%My$9%gf6r2Aco?g4YQF delta 36 qcmZo+Y-i-j=jG*M0D{_me=;ZXSo3JKEr1rRGcwFaZFm>xPg%;pO=@50SIdM{mGojlg^{ApOK%Ns$ZO6l$tZK#t;CwHVZ%i diff --git a/gestion_salle/__pycache__/apps.cpython-310.pyc b/gestion_salle/__pycache__/apps.cpython-310.pyc index 8c518c83764c04a530cc77b3759a3e320b7f7e1b..84176b72e5b7143f886ffd861d33ccaed5f949e6 100644 GIT binary patch delta 33 ncmeyw^qz?)pO=@50SM}^WoAv}dCaM-UzS*;UtV55@pm}@sAvml delta 36 qcmaFQ^ofZlpO=@50SIdM{mGoj^O#3XKO;XkRlhjDC^cu|k8%Lh@eKn2 diff --git a/gestion_salle/__pycache__/forms.cpython-310.pyc b/gestion_salle/__pycache__/forms.cpython-310.pyc index fdcd7e108a7602e75c576aec38f55e2d6193dc93..28cb16a6cc312da38faabb0dd87b49f18d73d967 100644 GIT binary patch delta 36 qcmbQjGm(cUpO=@50SM}^WoB*UdCknJqF&&bbB)i2I3O3m5)nsb{l0K0VyPyhe` diff --git a/staticfiles/gestion_conge/js/index.js b/staticfiles/gestion_conge/js/index.js index 1d156cf..5308791 100644 --- a/staticfiles/gestion_conge/js/index.js +++ b/staticfiles/gestion_conge/js/index.js @@ -3,7 +3,7 @@ const $ = (element) => document.getElementById(element); const url_liste_conge_attente = $("liste-demande-conges").dataset.url const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", { - layout : "fitColumns", + // layout : "fitColumns", columns: [ {"title": "Nom et Prénom", "field": "prenom_nom"}, {"title": "Date de début", "field": "date_debut", formatter:"datetime", formatterParams:{ @@ -15,7 +15,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", { outputFormat:"dd/MM/yy", }}, {"title": "Type de congé", "field": "type"}, - {"title": "Date de la demande", "field": "date_demande"}, + {"title": "Date de la demande", "field": "date_demande", responsive: 1}, {"title": "Validation par supérieur hiérarchique", "field": "validation_hierarchique", formatter:"tickCross", formatterParams :{ allowEmpty : true , }}, @@ -24,7 +24,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", { }}, ], pagination: true, - paginationSize: 5 + paginationSize: 5, }) const bouton_demande_conges = $("bouton-demande-conge"); diff --git a/staticfiles/gestion_employe/js/index.js b/staticfiles/gestion_employe/js/index.js index 95eb1d8..ba451c1 100644 --- a/staticfiles/gestion_employe/js/index.js +++ b/staticfiles/gestion_employe/js/index.js @@ -12,6 +12,7 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", { // ajaxURL: url_liste_employe, pagination: true, paginationSize: 10, + responsiveLayout : "hide" }) fetch(url_liste_employe) diff --git a/staticfiles/gestion_employe/js/mon_profil.js b/staticfiles/gestion_employe/js/mon_profil.js index 64c77f9..77178b4 100644 --- a/staticfiles/gestion_employe/js/mon_profil.js +++ b/staticfiles/gestion_employe/js/mon_profil.js @@ -16,27 +16,31 @@ const tableau_certificat = new Tabulator("#tableau-certificat", { ], ajaxURL: url_certificat, }) - 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)) -}) \ No newline at end of file + .catch(error => console.error("Erreur:", error)); +}); \ No newline at end of file diff --git a/staticfiles/gestion_projet/js/enregistrement_bailleur.js b/staticfiles/gestion_projet/js/enregistrement_bailleur.js index afe12ea..c09f502 100644 --- a/staticfiles/gestion_projet/js/enregistrement_bailleur.js +++ b/staticfiles/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/staticfiles/gestion_salle/js/index.js b/staticfiles/gestion_salle/js/index.js index 4f69d09..6950c0e 100644 --- a/staticfiles/gestion_salle/js/index.js +++ b/staticfiles/gestion_salle/js/index.js @@ -15,7 +15,6 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), { .then(response => response.json()) .then(data => { currentReservationId = data.id_reservation; - console.log(data); $("id_reservation_detail").value = data.id_reservation; $("id_reservation_refus").value = data.id_reservation; $("id_reservation_zoom").value = data.id_reservation; @@ -30,11 +29,10 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), { $("besoin_ordinateur").checked=data.besoin_ordinateur; $("lien_zoom").value=data.lien_zoom; - if(data.statut !== "annulee"){ - $("motif_refus_container").className = "d-none"; - }else{ - $("motif_refus").value=data.motif_refus; + if (data.besoin_zoom === false){ + $("lien_zoom_container").className = "d-none"; } + }) } }); @@ -80,6 +78,11 @@ $("bouton-annuler").addEventListener("click", (e) => { const csrf = document.querySelector("[name=csrfmiddlewaretoken]").value; const url_annuler = $("formulaire-details").dataset.urlannuler; + console.log("URL d'annulation :"); + console.log($("formulaire-details")) + + e.preventDefault(); + fetch( url_annuler, { @@ -130,6 +133,9 @@ if($("refuserReservation")){ const url = e.currentTarget.dataset.lienrefus; const idRes = $("id_reservation_detail").value; + console.log(idRes); + e.preventDefault(); + fetch(url, { method: "POST", headers: { @@ -161,16 +167,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; @@ -178,16 +179,20 @@ 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; + + if (id_user != data.employe_id){ + $("bouton-annuler").className = "d-none"; + } const modal = new bootstrap.Modal($("modalDetailReservation")); bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide(); modal.show(); -}) +}) \ No newline at end of file