Compare commits
2 Commits
modificati
...
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')
|
SECRET_KEY = config('SECRET_KEY')
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# 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
|
# Application definition
|
||||||
|
|
||||||
@@ -40,12 +41,9 @@ INSTALLED_APPS = [
|
|||||||
'gestion_employe',
|
'gestion_employe',
|
||||||
'gestion_conge',
|
'gestion_conge',
|
||||||
'gestion_projet',
|
'gestion_projet',
|
||||||
'gestion_salle',
|
'gestion_salle'
|
||||||
'simple_sso.sso_server'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
LOGIN_URL = 'login'
|
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
@@ -80,22 +78,14 @@ WSGI_APPLICATION = 'SIRH.wsgi.application'
|
|||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
# 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 = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME': config('DATABASE_NAME'),
|
'NAME': config("DB_NAME"),
|
||||||
'USER': config('DATABASE_USER'),
|
'USER': config("DB_USER"),
|
||||||
'PASSWORD': config('DATABASE_PASSWORD'),
|
'PASSWORD': config("DB_PASSWORD"),
|
||||||
'HOST': config('DATABASE_HOST'),
|
'HOST': config("DB_HOST"),
|
||||||
'PORT': config('DATABASE_PORT'),
|
'PORT': config("DB_PORT", cast=int),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,12 +140,21 @@ MEDIA_ROOT = BASE_DIR / "media"
|
|||||||
|
|
||||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
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
|
# Configuration de l'email
|
||||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||||
EMAIL_HOST = 'ssl0.ovh.net'
|
EMAIL_HOST = 'ssl0.ovh.net'
|
||||||
EMAIL_PORT = 465
|
EMAIL_PORT = 465
|
||||||
EMAIL_USE_SSL = True
|
EMAIL_USE_SSL = True
|
||||||
EMAIL_USE_TLS = False
|
EMAIL_USE_TLS = False
|
||||||
EMAIL_HOST_USER = 'support.it@cerfig.org'
|
EMAIL_HOST_USER = config("EMAIL_HOST_USER")
|
||||||
EMAIL_HOST_PASSWORD = 'Cerfig2025'
|
EMAIL_HOST_PASSWORD = config("EMAIL_HOST_PASSWORD")
|
||||||
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
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>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
|
{% include 'parts/menu_application.html' %}
|
||||||
{% include 'parts/menu_principal.html' %}
|
{% include 'parts/menu_principal.html' %}
|
||||||
<div class="col-9 p-4">
|
<div class="col p-4">
|
||||||
{% block 'contenu' %} {% endblock %}
|
{% block 'contenu' %} {% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
<input type="hidden" name="next" value="{{ next }}">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="mail">Votre adresse email :</label>
|
<label for="mail">Votre adresse email :</label>
|
||||||
<input type="text" name="mail" class="form-control" placeholder="Entrez votre e-mail" required>
|
<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>
|
<i class="bi bi-person-circle text-white" style="font-size:60px;"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="text-white mt-2 fw-bold fs-5">
|
<div class="text-white mt-2 fw-bold fs-5">
|
||||||
{{ user.username }}
|
{{ user.first_name }} {{ user.last_name }}
|
||||||
</div>
|
</div>
|
||||||
</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
|
<i class="bi bi-person-circle"></i> Mon profil
|
||||||
</a>
|
</a>
|
||||||
{% if user|has_group:"ressource_humaine" or user|has_group:"direction" %}
|
{% 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
|
<i class="bi bi-speedometer2"></i> Tableau de bord
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if user|has_group:"ressource_humaine" or user|has_group:"direction" %}
|
{% 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
|
<i class="bi bi-folder"></i> Gestion des Projets
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% 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
|
<i class="bi bi-airplane"></i> Gestion des congés
|
||||||
</a>
|
</a>
|
||||||
{% if user|is_chef_projet %}
|
{% 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
|
<i class="bi bi-list-task"></i> Suivi des Activités
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% 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
|
<i class="bi bi-calendar-check"></i> Réservation
|
||||||
</a>
|
</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
|
<i class="bi bi-box-arrow-right"></i> Déconnexion
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
43
SIRH/urls.py
43
SIRH/urls.py
@@ -16,32 +16,29 @@ Including another URLconf
|
|||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import include, path
|
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 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(
|
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")
|
include("gestion_employe.urls")
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
@@ -60,8 +57,6 @@ urlpatterns = [
|
|||||||
'admin/',
|
'admin/',
|
||||||
admin.site.urls
|
admin.site.urls
|
||||||
),
|
),
|
||||||
# path(
|
path("client/", include(client_sirh.get_urls())),
|
||||||
# 'sso',
|
]
|
||||||
# include(server_sso.get_urls())
|
# + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
# )
|
|
||||||
] + 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
|
NOMBRE_PAGINATION = 8
|
||||||
DEBUT_RAPPEL = 60
|
DEBUT_RAPPEL = 60
|
||||||
DUREE_FIN_CONTRAT = 90
|
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):
|
def solde_conge(employe):
|
||||||
"""Fonction de calcul du solde de congé restant l'employé"""
|
"""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
|
import django.db.models.deletion
|
||||||
from django.db import migrations, models
|
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 url_liste_conge_attente = $("liste-demande-conges").dataset.url
|
||||||
|
|
||||||
const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
||||||
layout : "fitColumns",
|
// layout : "fitColumns",
|
||||||
columns: [
|
columns: [
|
||||||
{"title": "Nom et Prénom", "field": "prenom_nom"},
|
{"title": "Nom et Prénom", "field": "prenom_nom"},
|
||||||
{"title": "Date de début", "field": "date_debut", formatter:"datetime", formatterParams:{
|
{"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",
|
outputFormat:"dd/MM/yy",
|
||||||
}},
|
}},
|
||||||
{"title": "Type de congé", "field": "type"},
|
{"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 :{
|
{"title": "Validation par supérieur hiérarchique", "field": "validation_hierarchique", formatter:"tickCross", formatterParams :{
|
||||||
allowEmpty : true ,
|
allowEmpty : true ,
|
||||||
}},
|
}},
|
||||||
@@ -24,7 +24,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
|||||||
}},
|
}},
|
||||||
],
|
],
|
||||||
pagination: true,
|
pagination: true,
|
||||||
paginationSize: 5
|
paginationSize: 5,
|
||||||
})
|
})
|
||||||
|
|
||||||
const bouton_demande_conges = $("bouton-demande-conge");
|
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>
|
<div class="alert alert-{% if message.tags == 'error' %}danger{% else %}success{% endif %}">{{message}}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="row d-flex justify-content-center mb-4">
|
<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="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">
|
<div class="card-header fw-bold">
|
||||||
@@ -32,11 +33,17 @@
|
|||||||
<h5 class="fw-bold">{{ nombre_conges_valide }}</h5>
|
<h5 class="fw-bold">{{ nombre_conges_valide }}</h5>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
<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>
|
<button class='btn btn-primary' id="bouton-demande-conge">Demande de congé</button>
|
||||||
</div>
|
</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 id="liste-demande-conges" data-url="{% url 'gestion_conges:liste-des-conges' %}"></div>
|
||||||
</div>
|
</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
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
fields=[
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('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)),
|
('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)),
|
('date_embauche', models.DateField(blank=True, null=True)),
|
||||||
('adresse', models.CharField(blank=True, max_length=100, null=True)),
|
('adresse', models.CharField(blank=True, max_length=100, null=True)),
|
||||||
('telephone', models.CharField(blank=True, max_length=15, null=True)),
|
('telephone', models.CharField(blank=True, max_length=15, null=True)),
|
||||||
@@ -48,7 +48,7 @@ class Migration(migrations.Migration):
|
|||||||
fields=[
|
fields=[
|
||||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('numero_contrat', models.CharField(max_length=100, unique=True)),
|
('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_debut', models.DateField()),
|
||||||
('date_fin', models.DateField(blank=True, null=True)),
|
('date_fin', models.DateField(blank=True, null=True)),
|
||||||
('salaire_mensuel', models.DecimalField(blank=True, decimal_places=2, max_digits=10, 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,
|
// ajaxURL: url_liste_employe,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
paginationSize: 10,
|
paginationSize: 10,
|
||||||
|
responsiveLayout : "hide"
|
||||||
})
|
})
|
||||||
|
|
||||||
fetch(url_liste_employe)
|
fetch(url_liste_employe)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ enregistrerProfil.addEventListener("click", (e) => {
|
|||||||
const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value;
|
const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value;
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
|
||||||
formData.append("nom", $("nom").value);
|
formData.append("nom", $("nom").value);
|
||||||
formData.append("prenom", $("prenom").value);
|
formData.append("prenom", $("prenom").value);
|
||||||
formData.append("email", $("email").value);
|
formData.append("email", $("email").value);
|
||||||
@@ -31,10 +32,6 @@ enregistrerProfil.addEventListener("click", (e) => {
|
|||||||
formData.append("adresse", $("adresse").value);
|
formData.append("adresse", $("adresse").value);
|
||||||
formData.append("sexe", $("sexe").value);
|
formData.append("sexe", $("sexe").value);
|
||||||
formData.append("date_naissance", $("date_naissance").value);
|
formData.append("date_naissance", $("date_naissance").value);
|
||||||
const photoInput = $("photo");
|
|
||||||
if (photoInput.files.length > 0) {
|
|
||||||
formData.append("photo", photoInput.files[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
Binary file not shown.
@@ -191,7 +191,7 @@ def modifier_employer(request):
|
|||||||
except Employe.DoesNotExist:
|
except Employe.DoesNotExist:
|
||||||
return JsonResponse({"message": "Employé non trouvé."})
|
return JsonResponse({"message": "Employé non trouvé."})
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
data = request.POST
|
data = json.loads(request.body)
|
||||||
user = User.objects.get(username=request.user)
|
user = User.objects.get(username=request.user)
|
||||||
user.last_name = data['nom']
|
user.last_name = data['nom']
|
||||||
user.first_name = data['prenom']
|
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
|
import django.db.models.deletion
|
||||||
from django.db import migrations, models
|
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
|
import django.db.models.deletion
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ numpy==2.2.6
|
|||||||
pandas==2.3.3
|
pandas==2.3.3
|
||||||
pillow==12.2.0
|
pillow==12.2.0
|
||||||
python-dateutil==2.9.0.post0
|
python-dateutil==2.9.0.post0
|
||||||
|
python-decouple==3.8
|
||||||
pytz==2026.1.post1
|
pytz==2026.1.post1
|
||||||
requests==2.33.1
|
requests==2.33.1
|
||||||
six==1.17.0
|
six==1.17.0
|
||||||
@@ -17,5 +18,5 @@ sqlparse==0.5.5
|
|||||||
typing_extensions==4.15.0
|
typing_extensions==4.15.0
|
||||||
tzdata==2026.2
|
tzdata==2026.2
|
||||||
urllib3==2.6.3
|
urllib3==2.6.3
|
||||||
python-decouple
|
webservices==0.7
|
||||||
gunicorn
|
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 url_liste_conge_attente = $("liste-demande-conges").dataset.url
|
||||||
|
|
||||||
const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
||||||
layout : "fitColumns",
|
// layout : "fitColumns",
|
||||||
columns: [
|
columns: [
|
||||||
{"title": "Nom et Prénom", "field": "prenom_nom"},
|
{"title": "Nom et Prénom", "field": "prenom_nom"},
|
||||||
{"title": "Date de début", "field": "date_debut", formatter:"datetime", formatterParams:{
|
{"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",
|
outputFormat:"dd/MM/yy",
|
||||||
}},
|
}},
|
||||||
{"title": "Type de congé", "field": "type"},
|
{"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 :{
|
{"title": "Validation par supérieur hiérarchique", "field": "validation_hierarchique", formatter:"tickCross", formatterParams :{
|
||||||
allowEmpty : true ,
|
allowEmpty : true ,
|
||||||
}},
|
}},
|
||||||
@@ -24,7 +24,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
|||||||
}},
|
}},
|
||||||
],
|
],
|
||||||
pagination: true,
|
pagination: true,
|
||||||
paginationSize: 5
|
paginationSize: 5,
|
||||||
})
|
})
|
||||||
|
|
||||||
const bouton_demande_conges = $("bouton-demande-conge");
|
const bouton_demande_conges = $("bouton-demande-conge");
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", {
|
|||||||
// ajaxURL: url_liste_employe,
|
// ajaxURL: url_liste_employe,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
paginationSize: 10,
|
paginationSize: 10,
|
||||||
|
responsiveLayout : "hide"
|
||||||
})
|
})
|
||||||
|
|
||||||
fetch(url_liste_employe)
|
fetch(url_liste_employe)
|
||||||
|
|||||||
@@ -16,27 +16,31 @@ const tableau_certificat = new Tabulator("#tableau-certificat", {
|
|||||||
],
|
],
|
||||||
ajaxURL: url_certificat,
|
ajaxURL: url_certificat,
|
||||||
})
|
})
|
||||||
|
|
||||||
const enregistrerProfil = $("enregistrerProfil");
|
const enregistrerProfil = $("enregistrerProfil");
|
||||||
|
|
||||||
enregistrerProfil.addEventListener("click", (e) => {
|
enregistrerProfil.addEventListener("click", (e) => {
|
||||||
|
|
||||||
const url = $("information-personnelles").dataset.url;
|
const url = $("information-personnelles").dataset.url;
|
||||||
const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value;
|
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, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
"X-CSRFToken": csrftoken
|
||||||
'X-CSRFToken': csrftoken
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: formData
|
||||||
"nom": $("nom").value,
|
|
||||||
"prenom": $("prenom").value,
|
|
||||||
"email": $("email").value,
|
|
||||||
"telephone": $("telephone").value,
|
|
||||||
"adresse": $("adresse").value,
|
|
||||||
"sexe": $("sexe").value,
|
|
||||||
"date_naissance": $("date_naissance").value,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => alert(data.message))
|
.then(data => alert(data.message))
|
||||||
})
|
.catch(error => console.error("Erreur:", error));
|
||||||
|
});
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur');
|
const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur');
|
||||||
|
let table;
|
||||||
|
|
||||||
btnEnregistrerBailleur.addEventListener('click', function() {
|
btnEnregistrerBailleur.addEventListener('click', function() {
|
||||||
const form = document.getElementById('formBailleur');
|
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(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
currentReservationId = data.id_reservation;
|
currentReservationId = data.id_reservation;
|
||||||
console.log(data);
|
|
||||||
$("id_reservation_detail").value = data.id_reservation;
|
$("id_reservation_detail").value = data.id_reservation;
|
||||||
$("id_reservation_refus").value = data.id_reservation;
|
$("id_reservation_refus").value = data.id_reservation;
|
||||||
$("id_reservation_zoom").value = data.id_reservation;
|
$("id_reservation_zoom").value = data.id_reservation;
|
||||||
@@ -30,11 +29,10 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
|||||||
$("besoin_ordinateur").checked=data.besoin_ordinateur;
|
$("besoin_ordinateur").checked=data.besoin_ordinateur;
|
||||||
$("lien_zoom").value=data.lien_zoom;
|
$("lien_zoom").value=data.lien_zoom;
|
||||||
|
|
||||||
if(data.statut !== "annulee"){
|
if (data.besoin_zoom === false){
|
||||||
$("motif_refus_container").className = "d-none";
|
$("lien_zoom_container").className = "d-none";
|
||||||
}else{
|
|
||||||
$("motif_refus").value=data.motif_refus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -80,6 +78,11 @@ $("bouton-annuler").addEventListener("click", (e) => {
|
|||||||
const csrf = document.querySelector("[name=csrfmiddlewaretoken]").value;
|
const csrf = document.querySelector("[name=csrfmiddlewaretoken]").value;
|
||||||
const url_annuler = $("formulaire-details").dataset.urlannuler;
|
const url_annuler = $("formulaire-details").dataset.urlannuler;
|
||||||
|
|
||||||
|
console.log("URL d'annulation :");
|
||||||
|
console.log($("formulaire-details"))
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
url_annuler,
|
url_annuler,
|
||||||
{
|
{
|
||||||
@@ -130,6 +133,9 @@ if($("refuserReservation")){
|
|||||||
const url = e.currentTarget.dataset.lienrefus;
|
const url = e.currentTarget.dataset.lienrefus;
|
||||||
const idRes = $("id_reservation_detail").value;
|
const idRes = $("id_reservation_detail").value;
|
||||||
|
|
||||||
|
console.log(idRes);
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -161,16 +167,11 @@ const tableau_reservation_attente = new Tabulator("#tableau-reservation-attente"
|
|||||||
tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
||||||
const data = rowData.getData();
|
const data = rowData.getData();
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
if(data.besoin_zoom === false){
|
if(data.besoin_zoom === false){
|
||||||
$("lien_zoom_container").className = 'd-none';
|
$("lien_zoom_container").className = 'd-none';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data.statut !== "refusee"){
|
const id_user = $("current-user-id").dataset.userid;
|
||||||
$("motif_refus_container").className = 'd-none';
|
|
||||||
}
|
|
||||||
|
|
||||||
$("id_reservation_detail").value = data.id;
|
$("id_reservation_detail").value = data.id;
|
||||||
$("id_reservation_refus").value = data.id;
|
$("id_reservation_refus").value = data.id;
|
||||||
$("id_reservation_zoom").value = data.id;
|
$("id_reservation_zoom").value = data.id;
|
||||||
@@ -178,14 +179,18 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
|||||||
$("employe").value=data.employe;
|
$("employe").value=data.employe;
|
||||||
$("salle").value=data.salle;
|
$("salle").value=data.salle;
|
||||||
$("statut-reservation").innerHTML=data.statut;
|
$("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_debut").value=data.heure_debut;
|
||||||
$("heure_fin").value=data.heure_fin;
|
$("heure_fin").value=data.heure_fin;
|
||||||
$("motif_reservation").value=data.motif_reservation;
|
$("motif_reservation").value=data.motif_reservation;
|
||||||
$("besoin_zoom").checked=data.besoin_zoom;
|
$("besoin_zoom").checked=data.besoin_zoom;
|
||||||
$("besoin_ordinateur").checked=data.besoin_ordi;
|
$("besoin_ordinateur").checked=data.besoin_ordi;
|
||||||
$("lien_zoom").value=data.lien_zoom;
|
$("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"));
|
const modal = new bootstrap.Modal($("modalDetailReservation"));
|
||||||
bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide();
|
bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide();
|
||||||
|
|||||||
Reference in New Issue
Block a user