Compare commits
2 Commits
9fb079c9a7
...
feature/li
| Author | SHA1 | Date | |
|---|---|---|---|
| f45ff7793d | |||
|
|
0abbb26149 |
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.
@@ -9,7 +9,6 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", {
|
||||
{"title": "Projet", "field": "projet"},
|
||||
{"title": "Téléphone", "field": "telephone"},
|
||||
],
|
||||
// ajaxURL: url_liste_employe,
|
||||
pagination: true,
|
||||
paginationSize: 10,
|
||||
responsiveLayout : "hide"
|
||||
@@ -19,7 +18,6 @@ fetch(url_liste_employe)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success){
|
||||
console.log(data.data)
|
||||
tableau_liste_employe.setData(data.data);
|
||||
}else{
|
||||
alert(data.message);
|
||||
@@ -29,9 +27,9 @@ fetch(url_liste_employe)
|
||||
|
||||
tableau_liste_employe.on("rowClick", function (row, rowData) {
|
||||
const data = rowData.getData();
|
||||
console.log('Employé cliqué:', data);
|
||||
|
||||
document.getElementById('detail-id').value = data.id;
|
||||
document.querySelector("#modalContratsEmploye").dataset.employeId = data.id;
|
||||
document.getElementById('detail-matricule').value = data.matricule;
|
||||
document.getElementById('detail-employe').value = data.employe;
|
||||
document.getElementById('detail-fonction').value = data.fonction;
|
||||
@@ -215,17 +213,10 @@ $("enregistrerDetail").addEventListener("click", function() {
|
||||
const matricule = document.getElementById('detail-matricule').value;
|
||||
const departement = document.getElementById('detail-departement').value;
|
||||
|
||||
console.log('=== ENREGISTREMENT DÉTAILS ===');
|
||||
console.log('ID:', id_);
|
||||
console.log('Fonction:', fonction);
|
||||
console.log('Date embauche:', dateEmbauche);
|
||||
console.log('Matricule:', matricule);
|
||||
console.log('Département (valeur brute):', departement);
|
||||
console.log('Département (type):', typeof departement);
|
||||
console.log('Département est vide:', !departement);
|
||||
|
||||
const url_enregistrer_detail = $("modalDetailEmployeBody").dataset.url;
|
||||
const url_enregistrer_detail = document.getElementById("modalDetailEmployeBody").dataset.url;
|
||||
|
||||
console.log("Le lien de l'enregistrement :", document.getElementById("modalDetailEmployeBody").dataset)
|
||||
|
||||
const payload = {
|
||||
"id": id_,
|
||||
"fonction": fonction,
|
||||
@@ -234,9 +225,6 @@ $("enregistrerDetail").addEventListener("click", function() {
|
||||
"departement": departement
|
||||
};
|
||||
|
||||
console.log('Payload JSON:', payload);
|
||||
console.log('Payload stringifié:', JSON.stringify(payload));
|
||||
|
||||
fetch(url_enregistrer_detail, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -285,69 +273,84 @@ const listeContratExpirant = new Tabulator("#listeContratExpirant", {
|
||||
|
||||
let tabContrats = null;
|
||||
|
||||
document.getElementById("modalContratsEmploye")
|
||||
.addEventListener("show.bs.modal", function () {
|
||||
|
||||
const employeId = document.getElementById("detail-id").value;
|
||||
|
||||
console.log("Employe ID :", employeId);
|
||||
|
||||
$("boutonVoirContrats").addEventListener("click", function () {
|
||||
const employeId = $("detail-id").value;
|
||||
if (!employeId) {
|
||||
alert("Aucun employé sélectionné");
|
||||
$("nom-employe-contrat").textContent = "Aucun employé sélectionné.";
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(`/employé/employe/${employeId}/contrats/`)
|
||||
$("modalContratsEmploye").dataset.employeId = employeId;
|
||||
|
||||
const modalDetail = $("modalDetailEmploye");
|
||||
modalDetail.addEventListener(
|
||||
"hidden.bs.modal",
|
||||
() => bootstrap.Modal.getOrCreateInstance($("modalContratsEmploye")).show(),
|
||||
{once: true}
|
||||
);
|
||||
bootstrap.Modal.getOrCreateInstance(modalDetail).hide();
|
||||
});
|
||||
|
||||
$("modalContratsEmploye").addEventListener("shown.bs.modal", function () {
|
||||
const employeId = this.dataset.employeId;
|
||||
const urlTemplate = this.dataset.urlTemplate;
|
||||
const tableElement = $("table-contrats-tabulator");
|
||||
|
||||
if (tabContrats) {
|
||||
tabContrats.destroy();
|
||||
tabContrats = null;
|
||||
}
|
||||
|
||||
if (!employeId) {
|
||||
$("nom-employe-contrat").textContent = "Aucun employé sélectionné.";
|
||||
return;
|
||||
}
|
||||
|
||||
tableElement.replaceChildren();
|
||||
$("nom-employe-contrat").textContent = "Chargement...";
|
||||
const url = urlTemplate.replace("123456789", employeId);
|
||||
|
||||
fetch(url)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error("Erreur HTTP " + response.status);
|
||||
throw new Error(`Erreur HTTP ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
$("nom-employe-contrat").textContent = data.employe;
|
||||
|
||||
document.getElementById("nom-employe-contrat").innerText =
|
||||
data.employe;
|
||||
|
||||
if (tabContrats) {
|
||||
tabContrats.destroy();
|
||||
}
|
||||
|
||||
tabContrats = new Tabulator(
|
||||
"#table-contrats-tabulator",
|
||||
{
|
||||
data: data.contrats,
|
||||
layout: "fitColumns",
|
||||
placeholder: "Aucun contrat",
|
||||
|
||||
columns: [
|
||||
{ title: "Numéro", field: "numero_contrat" },
|
||||
{ title: "Type", field: "type_contrat" },
|
||||
{ title: "Date début", field: "date_debut" },
|
||||
{ title: "Date fin", field: "date_fin" },
|
||||
{ title: "Salaire", field: "salaire_mensuel" },
|
||||
{ title: "Statut", field: "statut" },
|
||||
|
||||
{
|
||||
title: "Contrat",
|
||||
field: "fichier",
|
||||
formatter: function(cell) {
|
||||
const url = cell.getValue();
|
||||
|
||||
if (!url) {
|
||||
return "<span class='text-danger'>Aucun fichier</span>";
|
||||
}
|
||||
|
||||
return `<a href="${url}" target="_blank" class="btn btn-sm btn-primary">
|
||||
<i class="bi bi-file-earmark-pdf"></i> Ouvrir
|
||||
</a>`;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
tabContrats = new Tabulator(tableElement, {
|
||||
data: data.contrats,
|
||||
layout: "fitColumns",
|
||||
pagination: true,
|
||||
paginationSize: 10,
|
||||
placeholder: "Aucun contrat",
|
||||
columns: [
|
||||
{title: "Numéro", field: "numero_contrat"},
|
||||
{title: "Type", field: "type_contrat"},
|
||||
{title: "Date début", field: "date_debut"},
|
||||
{title: "Date fin", field: "date_fin"},
|
||||
{title: "Salaire", field: "salaire_mensuel"},
|
||||
{title: "Statut", field: "statut"},
|
||||
{
|
||||
title: "Contrat",
|
||||
field: "fichier",
|
||||
formatter: "link",
|
||||
formatterParams: {target: "_blank"},
|
||||
},
|
||||
],
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Erreur :", error);
|
||||
console.error("Erreur lors du chargement des contrats :", error);
|
||||
$("nom-employe-contrat").textContent =
|
||||
"Impossible de charger les contrats.";
|
||||
tableElement.textContent =
|
||||
"Une erreur est survenue lors du chargement des contrats.";
|
||||
});
|
||||
});
|
||||
|
||||
$("modalContratsEmploye").addEventListener("hidden.bs.modal", function () {
|
||||
bootstrap.Modal.getOrCreateInstance($("modalDetailEmploye")).show();
|
||||
});
|
||||
|
||||
@@ -58,10 +58,11 @@
|
||||
{% block 'modal' %}
|
||||
{% include "gestion_employe/parts/modalDetailEmploye.html" %}
|
||||
{% include "gestion_employe/parts/modalCreationContrat.html" %}
|
||||
{% include "gestion_employe/parts/modalContratsEmploye.html" %}
|
||||
{% include "gestion_employe/parts/modalAffectationProjet.html" %}
|
||||
{% include "gestion_employe/parts/modalDocument.html" %}
|
||||
{% include "gestion_employe/parts/modalListeContratExpirants.html" %}
|
||||
{% endblock %}
|
||||
{% block 'js' %}
|
||||
<script type="text/javascript" src="{% static 'gestion_employe/js/index.js' %}"></script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -25,4 +25,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" id="modalContratsEmploye" tabindex="-1">
|
||||
<div class="modal fade" id="modalContratsEmploye" data-url-template="{% url 'gestion_employe:contrats-employe' 123456789 %}" tabindex="-1">
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content">
|
||||
|
||||
@@ -14,4 +14,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -54,4 +54,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body" id="modalDetailEmployeBody">
|
||||
<div class="modal-body" id="modalDetailEmployeBody" data-url="{% url 'gestion_employe:enregistrer-detail-employe' %}">
|
||||
<div class="row g-3">
|
||||
<input type="hidden" id="detail-id">
|
||||
<div class="col-md-6">
|
||||
@@ -97,11 +97,15 @@
|
||||
<i class="bi bi-file-earmark-text me-2"></i> Liste des Contrats
|
||||
</h5>
|
||||
{% if user|has_group:"ressource_humaine" %}
|
||||
<div>
|
||||
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#modalContrat{{ item.employe.id }}">
|
||||
<div class="d-flex gap-2">
|
||||
<button type="button" class="btn btn-outline-primary" id="boutonVoirContrats">
|
||||
<i class="bi bi-files"></i> Voir tous les contrats
|
||||
</button>
|
||||
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#modalContrat">
|
||||
<i class="bi bi-file-earmark-text"></i> Créer contrat
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
@@ -135,4 +139,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
@@ -90,5 +90,10 @@ urlpatterns = [
|
||||
"liste-contrat-expirants",
|
||||
views.liste_contrat_expirants,
|
||||
name='liste-contrat-expirants'
|
||||
)
|
||||
]
|
||||
),
|
||||
path(
|
||||
"liste-contrats-employe/<int:id_employe>/",
|
||||
views.liste_contrats_employe,
|
||||
name="liste-contrats-employe"
|
||||
)
|
||||
]
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import json
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import requests
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from decouple import config
|
||||
from django.contrib.auth import update_session_auth_hash
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.models import User
|
||||
@@ -300,6 +299,8 @@ def creation_contrat(request):
|
||||
|
||||
@login_required
|
||||
def contrats_employe(request, employe_id):
|
||||
if not request.user.groups.filter(name="ressource_humaine").exists():
|
||||
return JsonResponse({"error": "Accès non autorisé"}, status=403)
|
||||
|
||||
try:
|
||||
employe = Employe.objects.get(id=employe_id)
|
||||
@@ -353,9 +354,6 @@ def enregistrer_detail_employe(request):
|
||||
|
||||
# Traiter le département
|
||||
dept_value = data.get('departement')
|
||||
print(f"[DEBUG] Département brut: {dept_value!r}")
|
||||
print(f"[DEBUG] Type département: {type(dept_value).__name__}")
|
||||
print(f"[DEBUG] Est vide: {not dept_value}")
|
||||
|
||||
if dept_value and str(dept_value).strip():
|
||||
try:
|
||||
@@ -509,42 +507,55 @@ def supprimer_formation(request, id_formation):
|
||||
def modifier_mot_passe(request):
|
||||
"""Vue pour permettre à un employé de modifier son mot de passe"""
|
||||
if request.method == "POST":
|
||||
username = request.user.username
|
||||
ancien_mdp = request.POST.get("ancien-mdp")
|
||||
nouveau_mdp = request.POST.get("nouveau-mdp")
|
||||
confirmation_mdp = request.POST.get("confirmation-mdp")
|
||||
|
||||
if not request.user.check_password(ancien_mdp):
|
||||
messages.error(request, "L'ancien mot de passe est incorrect.")
|
||||
return redirect("gestion_employe:mon-profil")
|
||||
|
||||
if nouveau_mdp != confirmation_mdp:
|
||||
messages.error(request, "Les nouveaux mots de passe ne correspondent pas.")
|
||||
return redirect("gestion_employe:mon-profil")
|
||||
|
||||
try:
|
||||
validate_password(nouveau_mdp, user=request.user)
|
||||
except ValidationError as e:
|
||||
messages.error(request, f"Erreur : {' '.join(e.messages)}")
|
||||
return redirect("gestion_employe:mon-profil")
|
||||
|
||||
donnees = {
|
||||
"username": username,
|
||||
"ancien_mdp": ancien_mdp,
|
||||
"nouveau_mdp": nouveau_mdp,
|
||||
"confirmation_mdp": confirmation_mdp
|
||||
}
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Accept": "application/json",
|
||||
}
|
||||
|
||||
response = requests.post(
|
||||
f"{config('SERVEUR_AUTHENTIFICATION')}modifier-mot-de-passe/",
|
||||
json=donnees,
|
||||
headers=headers
|
||||
)
|
||||
|
||||
data = response.json()
|
||||
cle = next(iter(data.keys()))
|
||||
valeur = next(iter(data.values()))
|
||||
|
||||
if cle == "success":
|
||||
messages.success(request, valeur)
|
||||
else:
|
||||
messages.error(request, valeur)
|
||||
request.user.set_password(nouveau_mdp)
|
||||
request.user.save(update_fields=["password"])
|
||||
update_session_auth_hash(request, request.user)
|
||||
messages.success(request, "Mot de passe modifié avec succès.")
|
||||
|
||||
return redirect("gestion_employe:mon-profil")
|
||||
|
||||
def liste_contrats_employe(request, id_employe):
|
||||
"""Vue pour retourner la liste des contrats d'un employé spécifique"""
|
||||
try:
|
||||
employe = Employe.objects.get(id=id_employe)
|
||||
except Employe.DoesNotExist:
|
||||
return JsonResponse({"error": "Employé non trouvé"}, status=404)
|
||||
|
||||
contrats = Contrat.objects.filter(employe=employe).order_by("-date_debut")
|
||||
|
||||
data = [
|
||||
{
|
||||
"id": contrat.id,
|
||||
"numero_contrat": contrat.numero_contrat,
|
||||
"type_contrat": dict(Contrat.TYPE_CONTRAT).get(contrat.type_contrat),
|
||||
"date_debut": contrat.date_debut.strftime("%Y-%m-%d"),
|
||||
"date_fin": contrat.date_fin.strftime("%Y-%m-%d") if contrat.date_fin else "",
|
||||
"salaire_mensuel": contrat.salaire_mensuel,
|
||||
"statut": dict(Contrat.STATUT_CONTRAT).get(contrat.statut),
|
||||
"fichier_contrat": contrat.fichier_contrat.url if contrat.fichier_contrat else "",
|
||||
}
|
||||
for contrat in contrats
|
||||
]
|
||||
|
||||
return JsonResponse({
|
||||
"employe": f"{employe.user.first_name} {employe.user.last_name}",
|
||||
"contrats": data
|
||||
})
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,7 +22,6 @@ class ProjetForm(forms.ModelForm):
|
||||
'date_fin',
|
||||
'numero_convention',
|
||||
'domaine_recherche',
|
||||
'type_projet',
|
||||
'budget',
|
||||
'budget_RH',
|
||||
'description'
|
||||
@@ -37,7 +36,6 @@ class ProjetForm(forms.ModelForm):
|
||||
'nom_projet': forms.TextInput(attrs={'class': "form-control"}),
|
||||
'numero_convention': forms.TextInput(attrs={'class': "form-control"}),
|
||||
'domaine_recherche': forms.SelectMultiple(attrs={'class': "form-control"}),
|
||||
'type_projet': forms.Select(attrs={'class': "form-select"}),
|
||||
'budget': forms.NumberInput(attrs={'class': "form-control"}),
|
||||
'budget_RH': forms.NumberInput(attrs={'class': "form-control"}),
|
||||
'description': forms.Textarea(attrs={'class': "form-control"}),
|
||||
@@ -175,4 +173,4 @@ class LivrablesLivresForm(forms.ModelForm):
|
||||
'fichier': forms.ClearableFileInput(attrs={
|
||||
'class':'form-control',
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from datetime import datetime
|
||||
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
@@ -33,9 +31,11 @@ class DomaineDeRecherche(models.Model):
|
||||
|
||||
DOMAINE_RECHERCHE = (
|
||||
('sciences_sociales', 'Sciences sociales'),
|
||||
('naturelles', 'Naturelles'),
|
||||
('humaines', 'Humaines'),
|
||||
('veterinaires', 'Vétérinaires')
|
||||
('epidemiologie', 'Epidémiologie'),
|
||||
('sciences_biomedicales', 'Sciences biomédicales'),
|
||||
('service_pedagogique', 'Service Pédagogique'),
|
||||
('recherche_clinique', 'Recherche clinique')
|
||||
)
|
||||
|
||||
nom = models.CharField(
|
||||
@@ -54,13 +54,6 @@ class DomaineDeRecherche(models.Model):
|
||||
|
||||
class Projet(models.Model):
|
||||
"""Modèle représentant un projet de recherche avec ses caractéristiques et son bailleur associé."""
|
||||
TYPE_PROJET = (
|
||||
('laboratoire', 'Laboratoire'),
|
||||
('épidémiologie', 'Épidémiologie'),
|
||||
('sciences sociales', 'Sciences sociales'),
|
||||
('cliniques', 'Cliniques'),
|
||||
('autre', 'Autre'),
|
||||
)
|
||||
|
||||
id_projet = models.CharField(
|
||||
max_length=100,
|
||||
@@ -86,12 +79,6 @@ class Projet(models.Model):
|
||||
description = models.TextField(
|
||||
verbose_name="Description"
|
||||
)
|
||||
type_projet = models.CharField(
|
||||
max_length=100,
|
||||
choices=TYPE_PROJET,
|
||||
default='épidémiologie',
|
||||
verbose_name="Type de projet"
|
||||
)
|
||||
domaine_recherche = models.ManyToManyField(DomaineDeRecherche)
|
||||
budget=models.DecimalField(
|
||||
max_digits=12,
|
||||
@@ -114,13 +101,13 @@ class Projet(models.Model):
|
||||
|
||||
@property
|
||||
def statut(self):
|
||||
if self.date_fin < datetime.date.today():
|
||||
if self.date_fin < timezone.now().date():
|
||||
return "Terminé"
|
||||
return "En cours"
|
||||
|
||||
@property
|
||||
def avancement(self):
|
||||
aujourd_hui = datetime.date.today()
|
||||
aujourd_hui = timezone.now().date()
|
||||
if (self.date_debut and self.date_fin) and (self.date_debut < self.date_fin):
|
||||
duree_projet = (self.date_fin - self.date_debut).days
|
||||
temps_ecoule = (aujourd_hui - self.date_debut).days
|
||||
@@ -309,4 +296,4 @@ class LivrablesLivres(models.Model):
|
||||
null = True
|
||||
)
|
||||
def __str__(self):
|
||||
return self.nom
|
||||
return self.nom
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const $ = (element) => document.getElementById(element)
|
||||
const url_liste_projet = $("tableau-liste-projet").dataset.url;
|
||||
|
||||
const tableau_liste_projet = new Tabulator("#tableau-liste-projet", {
|
||||
fitColumns: true,
|
||||
responsiveLayout : true,
|
||||
@@ -39,7 +40,6 @@ tableau_liste_projet.on("rowClick", function (row, rowData) {
|
||||
$("detail_date_debut").value = data.date_debut;
|
||||
$("detail_date_fin").value = data.date_fin;
|
||||
$("detail_numero_convention").value = data.numero_convention;
|
||||
$("detail_type_projet").value = data.type_projet;
|
||||
Array.from($("detail_domaine_recherche").options).forEach(option => {
|
||||
if (data.domaine_recherche.includes(option.value)) {
|
||||
option.selected = true;
|
||||
@@ -61,4 +61,4 @@ tableau_liste_projet.on("rowClick", function (row, rowData) {
|
||||
// $('detail-projet-form').addEventListener('submit', (e) => {
|
||||
// e.preventDefault();
|
||||
// new FormData($("detail-projet-form"));
|
||||
// })
|
||||
// })
|
||||
|
||||
@@ -18,4 +18,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,23 +31,15 @@
|
||||
<label>Date de fin :</label>
|
||||
<input type="date" class="form-control" id="detail_date_fin" name='date_fin'>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label> Type de projet </label>
|
||||
<select class="form-select" id="detail_type_projet" name='type_projet'>
|
||||
<option value="laboratoire">Laboratoire</option>
|
||||
<option value="épidémiologie">Épidémiologie</option>
|
||||
<option value="sciences sociales">Sciences sociales</option>
|
||||
<option value="cliniques">Cliniques</option>
|
||||
<option value="autre">Autre</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
<label> Domaine de recherche </label>
|
||||
<select class="form-select" multiple id="detail_domaine_recherche" name="domaine_recherche">
|
||||
<option value="sciences_sociales">Sciences sociales</option>
|
||||
<option value="naturelles">Naturelles</option>
|
||||
<option value="humaines">Humaines</option>
|
||||
<option value="veterinaires">Vétérinaires</option>
|
||||
<option value="epidemiologie">Epidémiologie</option>
|
||||
<option value="sciences_biomedicales">Sciences biomédicales</option>
|
||||
<option value="service_pedagogique">Service Pédagogique</option>
|
||||
<option value="recherche_clinique">Recherche clinique</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group mb-2">
|
||||
@@ -112,4 +104,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,6 @@ def liste_projet(request):
|
||||
"date_fin": p.date_fin,
|
||||
"numero_convention": p.numero_convention,
|
||||
"description": p.description,
|
||||
"type_projet": p.type_projet,
|
||||
"budget": p.budget,
|
||||
"budget_RH": p.budget_RH,
|
||||
"created_at": p.created_at,
|
||||
@@ -502,4 +501,4 @@ def annuler_activite_projet(request):
|
||||
activite.motif_annulation = request.POST.get("motif_annulation", "").strip()
|
||||
activite.save()
|
||||
messages.success(request, f"L'activité '{activite.titre}' a été annulée avec succès.")
|
||||
return redirect('gestion_projet:activites-projet')
|
||||
return redirect('gestion_projet:activites-projet')
|
||||
|
||||
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.
6
staticfiles/bootstrap.min.css
vendored
6
staticfiles/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
@@ -1,6 +0,0 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class GestionCongeConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'gestion_conge'
|
||||
@@ -3,23 +3,6 @@ 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", {
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
// layout : "fitColumns",
|
||||
=======
|
||||
layout : "fitColumns",
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
layout : "fitColumns",
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
layout : "fitColumns",
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
// layout : "fitColumns",
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
columns: [
|
||||
{"title": "Nom et Prénom", "field": "prenom_nom"},
|
||||
{"title": "Date de début", "field": "date_debut", formatter:"datetime", formatterParams:{
|
||||
@@ -31,23 +14,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
||||
outputFormat:"dd/MM/yy",
|
||||
}},
|
||||
{"title": "Type de congé", "field": "type"},
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
{"title": "Date de la demande", "field": "date_demande", responsive: 1},
|
||||
=======
|
||||
{"title": "Date de la demande", "field": "date_demande"},
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
{"title": "Date de la demande", "field": "date_demande"},
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
{"title": "Date de la demande", "field": "date_demande"},
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
{"title": "Date de la demande", "field": "date_demande", responsive: 1},
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
{"title": "Validation par supérieur hiérarchique", "field": "validation_hierarchique", formatter:"tickCross", formatterParams :{
|
||||
allowEmpty : true ,
|
||||
}},
|
||||
@@ -56,23 +23,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
||||
}},
|
||||
],
|
||||
pagination: true,
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
paginationSize: 5,
|
||||
=======
|
||||
paginationSize: 5
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
paginationSize: 5
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
paginationSize: 5
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
paginationSize: 5,
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
})
|
||||
|
||||
const bouton_demande_conges = $("bouton-demande-conge");
|
||||
|
||||
@@ -9,30 +9,15 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", {
|
||||
{"title": "Projet", "field": "projet"},
|
||||
{"title": "Téléphone", "field": "telephone"},
|
||||
],
|
||||
// ajaxURL: url_liste_employe,
|
||||
pagination: true,
|
||||
paginationSize: 10,
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
responsiveLayout : "hide"
|
||||
=======
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
responsiveLayout : "hide"
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
})
|
||||
|
||||
fetch(url_liste_employe)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success){
|
||||
console.log(data.data)
|
||||
tableau_liste_employe.setData(data.data);
|
||||
}else{
|
||||
alert(data.message);
|
||||
@@ -42,6 +27,7 @@ fetch(url_liste_employe)
|
||||
|
||||
tableau_liste_employe.on("rowClick", function (row, rowData) {
|
||||
const data = rowData.getData();
|
||||
|
||||
document.getElementById('detail-id').value = data.id;
|
||||
document.getElementById('detail-matricule').value = data.matricule;
|
||||
document.getElementById('detail-employe').value = data.employe;
|
||||
@@ -224,23 +210,31 @@ $("enregistrerDetail").addEventListener("click", function() {
|
||||
const fonction = document.getElementById('detail-fonction').value;
|
||||
const dateEmbauche = document.getElementById('detail-dateEmbauche').value;
|
||||
const matricule = document.getElementById('detail-matricule').value;
|
||||
const departement = document.getElementById('detail-departement').value;
|
||||
|
||||
const url_enregistrer_detail = $("modalDetailEmployeBody").dataset.url;
|
||||
const url_enregistrer_detail = document.getElementById("modalDetailEmployeBody").dataset.url;
|
||||
|
||||
console.log("Le lien de l'enregistrement :", document.getElementById("modalDetailEmployeBody").dataset)
|
||||
|
||||
const payload = {
|
||||
"id": id_,
|
||||
"fonction": fonction,
|
||||
"date_embauche": dateEmbauche,
|
||||
"matricule": matricule,
|
||||
"departement": departement
|
||||
};
|
||||
|
||||
fetch(url_enregistrer_detail, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-CSRFToken": document.querySelector('[name=csrfmiddlewaretoken]').value
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"id": id_,
|
||||
"fonction": fonction,
|
||||
"date_embauche": dateEmbauche,
|
||||
"matricule": matricule
|
||||
})
|
||||
body: JSON.stringify(payload)
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
console.log('Réponse du serveur:', data);
|
||||
alert(data.message);
|
||||
location.reload();
|
||||
})
|
||||
@@ -274,4 +268,70 @@ const listeContratExpirant = new Tabulator("#listeContratExpirant", {
|
||||
},
|
||||
],
|
||||
ajaxURL: $("boutonContratExpirants").dataset.urlexpirants,
|
||||
})
|
||||
})
|
||||
|
||||
/* let tabContrats = null;
|
||||
|
||||
document.getElementById("modalContratsEmploye").addEventListener("show.bs.modal", function () {
|
||||
|
||||
const employeId = document.getElementById("detail-id").value;
|
||||
|
||||
if (!employeId) {
|
||||
alert("Aucun employé sélectionné");
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(`/employé/employe/${employeId}/contrats/`)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error("Erreur HTTP " + response.status);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
|
||||
document.getElementById("nom-employe-contrat").innerText =
|
||||
data.employe;
|
||||
|
||||
if (tabContrats) {
|
||||
tabContrats.destroy();
|
||||
}
|
||||
|
||||
tabContrats = new Tabulator(
|
||||
"#table-contrats-tabulator",
|
||||
{
|
||||
data: data.contrats,
|
||||
layout: "fitColumns",
|
||||
placeholder: "Aucun contrat",
|
||||
|
||||
columns: [
|
||||
{ title: "Numéro", field: "numero_contrat" },
|
||||
{ title: "Type", field: "type_contrat" },
|
||||
{ title: "Date début", field: "date_debut" },
|
||||
{ title: "Date fin", field: "date_fin" },
|
||||
{ title: "Salaire", field: "salaire_mensuel" },
|
||||
{ title: "Statut", field: "statut" },
|
||||
|
||||
{
|
||||
title: "Contrat",
|
||||
field: "fichier",
|
||||
formatter: function(cell) {
|
||||
const url = cell.getValue();
|
||||
|
||||
if (!url) {
|
||||
return "<span class='text-danger'>Aucun fichier</span>";
|
||||
}
|
||||
|
||||
return `<a href="${url}" target="_blank" class="btn btn-sm btn-primary">
|
||||
<i class="bi bi-file-earmark-pdf"></i> Ouvrir
|
||||
</a>`;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Erreur :", error);
|
||||
});
|
||||
}); */
|
||||
|
||||
@@ -13,22 +13,20 @@ const tableau_certificat = new Tabulator("#tableau-certificat", {
|
||||
inputFormat:"yyyy-MM-dd",
|
||||
outputFormat:"dd/MM/yy",
|
||||
}},
|
||||
{"title": "Fichier", "field": "certificat", formatter:"link", formatterParams:{
|
||||
label:"Voir le fichier",
|
||||
target:"_blank",
|
||||
}},
|
||||
],
|
||||
ajaxURL: url_certificat,
|
||||
})
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
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);
|
||||
@@ -36,6 +34,10 @@ 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",
|
||||
@@ -47,53 +49,4 @@ enregistrerProfil.addEventListener("click", (e) => {
|
||||
.then(response => response.json())
|
||||
.then(data => alert(data.message))
|
||||
.catch(error => console.error("Erreur:", error));
|
||||
});
|
||||
=======
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
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",
|
||||
headers: {
|
||||
"X-CSRFToken": csrftoken
|
||||
},
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => alert(data.message))
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
})
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
})
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
})
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
.catch(error => console.error("Erreur:", error));
|
||||
});
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
});
|
||||
@@ -1,18 +1,5 @@
|
||||
const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur');
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
let table;
|
||||
=======
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
let table;
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
|
||||
btnEnregistrerBailleur.addEventListener('click', function() {
|
||||
const form = document.getElementById('formBailleur');
|
||||
@@ -34,49 +21,27 @@ btnEnregistrerBailleur.addEventListener('click', function() {
|
||||
alert('Ce bailleur existe déjà dans la base de données.');
|
||||
}
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
table = new Tabulator("#table-bailleurs", {
|
||||
ajaxURL: "/gestion-projet/bailleurs/",
|
||||
layout: "fitColumns",
|
||||
pagination: "local",
|
||||
paginationSize: 5,
|
||||
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();
|
||||
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);
|
||||
}
|
||||
if (confirm(`Voulez-vous vraiment supprimer ${data.nom_organisme} ?`)) {
|
||||
supprimerBailleur(data.id);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
});
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
});
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
});
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const $ = (element) => document.getElementById(element)
|
||||
const url_liste_projet = $("tableau-liste-projet").dataset.url;
|
||||
|
||||
const tableau_liste_projet = new Tabulator("#tableau-liste-projet", {
|
||||
fitColumns: true,
|
||||
responsiveLayout : true,
|
||||
@@ -39,7 +40,6 @@ tableau_liste_projet.on("rowClick", function (row, rowData) {
|
||||
$("detail_date_debut").value = data.date_debut;
|
||||
$("detail_date_fin").value = data.date_fin;
|
||||
$("detail_numero_convention").value = data.numero_convention;
|
||||
$("detail_type_projet").value = data.type_projet;
|
||||
Array.from($("detail_domaine_recherche").options).forEach(option => {
|
||||
if (data.domaine_recherche.includes(option.value)) {
|
||||
option.selected = true;
|
||||
@@ -61,4 +61,4 @@ tableau_liste_projet.on("rowClick", function (row, rowData) {
|
||||
// $('detail-projet-form').addEventListener('submit', (e) => {
|
||||
// e.preventDefault();
|
||||
// new FormData($("detail-projet-form"));
|
||||
// })
|
||||
// })
|
||||
|
||||
@@ -12,24 +12,14 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
||||
const modal = new bootstrap.Modal($("modalDetailReservation"));
|
||||
modal.show();
|
||||
fetch (`/gestion-salle/revervation/details/${event.guid}`)
|
||||
.then(response => response.json())
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`Erreur HTTP ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
currentReservationId = data.id_reservation;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
console.log(data);
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
console.log(data);
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
console.log(data);
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
$("id_reservation_detail").value = data.id_reservation;
|
||||
$("id_reservation_refus").value = data.id_reservation;
|
||||
$("id_reservation_zoom").value = data.id_reservation;
|
||||
@@ -42,40 +32,20 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
||||
$("motif_reservation").value=data.motif_reservation;
|
||||
$("besoin_zoom").checked=data.besoin_zoom;
|
||||
$("besoin_ordinateur").checked=data.besoin_ordinateur;
|
||||
$("lien_zoom").value=data.lien_zoom;
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$("lien_zoom").value=data.lien_zoom;
|
||||
|
||||
const zoomContainer = $("lien_zoom_container");
|
||||
if (!data.besoin_zoom) {
|
||||
zoomContainer.classList.add("d-none");
|
||||
} else {
|
||||
zoomContainer.classList.remove("d-none");
|
||||
}
|
||||
if (data.besoin_zoom === false){
|
||||
$("lien_zoom_container").className = "d-none";
|
||||
}
|
||||
|
||||
=======
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
if(data.statut !== "annulee"){
|
||||
$("motif_refus_container").className = "d-none";
|
||||
}else{
|
||||
$("motif_refus").value=data.motif_refus;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
if (data.besoin_zoom === false){
|
||||
$("lien_zoom_container").className = "d-none";
|
||||
}
|
||||
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
})
|
||||
.catch(error => console.error("Impossible de charger les détails de la réservation :", error));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -117,29 +87,13 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||
})
|
||||
|
||||
$("bouton-annuler").addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const csrf = document.querySelector("[name=csrfmiddlewaretoken]").value;
|
||||
const url_annuler = $("formulaire-details").dataset.urlannuler;
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
console.log("URL d'annulation :");
|
||||
console.log($("formulaire-details"))
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
fetch(
|
||||
url_annuler,
|
||||
{
|
||||
@@ -186,28 +140,15 @@ if($("ajoutZoom")){
|
||||
|
||||
if($("refuserReservation")){
|
||||
$("refuserReservation").addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const csrf = document.querySelector("[name=csrfmiddlewaretoken]").value;
|
||||
const url = e.currentTarget.dataset.lienrefus;
|
||||
const idRes = $("id_reservation_detail").value;
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
console.log(idRes);
|
||||
e.preventDefault();
|
||||
|
||||
=======
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
console.log(idRes);
|
||||
e.preventDefault();
|
||||
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -227,7 +168,7 @@ const tableau_reservation_attente = new Tabulator("#tableau-reservation-attente"
|
||||
columns: [
|
||||
{title: "Employé", field: "employe"},
|
||||
{title: "Salle", field: "salle"},
|
||||
{title: "Date de l'evenement", field: "date_debut"},
|
||||
{title: "Date de l'evenement", field: "date_evenement"},
|
||||
{title: "Heure de début", field: "heure_debut"},
|
||||
{title: "Heure de fin", field: "heure_fin"},
|
||||
{title: "Motif de reservation", field: "motif_reservation"},
|
||||
@@ -239,52 +180,14 @@ const tableau_reservation_attente = new Tabulator("#tableau-reservation-attente"
|
||||
tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
||||
const data = rowData.getData();
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
console.log(data);
|
||||
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
console.log(data);
|
||||
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
console.log(data);
|
||||
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
if(data.besoin_zoom === false){
|
||||
$("lien_zoom_container").className = 'd-none';
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
const id_user = $("current-user-id").dataset.userid;
|
||||
=======
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
if(data.statut !== "refusee"){
|
||||
$("motif_refus_container").className = 'd-none';
|
||||
}
|
||||
const id_user = $("current-user-id").dataset.userId;
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
const id_user = $("current-user-id").dataset.userid;
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
$("id_reservation_detail").value = data.id;
|
||||
$("id_reservation_refus").value = data.id;
|
||||
$("id_reservation_zoom").value = data.id;
|
||||
@@ -292,53 +195,25 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
||||
$("employe").value=data.employe;
|
||||
$("salle").value=data.salle;
|
||||
$("statut-reservation").innerHTML=data.statut;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$("date_debut").value = data.date_debut;
|
||||
$("date_fin").value = data.date_fin;
|
||||
=======
|
||||
$("date_evenement").value=data.date_debut;
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
$("date_evenement").value=data.date_debut;
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
$("date_evenement").value=data.date_debut;
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
$("date_debut").value = data.date_debut;
|
||||
$("date_fin").value = data.date_fin;
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
$("date_evenement").value = data.date_evenement;
|
||||
$("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;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
|
||||
const refuserReservation = document.querySelector("#refuserReservation");
|
||||
const bouton_valider = document.querySelector("#bouton-valider");
|
||||
|
||||
if((refuserReservation | bouton_valider) && data.statut === "En attente"){
|
||||
refuserReservation.style.display = "inline-block";
|
||||
bouton_valider.style.display = "inline-block";
|
||||
}
|
||||
|
||||
if (id_user != data.employe_id){
|
||||
$("bouton-annuler").className = "d-none";
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
$("motif_refus").value=data.motif_refus;
|
||||
>>>>>>> 0047b1f (Ajout de la prise en charge des photos de profil)
|
||||
=======
|
||||
$("motif_refus").value=data.motif_refus;
|
||||
>>>>>>> f6b90e7 (Verification du statut avant la creation d'un contrat)
|
||||
=======
|
||||
$("motif_refus").value=data.motif_refus;
|
||||
>>>>>>> 6026af5 (Bug : Affichages des conges)
|
||||
=======
|
||||
>>>>>>> 3b587d2a1a4376551b4b694a38e0e24a1c4cf4c5
|
||||
|
||||
const modal = new bootstrap.Modal($("modalDetailReservation"));
|
||||
bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,278 +0,0 @@
|
||||
/* === Print === */
|
||||
@media print {
|
||||
nav, .btn, .sidebar, .form-select, .form-control {
|
||||
display: none !important;
|
||||
}
|
||||
body {
|
||||
font-size: 12pt;
|
||||
color: black;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 768px) {
|
||||
main {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* === Body & Container === */
|
||||
body {
|
||||
background-color: #e4dccc;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.dashboard-container {
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.05);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
margin: 30px auto;
|
||||
max-width: 1200px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
width: 220px;
|
||||
}
|
||||
main {
|
||||
margin-left: 220px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* === Sidebar === */
|
||||
.sidebar {
|
||||
background: linear-gradient(180deg, #b35400, #993d00); /* dégradé orange foncé */
|
||||
color: white;
|
||||
min-height: 100vh; /* prend toute la hauteur */
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
overflow-y: auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.sidebar .nav-link {
|
||||
color: white;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.sidebar .nav-link:hover {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 5px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.sidebar .dropdown-menu {
|
||||
display: none;
|
||||
position: relative;
|
||||
left: 10px;
|
||||
top: -5px;
|
||||
border: none;
|
||||
padding-left: 1rem;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.sidebar .dropdown:hover .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.sidebar a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.sidebar a:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* === Navbar / Logo / Profil === */
|
||||
.logo {
|
||||
max-width: 80px;
|
||||
}
|
||||
|
||||
.img-profil {
|
||||
width: 80px !important;
|
||||
height: 80px !important;
|
||||
object-fit: cover;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* === Cards === */
|
||||
.card {
|
||||
border: 1px solid #dee2e6;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
||||
border-radius: 8px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
background-color: #f8f9fa;
|
||||
font-weight: bold !important;
|
||||
color: black !important;
|
||||
font-size: 1rem;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.card-body h5 {
|
||||
color: black !important;
|
||||
font-weight: bold;
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
|
||||
/* === Stat cards === */
|
||||
.stat-card {
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 5px rgba(113, 11, 11, 0.1);
|
||||
}
|
||||
|
||||
/* === Employé / Projet details === */
|
||||
.employe-detail {
|
||||
background-color: #f9f9f9;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.employe-detail .card-title {
|
||||
font-size: 1.8rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.employe-detail p {
|
||||
margin-bottom: 0.4rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.employe-detail a.btn {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.employe-card, .projet-card {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
padding: 2.5rem;
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* === Forms === */
|
||||
.form-wrapper {
|
||||
max-width: 1000px;
|
||||
margin: auto;
|
||||
background-color: rgba(255, 255, 255, 0.95);
|
||||
}
|
||||
|
||||
form label {
|
||||
font-weight: 600;
|
||||
margin-top: 1rem;
|
||||
display: block;
|
||||
}
|
||||
|
||||
form input, form select, form textarea {
|
||||
width: 100%;
|
||||
padding: 0.5rem;
|
||||
margin-top: 0.3rem;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
/* === Formation badges === */
|
||||
.formation-badge {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.formation-actions {
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
right: -5px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.formation-badge:hover .formation-actions {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.formation-actions button {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #fff;
|
||||
margin-left: 5px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
/* === Context menu === */
|
||||
#contextMenu {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
/* === Transitions / Animations === */
|
||||
.fade-out {
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s ease;
|
||||
}
|
||||
|
||||
#main-content {
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
|
||||
.login-box {
|
||||
background: linear-gradient(to right, #f5f7fa, #c3cfe2);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.3);
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
/* === Responsive === */
|
||||
@media (max-width: 576px) {
|
||||
.modal-dialog {
|
||||
max-width: 100%;
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
height: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.modal-footer button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.img-profil {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 100%;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
.sidebar .nav-link {
|
||||
font-size: 0.9rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user