Premiere implementation de sso
All checks were successful
Organisation/sirh/pipeline/head This commit looks good
All checks were successful
Organisation/sirh/pipeline/head This commit looks good
This commit is contained in:
@@ -3,7 +3,7 @@ const $ = (element) => document.getElementById(element);
|
||||
const url_liste_conge_attente = $("liste-demande-conges").dataset.url
|
||||
|
||||
const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
||||
layout : "fitColumns",
|
||||
// layout : "fitColumns",
|
||||
columns: [
|
||||
{"title": "Nom et Prénom", "field": "prenom_nom"},
|
||||
{"title": "Date de début", "field": "date_debut", formatter:"datetime", formatterParams:{
|
||||
@@ -15,7 +15,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
||||
outputFormat:"dd/MM/yy",
|
||||
}},
|
||||
{"title": "Type de congé", "field": "type"},
|
||||
{"title": "Date de la demande", "field": "date_demande"},
|
||||
{"title": "Date de la demande", "field": "date_demande", responsive: 1},
|
||||
{"title": "Validation par supérieur hiérarchique", "field": "validation_hierarchique", formatter:"tickCross", formatterParams :{
|
||||
allowEmpty : true ,
|
||||
}},
|
||||
@@ -24,7 +24,7 @@ const tableau_liste_demande_conge = new Tabulator("#liste-demande-conges", {
|
||||
}},
|
||||
],
|
||||
pagination: true,
|
||||
paginationSize: 5
|
||||
paginationSize: 5,
|
||||
})
|
||||
|
||||
const bouton_demande_conges = $("bouton-demande-conge");
|
||||
|
||||
@@ -12,6 +12,7 @@ const tableau_liste_employe = new Tabulator("#tableau_liste_employe", {
|
||||
// ajaxURL: url_liste_employe,
|
||||
pagination: true,
|
||||
paginationSize: 10,
|
||||
responsiveLayout : "hide"
|
||||
})
|
||||
|
||||
fetch(url_liste_employe)
|
||||
|
||||
@@ -16,27 +16,31 @@ const tableau_certificat = new Tabulator("#tableau-certificat", {
|
||||
],
|
||||
ajaxURL: url_certificat,
|
||||
})
|
||||
|
||||
const enregistrerProfil = $("enregistrerProfil");
|
||||
|
||||
enregistrerProfil.addEventListener("click", (e) => {
|
||||
|
||||
const url = $("information-personnelles").dataset.url;
|
||||
const csrftoken = document.querySelector("[name='csrfmiddlewaretoken']").value;
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
formData.append("nom", $("nom").value);
|
||||
formData.append("prenom", $("prenom").value);
|
||||
formData.append("email", $("email").value);
|
||||
formData.append("telephone", $("telephone").value);
|
||||
formData.append("adresse", $("adresse").value);
|
||||
formData.append("sexe", $("sexe").value);
|
||||
formData.append("date_naissance", $("date_naissance").value);
|
||||
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRFToken': csrftoken
|
||||
"X-CSRFToken": csrftoken
|
||||
},
|
||||
body: JSON.stringify({
|
||||
"nom": $("nom").value,
|
||||
"prenom": $("prenom").value,
|
||||
"email": $("email").value,
|
||||
"telephone": $("telephone").value,
|
||||
"adresse": $("adresse").value,
|
||||
"sexe": $("sexe").value,
|
||||
"date_naissance": $("date_naissance").value,
|
||||
})
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => alert(data.message))
|
||||
})
|
||||
.catch(error => console.error("Erreur:", error));
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
const btnEnregistrerBailleur = document.getElementById('btnEnregistrerBailleur');
|
||||
let table;
|
||||
|
||||
btnEnregistrerBailleur.addEventListener('click', function() {
|
||||
const form = document.getElementById('formBailleur');
|
||||
@@ -20,4 +21,31 @@ btnEnregistrerBailleur.addEventListener('click', function() {
|
||||
alert('Ce bailleur existe déjà dans la base de données.');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
table = new Tabulator("#table-bailleurs", {
|
||||
ajaxURL: "/gestion-projet/bailleurs/",
|
||||
layout: "fitColumns",
|
||||
pagination: "local",
|
||||
paginationSize: 5,
|
||||
|
||||
columns: [
|
||||
{title: "#", formatter: "rownum", width: 60},
|
||||
{title: "Organisme", field: "nom_organisme"},
|
||||
{title: "Contact", field: "contact"},
|
||||
{title: "Email", field: "email"},
|
||||
{title: "Pays", field: "pays"},
|
||||
],
|
||||
rowDblClick: function(e, row) {
|
||||
const data = row.getData();
|
||||
|
||||
if (confirm(`Voulez-vous vraiment supprimer ${data.nom_organisme} ?`)) {
|
||||
supprimerBailleur(data.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
currentReservationId = data.id_reservation;
|
||||
console.log(data);
|
||||
$("id_reservation_detail").value = data.id_reservation;
|
||||
$("id_reservation_refus").value = data.id_reservation;
|
||||
$("id_reservation_zoom").value = data.id_reservation;
|
||||
@@ -30,11 +29,10 @@ const calendrier = Schedule(document.getElementById('planning-reservation'), {
|
||||
$("besoin_ordinateur").checked=data.besoin_ordinateur;
|
||||
$("lien_zoom").value=data.lien_zoom;
|
||||
|
||||
if(data.statut !== "annulee"){
|
||||
$("motif_refus_container").className = "d-none";
|
||||
}else{
|
||||
$("motif_refus").value=data.motif_refus;
|
||||
if (data.besoin_zoom === false){
|
||||
$("lien_zoom_container").className = "d-none";
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
});
|
||||
@@ -80,6 +78,11 @@ $("bouton-annuler").addEventListener("click", (e) => {
|
||||
const csrf = document.querySelector("[name=csrfmiddlewaretoken]").value;
|
||||
const url_annuler = $("formulaire-details").dataset.urlannuler;
|
||||
|
||||
console.log("URL d'annulation :");
|
||||
console.log($("formulaire-details"))
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
fetch(
|
||||
url_annuler,
|
||||
{
|
||||
@@ -130,6 +133,9 @@ if($("refuserReservation")){
|
||||
const url = e.currentTarget.dataset.lienrefus;
|
||||
const idRes = $("id_reservation_detail").value;
|
||||
|
||||
console.log(idRes);
|
||||
e.preventDefault();
|
||||
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -161,16 +167,11 @@ const tableau_reservation_attente = new Tabulator("#tableau-reservation-attente"
|
||||
tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
||||
const data = rowData.getData();
|
||||
|
||||
console.log(data);
|
||||
|
||||
if(data.besoin_zoom === false){
|
||||
$("lien_zoom_container").className = 'd-none';
|
||||
}
|
||||
|
||||
if(data.statut !== "refusee"){
|
||||
$("motif_refus_container").className = 'd-none';
|
||||
}
|
||||
|
||||
const id_user = $("current-user-id").dataset.userid;
|
||||
$("id_reservation_detail").value = data.id;
|
||||
$("id_reservation_refus").value = data.id;
|
||||
$("id_reservation_zoom").value = data.id;
|
||||
@@ -178,16 +179,20 @@ tableau_reservation_attente.on("rowClick", (row, rowData) => {
|
||||
$("employe").value=data.employe;
|
||||
$("salle").value=data.salle;
|
||||
$("statut-reservation").innerHTML=data.statut;
|
||||
$("date_evenement").value=data.date_debut;
|
||||
$("date_debut").value = data.date_debut;
|
||||
$("date_fin").value = data.date_fin;
|
||||
$("heure_debut").value=data.heure_debut;
|
||||
$("heure_fin").value=data.heure_fin;
|
||||
$("motif_reservation").value=data.motif_reservation;
|
||||
$("besoin_zoom").checked=data.besoin_zoom;
|
||||
$("besoin_ordinateur").checked=data.besoin_ordi;
|
||||
$("lien_zoom").value=data.lien_zoom;
|
||||
$("motif_refus").value=data.motif_refus;
|
||||
|
||||
if (id_user != data.employe_id){
|
||||
$("bouton-annuler").className = "d-none";
|
||||
}
|
||||
|
||||
const modal = new bootstrap.Modal($("modalDetailReservation"));
|
||||
bootstrap.Modal.getOrCreateInstance($("modalReservationAttente")).hide();
|
||||
modal.show();
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user