Compare commits
2 Commits
affichage_
...
643205a4bb
| Author | SHA1 | Date | |
|---|---|---|---|
| 643205a4bb | |||
| 4934b42ed9 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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(',')
|
||||
CSRF_TRUSTED_ORIGINS = config("CSRF_TRUSTED_ORIGINS", default=[]).split(",")
|
||||
|
||||
# Application definition
|
||||
|
||||
@@ -40,12 +41,9 @@ INSTALLED_APPS = [
|
||||
'gestion_employe',
|
||||
'gestion_conge',
|
||||
'gestion_projet',
|
||||
'gestion_salle',
|
||||
'simple_sso.sso_server'
|
||||
'gestion_salle'
|
||||
]
|
||||
|
||||
LOGIN_URL = 'login'
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
@@ -80,22 +78,14 @@ WSGI_APPLICATION = 'SIRH.wsgi.application'
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||
|
||||
|
||||
if config('ENVIRONMENT') == 'local':
|
||||
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'),
|
||||
'NAME': config("DB_NAME"),
|
||||
'USER': config("DB_USER"),
|
||||
'PASSWORD': config("DB_PASSWORD"),
|
||||
'HOST': config("DB_HOST"),
|
||||
'PORT': config("DB_PORT", cast=int),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,12 +140,21 @@ MEDIA_ROOT = BASE_DIR / "media"
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
# Connexion sso
|
||||
# LOGIN_URL = '/client/'
|
||||
LOGIN_URL = 'simple-sso-login'
|
||||
|
||||
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'
|
||||
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'
|
||||
EMAIL_HOST_USER = config("EMAIL_HOST_USER")
|
||||
EMAIL_HOST_PASSWORD = config("EMAIL_HOST_PASSWORD")
|
||||
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
||||
|
||||
33
SIRH/sso.py
Normal file
33
SIRH/sso.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# SGL/sso.py
|
||||
from gestion_employe.models import Employe, Departement
|
||||
from simple_sso.sso_client.client import Client
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import Group
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
class SIRHClient(Client):
|
||||
def build_user(self, user_data):
|
||||
"""Crée le User et son Profile avec les infos reçues du serveur."""
|
||||
user_data_copy = user_data.copy()
|
||||
user_data.pop("departement")
|
||||
user_data.pop("chef_departement")
|
||||
user_data.pop("groups")
|
||||
|
||||
user = super().build_user(user_data)
|
||||
departement = Departement.objects.get_or_create(
|
||||
nom=user_data_copy.get("departement", ""))[0]
|
||||
|
||||
Employe.objects.update_or_create(
|
||||
user = user,
|
||||
defaults = {
|
||||
"departement": departement,
|
||||
"chef": user_data_copy.get("chef_departement", ""),
|
||||
}
|
||||
)
|
||||
|
||||
for group_name in user_data_copy.get("groups", []):
|
||||
group, _ = Group.objects.get_or_create(name=group_name)
|
||||
user.groups.add(group)
|
||||
|
||||
return user
|
||||
@@ -15,8 +15,9 @@
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
{% include 'parts/menu_application.html' %}
|
||||
{% include 'parts/menu_principal.html' %}
|
||||
<div class="col-9 p-4">
|
||||
<div class="col p-4">
|
||||
{% block 'contenu' %} {% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
<div class="mb-3">
|
||||
<label for="mail">Votre adresse email :</label>
|
||||
<input type="text" name="mail" class="form-control" placeholder="Entrez votre e-mail" required>
|
||||
|
||||
8
SIRH/templates/SIRH/parts/menu_application.html
Normal file
8
SIRH/templates/SIRH/parts/menu_application.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="col-1 bg-danger border d-flex flex-column vh-100 pt-5 sticky-top">
|
||||
<a href="http://test-sirh.cerfig.org:89/" class="text-white text-center fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<i class="bi bi-people-fill fs-1 d-block"></i>SIRH
|
||||
</a>
|
||||
<a href="http://test-sgl.cerfig.org:89/" class="text-white text-center fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<i class="bi bi-building-gear fs-1 d-block"></i> SGL
|
||||
</a>
|
||||
</div>
|
||||
@@ -13,35 +13,36 @@
|
||||
<i class="bi bi-person-circle text-white" style="font-size:60px;"></i>
|
||||
{% endif %}
|
||||
<div class="text-white mt-2 fw-bold fs-5">
|
||||
{{ user.username }}
|
||||
{{ user.first_name }} {{ user.last_name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{% url 'gestion_employe:mon-profil' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<a href="{% url 'gestion_employe:mon-profil' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size: 1.2em;">
|
||||
<i class="bi bi-person-circle"></i> Mon profil
|
||||
</a>
|
||||
{% if user|has_group:"ressource_humaine" or user|has_group:"direction" %}
|
||||
<a href="{% url 'gestion_employe:index' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<a href="{% url 'gestion_employe:index' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size: 1.2em;">
|
||||
<i class="bi bi-speedometer2"></i> Tableau de bord
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if user|has_group:"ressource_humaine" or user|has_group:"direction" %}
|
||||
<a href="{% url 'gestion_projet:index' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<a href="{% url 'gestion_projet:index' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size: 1.2em;">
|
||||
<i class="bi bi-folder"></i> Gestion des Projets
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'gestion_conges:conge' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<a href="{% url 'gestion_conges:conge' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size: 1.2em;">
|
||||
<i class="bi bi-airplane"></i> Gestion des congés
|
||||
</a>
|
||||
{% if user|is_chef_projet %}
|
||||
<a href="{% url 'gestion_projet:activites-projet' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<a href="{% url 'gestion_projet:activites-projet' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size: 1.2em;">
|
||||
<i class="bi bi-list-task"></i> Suivi des Activités
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'gestion_salle:reservation-salle' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
<a href="{% url 'gestion_salle:reservation-salle' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size: 1.2em;">
|
||||
<i class="bi bi-calendar-check"></i> Réservation
|
||||
</a>
|
||||
<a href="{% url 'deconnexion' %}" class="text-white fw-bold text-decoration-none mb-4" style="font-size:1.4em">
|
||||
{% comment %} {% url 'deconnexion' %} {% endcomment %}
|
||||
<a href="http://test-authentification.cerfig.org:89/deconnexion" class="text-white fw-bold text-decoration-none mb-4" style="font-size: 1.2em;">
|
||||
<i class="bi bi-box-arrow-right"></i> Déconnexion
|
||||
</a>
|
||||
</div>
|
||||
43
SIRH/urls.py
43
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 = [
|
||||
# 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(
|
||||
@@ -60,8 +57,6 @@ urlpatterns = [
|
||||
'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)
|
||||
@@ -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')
|
||||
Binary file not shown.
@@ -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é"""
|
||||
|
||||
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.
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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">
|
||||
@@ -32,11 +33,17 @@
|
||||
<h5 class="fw-bold">{{ nombre_conges_valide }}</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between my-4">
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col d-flex justify-content-between align-items-center">
|
||||
<h3><i class="bi bi-list-ul"></i> Liste des demandes de congé</h3>
|
||||
<button class='btn btn-primary' id="bouton-demande-conge">Demande de congé</button>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div id="liste-demande-conges" data-url="{% url 'gestion_conges:liste-des-conges' %}"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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)),
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
]
|
||||
@@ -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)
|
||||
|
||||
@@ -24,6 +24,7 @@ enregistrerProfil.addEventListener("click", (e) => {
|
||||
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);
|
||||
@@ -31,10 +32,6 @@ enregistrerProfil.addEventListener("click", (e) => {
|
||||
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]);
|
||||
}
|
||||
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
|
||||
Binary file not shown.
@@ -191,7 +191,7 @@ def modifier_employer(request):
|
||||
except Employe.DoesNotExist:
|
||||
return JsonResponse({"message": "Employé non trouvé."})
|
||||
if request.method == "POST":
|
||||
data = request.POST
|
||||
data = json.loads(request.body)
|
||||
user = User.objects.get(username=request.user)
|
||||
user.last_name = data['nom']
|
||||
user.first_name = data['prenom']
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
||||
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.
@@ -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
|
||||
|
||||
@@ -21,8 +21,7 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
||||
$("employe").value=data.employe;
|
||||
$("salle").value=data.salle;
|
||||
$("statut-reservation").innerHTML=data.statut;
|
||||
$("date_debut").value=data.date_debut;
|
||||
$("date_fin").value=data.date_fin;
|
||||
$("date_evenement").value=data.date_evenement;
|
||||
$("heure_debut").value=data.heure_debut;
|
||||
$("heure_fin").value=data.heure_fin;
|
||||
$("motif_reservation").value=data.motif_reservation;
|
||||
|
||||
@@ -153,8 +153,7 @@ def detail_reservation(request:HttpRequest, reservation_id:int):
|
||||
'employe': f"{employe.first_name} {employe.last_name}",
|
||||
'salle': reservation.salle,
|
||||
'statut': dict(Reservation.STATUT).get(reservation.statut),
|
||||
'date_debut': reservation.date_debut.strftime('%Y-%m-%d'),
|
||||
'date_fin': reservation.date_fin.strftime('%Y-%m-%d'),
|
||||
'date_evenement': reservation.date_debut.strftime('%Y-%m-%d'),
|
||||
'heure_debut': reservation.heure_debut.strftime('%H:%M'),
|
||||
'heure_fin': reservation.heure_fin.strftime('%H:%M'),
|
||||
'motif_reservation': reservation.motif_reservation,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
.catch(error => console.error("Erreur:", error));
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur');
|
||||
let table;
|
||||
|
||||
btnEnregistrerBailleur.addEventListener('click', function() {
|
||||
const form = document.getElementById('formBailleur');
|
||||
@@ -21,3 +22,30 @@ btnEnregistrerBailleur.addEventListener('click', function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -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,14 +179,18 @@ 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();
|
||||
|
||||
Reference in New Issue
Block a user