diff --git a/SIRH/__pycache__/__init__.cpython-310.pyc b/SIRH/__pycache__/__init__.cpython-310.pyc index 92d486c..95c1059 100644 Binary files a/SIRH/__pycache__/__init__.cpython-310.pyc and b/SIRH/__pycache__/__init__.cpython-310.pyc differ diff --git a/SIRH/__pycache__/settings.cpython-310.pyc b/SIRH/__pycache__/settings.cpython-310.pyc index 85ec63c..0376a03 100644 Binary files a/SIRH/__pycache__/settings.cpython-310.pyc and b/SIRH/__pycache__/settings.cpython-310.pyc differ diff --git a/SIRH/__pycache__/urls.cpython-310.pyc b/SIRH/__pycache__/urls.cpython-310.pyc index a7fb81b..e1ea0be 100644 Binary files a/SIRH/__pycache__/urls.cpython-310.pyc and b/SIRH/__pycache__/urls.cpython-310.pyc differ diff --git a/SIRH/__pycache__/wsgi.cpython-310.pyc b/SIRH/__pycache__/wsgi.cpython-310.pyc index e1f658c..dae042c 100644 Binary files a/SIRH/__pycache__/wsgi.cpython-310.pyc and b/SIRH/__pycache__/wsgi.cpython-310.pyc differ 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 @@
- + SIRH - + SGL -
\ 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 dae8194..eb6291d 100644 Binary files a/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc and b/fonction_utilitaire/__pycache__/fonctions_utilitaire.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/__init__.cpython-310.pyc b/gestion_conge/__pycache__/__init__.cpython-310.pyc index 987b2f8..bb6608d 100644 Binary files a/gestion_conge/__pycache__/__init__.cpython-310.pyc and b/gestion_conge/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/admin.cpython-310.pyc b/gestion_conge/__pycache__/admin.cpython-310.pyc index 2c9ad77..8be6bdb 100644 Binary files a/gestion_conge/__pycache__/admin.cpython-310.pyc and b/gestion_conge/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/apps.cpython-310.pyc b/gestion_conge/__pycache__/apps.cpython-310.pyc index 609f119..111e72c 100644 Binary files a/gestion_conge/__pycache__/apps.cpython-310.pyc and b/gestion_conge/__pycache__/apps.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/forms.cpython-310.pyc b/gestion_conge/__pycache__/forms.cpython-310.pyc index 647d273..60167a9 100644 Binary files a/gestion_conge/__pycache__/forms.cpython-310.pyc and b/gestion_conge/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/models.cpython-310.pyc b/gestion_conge/__pycache__/models.cpython-310.pyc index 2f5b81c..d444aa0 100644 Binary files a/gestion_conge/__pycache__/models.cpython-310.pyc and b/gestion_conge/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/urls.cpython-310.pyc b/gestion_conge/__pycache__/urls.cpython-310.pyc index 1341087..5616d7f 100644 Binary files a/gestion_conge/__pycache__/urls.cpython-310.pyc and b/gestion_conge/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_conge/__pycache__/views.cpython-310.pyc b/gestion_conge/__pycache__/views.cpython-310.pyc index 176c828..686c003 100644 Binary files a/gestion_conge/__pycache__/views.cpython-310.pyc and b/gestion_conge/__pycache__/views.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/__init__.cpython-310.pyc b/gestion_employe/__pycache__/__init__.cpython-310.pyc index 7ef245d..6ec6863 100644 Binary files a/gestion_employe/__pycache__/__init__.cpython-310.pyc and b/gestion_employe/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/admin.cpython-310.pyc b/gestion_employe/__pycache__/admin.cpython-310.pyc index b3b000c..9389161 100644 Binary files a/gestion_employe/__pycache__/admin.cpython-310.pyc and b/gestion_employe/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/forms.cpython-310.pyc b/gestion_employe/__pycache__/forms.cpython-310.pyc index a88d33a..ce2030e 100644 Binary files a/gestion_employe/__pycache__/forms.cpython-310.pyc and b/gestion_employe/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/models.cpython-310.pyc b/gestion_employe/__pycache__/models.cpython-310.pyc index afc99ae..288d5ca 100644 Binary files a/gestion_employe/__pycache__/models.cpython-310.pyc and b/gestion_employe/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/urls.cpython-310.pyc b/gestion_employe/__pycache__/urls.cpython-310.pyc index 93ed628..7e541c8 100644 Binary files a/gestion_employe/__pycache__/urls.cpython-310.pyc and b/gestion_employe/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_employe/__pycache__/views.cpython-310.pyc b/gestion_employe/__pycache__/views.cpython-310.pyc index 583bcce..981427d 100644 Binary files a/gestion_employe/__pycache__/views.cpython-310.pyc and b/gestion_employe/__pycache__/views.cpython-310.pyc differ diff --git a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc b/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc index b6fa4ab..ac2267d 100644 Binary files a/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc and b/gestion_employe/templatetags/__pycache__/tags_personnaliser.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/__init__.cpython-310.pyc b/gestion_projet/__pycache__/__init__.cpython-310.pyc index 48bd83f..065b575 100644 Binary files a/gestion_projet/__pycache__/__init__.cpython-310.pyc and b/gestion_projet/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/admin.cpython-310.pyc b/gestion_projet/__pycache__/admin.cpython-310.pyc index 21dd052..4bbfbce 100644 Binary files a/gestion_projet/__pycache__/admin.cpython-310.pyc and b/gestion_projet/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/forms.cpython-310.pyc b/gestion_projet/__pycache__/forms.cpython-310.pyc index 22bbb9b..18f0eb7 100644 Binary files a/gestion_projet/__pycache__/forms.cpython-310.pyc and b/gestion_projet/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/models.cpython-310.pyc b/gestion_projet/__pycache__/models.cpython-310.pyc index 19a467c..cdbf1b2 100644 Binary files a/gestion_projet/__pycache__/models.cpython-310.pyc and b/gestion_projet/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/urls.cpython-310.pyc b/gestion_projet/__pycache__/urls.cpython-310.pyc index 1a95b18..c921330 100644 Binary files a/gestion_projet/__pycache__/urls.cpython-310.pyc and b/gestion_projet/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_projet/__pycache__/views.cpython-310.pyc b/gestion_projet/__pycache__/views.cpython-310.pyc index ec80360..dd3ac06 100644 Binary files a/gestion_projet/__pycache__/views.cpython-310.pyc and b/gestion_projet/__pycache__/views.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/__init__.cpython-310.pyc b/gestion_salle/__pycache__/__init__.cpython-310.pyc index 13c3ba8..f9569bc 100644 Binary files a/gestion_salle/__pycache__/__init__.cpython-310.pyc and b/gestion_salle/__pycache__/__init__.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/admin.cpython-310.pyc b/gestion_salle/__pycache__/admin.cpython-310.pyc index 4e1b01c..ccf46c9 100644 Binary files a/gestion_salle/__pycache__/admin.cpython-310.pyc and b/gestion_salle/__pycache__/admin.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/apps.cpython-310.pyc b/gestion_salle/__pycache__/apps.cpython-310.pyc index 8c518c8..84176b7 100644 Binary files a/gestion_salle/__pycache__/apps.cpython-310.pyc and b/gestion_salle/__pycache__/apps.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/forms.cpython-310.pyc b/gestion_salle/__pycache__/forms.cpython-310.pyc index fdcd7e1..28cb16a 100644 Binary files a/gestion_salle/__pycache__/forms.cpython-310.pyc and b/gestion_salle/__pycache__/forms.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/models.cpython-310.pyc b/gestion_salle/__pycache__/models.cpython-310.pyc index ce668cc..96e1ecd 100644 Binary files a/gestion_salle/__pycache__/models.cpython-310.pyc and b/gestion_salle/__pycache__/models.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/urls.cpython-310.pyc b/gestion_salle/__pycache__/urls.cpython-310.pyc index 187924c..8ea7101 100644 Binary files a/gestion_salle/__pycache__/urls.cpython-310.pyc and b/gestion_salle/__pycache__/urls.cpython-310.pyc differ diff --git a/gestion_salle/__pycache__/views.cpython-310.pyc b/gestion_salle/__pycache__/views.cpython-310.pyc index a1476ae..850fd71 100644 Binary files a/gestion_salle/__pycache__/views.cpython-310.pyc and b/gestion_salle/__pycache__/views.cpython-310.pyc differ 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