Compare commits
8 Commits
e1436e8f4e
...
messege_et
| Author | SHA1 | Date | |
|---|---|---|---|
| c1dc44d223 | |||
| cea67c7057 | |||
| 741519c341 | |||
| 48f069506a | |||
| 3693ef29f9 | |||
| c28b14fb98 | |||
| 29a93e9bfe | |||
| a97c233ddb |
13
.gitignore
vendored
13
.gitignore
vendored
@@ -1,5 +1,10 @@
|
|||||||
db.sqlite3
|
# db.sqlite3
|
||||||
venv/*
|
# venv/*
|
||||||
media/*
|
# media/*
|
||||||
*.pyc
|
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
db.sqlite3
|
||||||
|
venv/
|
||||||
|
.env
|
||||||
39
Jenkinsfile
vendored
39
Jenkinsfile
vendored
@@ -1,39 +0,0 @@
|
|||||||
pipeline
|
|
||||||
{
|
|
||||||
agent any
|
|
||||||
|
|
||||||
environment
|
|
||||||
{
|
|
||||||
SUDO_PASSWORD = credentials('sudo-password')
|
|
||||||
}
|
|
||||||
|
|
||||||
stages
|
|
||||||
{
|
|
||||||
stage ( 'checkout' )
|
|
||||||
{
|
|
||||||
steps
|
|
||||||
{
|
|
||||||
sh 'echo "Debut du pipeline"'
|
|
||||||
checkout scm
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage ( 'Deploiement' )
|
|
||||||
{
|
|
||||||
when { branch 'main' }
|
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
cd /var/www/sirh
|
|
||||||
echo $SUDO_PASSWORD | sudo -S chown -R jenkins:jenkins /var/www/sirh
|
|
||||||
git pull origin main
|
|
||||||
python3 -m venv venv
|
|
||||||
. venv/bin/activate
|
|
||||||
pip install -r requirements.txt
|
|
||||||
python manage.py makemigrations
|
|
||||||
python manage.py migrate
|
|
||||||
echo $SUDO_PASSWORD | sudo -S chown -R ssylla:ssylla /var/www/sirh
|
|
||||||
echo "Deploiement reussi"
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -12,21 +12,21 @@ https://docs.djangoproject.com/en/5.2/ref/settings/
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from decouple import config
|
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = config('SECRET_KEY')
|
SECRET_KEY = 'django-insecure--wdb9t(77rvyac$_q!n5gw86&0r(0&&j171v9h!-_$jahsza*5'
|
||||||
|
|
||||||
# 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 = False
|
||||||
|
|
||||||
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]).split(',')
|
ALLOWED_HOSTS = ["https://support.cerfig.org", "support.cerfig.org"]
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
@@ -79,25 +79,24 @@ WSGI_APPLICATION = 'SIRH.wsgi.application'
|
|||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||||
|
|
||||||
|
# DATABASES = {
|
||||||
|
# 'default': {
|
||||||
|
# 'ENGINE': 'django.db.backends.mysql',
|
||||||
|
# 'NAME': 'sirh',
|
||||||
|
# 'USER': 'sirh',
|
||||||
|
# 'PASSWORD': 'sirh-cerfig',
|
||||||
|
# 'HOST': 'localhost',
|
||||||
|
# 'PORT': '3306',
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
|
||||||
if config('ENVIRONMENT') == 'local':
|
DATABASES = {
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
'NAME': os.path.join(BASE_DIR, 'db.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'),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
||||||
|
|||||||
@@ -2,6 +2,21 @@
|
|||||||
{% load tags_personnaliser %}
|
{% load tags_personnaliser %}
|
||||||
|
|
||||||
<div class="col-3 bg-danger d-flex flex-column vh-100 pt-5 sticky-top">
|
<div class="col-3 bg-danger d-flex flex-column vh-100 pt-5 sticky-top">
|
||||||
|
<div class="text-center mb-4">
|
||||||
|
{% if user.employe.photo %}
|
||||||
|
<img src="{{ user.employe.photo.url }}"
|
||||||
|
class="rounded-circle"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
style="object-fit:cover;">
|
||||||
|
{% else %}
|
||||||
|
<i class="bi bi-person-circle text-white" style="font-size:60px;"></i>
|
||||||
|
{% endif %}
|
||||||
|
<div class="text-white mt-2">
|
||||||
|
{{ user.username }}
|
||||||
|
</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.4em">
|
||||||
<i class="bi bi-person-circle"></i> Mon profil
|
<i class="bi bi-person-circle"></i> Mon profil
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
@@ -129,55 +129,58 @@ def demander_conge(request):
|
|||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def liste_demande_conges(request):
|
def liste_demande_conges(request):
|
||||||
"""Vue de liste des demandes de congés en attente de validation selon le statut de l'utilisateur actuel"""
|
|
||||||
try:
|
try:
|
||||||
employe = Employe.objects.get(user__username = request.user)
|
employe = Employe.objects.get(user=request.user)
|
||||||
except Employe.DoesNotExist:
|
except Employe.DoesNotExist:
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
"success": False,
|
"success": False,
|
||||||
"message": "Votre profil Utilisateur n'est lié à aucun profil Employé. Veuillez contacter l'administrateur."
|
"message": "Profil employé introuvable"
|
||||||
})
|
})
|
||||||
|
|
||||||
try:
|
affectation = Affectation.objects.filter(
|
||||||
affectation = Affectation.objects.get(
|
|
||||||
employe=employe,
|
employe=employe,
|
||||||
date_fin_daffectation__gte=timezone.now().date()
|
date_fin_daffectation__gte=timezone.now().date()
|
||||||
)
|
).first()
|
||||||
except Affectation.DoesNotExist:
|
|
||||||
affectation = None
|
is_direction = employe.user.groups.filter(name='direction').exists()
|
||||||
|
|
||||||
if employe.chef:
|
if employe.chef:
|
||||||
print("chef")
|
|
||||||
conges_en_attente = Conge.objects.filter(
|
conges = Conge.objects.filter(
|
||||||
employe__departement = employe.departement,
|
Q(employe__departement=employe.departement) |
|
||||||
validation_hierarchique = None
|
Q(employe=employe)
|
||||||
).order_by('-date_demande')
|
).order_by('-date_demande')
|
||||||
|
|
||||||
elif affectation and affectation.role == "chef_projet":
|
elif affectation and affectation.role == "chef_projet":
|
||||||
|
|
||||||
employes_du_projet = Affectation.objects.filter(
|
employes_du_projet = Affectation.objects.filter(
|
||||||
projet = affectation.projet,
|
projet=affectation.projet,
|
||||||
date_fin_daffectation__gte = timezone.now().date()
|
date_fin_daffectation__gte=timezone.now().date()
|
||||||
).values('employe')
|
).values_list('employe', flat=True)
|
||||||
|
|
||||||
conges_en_attente = Conge.objects.filter(
|
conges = Conge.objects.filter(
|
||||||
employe__in = employes_du_projet,
|
Q(employe__in=employes_du_projet) |
|
||||||
validation_hierarchique = None
|
Q(employe=employe)
|
||||||
).order_by('-date_demande')
|
).order_by('-date_demande')
|
||||||
|
|
||||||
elif 'direction' in employe.user.groups.values_list('name', flat=True):
|
|
||||||
conges_en_attente = Conge.objects.filter(
|
elif is_direction:
|
||||||
validation_hierarchique = True,
|
|
||||||
validation_direction = None
|
conges = Conge.objects.filter(
|
||||||
).order_by('-date_demande')
|
Q(validation_hierarchique=True) |
|
||||||
|
Q(employe__user__groups__name='direction')
|
||||||
|
).distinct().order_by('-date_demande')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
conges_en_attente = Conge.objects.filter(
|
|
||||||
employe__user__username = request.user
|
conges = Conge.objects.filter(
|
||||||
|
employe=employe
|
||||||
).order_by('-date_demande')
|
).order_by('-date_demande')
|
||||||
|
|
||||||
return JsonResponse({
|
return JsonResponse({
|
||||||
"success": True,
|
"success": True,
|
||||||
"data":[
|
"data": [
|
||||||
{
|
{
|
||||||
**model_to_dict(conge),
|
**model_to_dict(conge),
|
||||||
"prenom_nom": f"{conge.employe.user.first_name} {conge.employe.user.last_name}",
|
"prenom_nom": f"{conge.employe.user.first_name} {conge.employe.user.last_name}",
|
||||||
@@ -186,9 +189,9 @@ def liste_demande_conges(request):
|
|||||||
"type": dict(conge.TYPE_CHOICES).get(conge.type),
|
"type": dict(conge.TYPE_CHOICES).get(conge.type),
|
||||||
"solde_conge": fonctions_utilitaire.solde_conge(conge.employe)["quota_annuel"]
|
"solde_conge": fonctions_utilitaire.solde_conge(conge.employe)["quota_annuel"]
|
||||||
}
|
}
|
||||||
for conge in conges_en_attente]},
|
for conge in conges
|
||||||
safe=False
|
]
|
||||||
)
|
})
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def validation_de_conge(request):
|
def validation_de_conge(request):
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user