forked from FroSteel/Planification
Compare commits
3 Commits
v2026.5.25
...
v2026.5.28
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a9e465116 | |||
| 0511c18b07 | |||
| df623da8f4 |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Planification",
|
"name": "Planification",
|
||||||
"version": "2026.5.25",
|
"version": "2026.5.28",
|
||||||
"description": "Vue claire et rapide du planning des techniciens EasyVista. Regroupe interventions et réservations par tech, affiche horaires, contact, lieu, catégorie et statut en un coup d'œil.",
|
"description": "Vue claire et rapide du planning des techniciens EasyVista. Regroupe interventions et réservations par tech, affiche horaires, contact, lieu, catégorie et statut en un coup d'œil.",
|
||||||
"browser_specific_settings": {
|
"browser_specific_settings": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
|
|||||||
+20
-11
@@ -2009,18 +2009,18 @@ body.modal-open {
|
|||||||
/* ─────────────────────────────────────────────────────────────────────────
|
/* ─────────────────────────────────────────────────────────────────────────
|
||||||
v5.0.0 : horloge au milieu de la topbar (HH:MM, pas de secondes)
|
v5.0.0 : horloge au milieu de la topbar (HH:MM, pas de secondes)
|
||||||
───────────────────────────────────────────────────────────────────────── */
|
───────────────────────────────────────────────────────────────────────── */
|
||||||
/* v2026.5.16 : app-clock contient maintenant 2 lignes empilées :
|
/* v2026.5.27 : app-clock sur UNE seule ligne : "Jeudi 23.04.26 • 21:55"
|
||||||
- app-clock-date : "Mardi 21 avril 2026" (petit)
|
Même taille pour la date et l'heure, gros point au milieu. */
|
||||||
- app-clock-time : "12:34" (grand) */
|
|
||||||
.app-clock {
|
.app-clock {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
@@ -2028,11 +2028,19 @@ body.modal-open {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.app-clock-date {
|
.app-clock-date {
|
||||||
font-size: 12px;
|
font-size: 22px;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
.app-clock-date::after {
|
||||||
|
content: "•";
|
||||||
|
margin-left: 12px;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
letter-spacing: 0.3px;
|
font-size: 26px;
|
||||||
text-transform: capitalize;
|
line-height: 0.8;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.app-clock-time {
|
.app-clock-time {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
@@ -2504,11 +2512,12 @@ header.topbar::before {
|
|||||||
|
|
||||||
/* Breakpoint medium : entre 1000 et 1300px, on compacte un peu */
|
/* Breakpoint medium : entre 1000 et 1300px, on compacte un peu */
|
||||||
@media (max-width: 1300px) {
|
@media (max-width: 1300px) {
|
||||||
.app-clock-date { font-size: 11px; }
|
.app-clock-date { font-size: 18px; }
|
||||||
.app-clock-time { font-size: 20px; }
|
.app-clock-time { font-size: 18px; }
|
||||||
|
.app-clock-date::after { font-size: 20px; }
|
||||||
.topbar-right .btn-action .btn-action-label,
|
.topbar-right .btn-action .btn-action-label,
|
||||||
.topbar-right .btn-refresh .btn-refresh-label {
|
.topbar-right .btn-refresh .btn-refresh-label {
|
||||||
font-size: 12px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -9,8 +9,13 @@
|
|||||||
<header class="topbar">
|
<header class="topbar">
|
||||||
<div class="topbar-left">
|
<div class="topbar-left">
|
||||||
<!-- v4.2.3 : pastille avec initiales de l'utilisateur connecté, avant
|
<!-- v4.2.3 : pastille avec initiales de l'utilisateur connecté, avant
|
||||||
le titre. Clic → popup fixe avec nom complet juste en dessous. -->
|
le titre. Clic → popup fixe avec nom complet juste en dessous.
|
||||||
<button id="user-badge" class="user-badge hidden"
|
v2026.5.34 : TOUJOURS visible d'office avec "?" (état user inconnu)
|
||||||
|
pour garantir l'accès au menu (⊞ Vue / ⚙ Paramètres) même si
|
||||||
|
la détection user échoue ou est en retard.
|
||||||
|
Le script JS mettra à jour le textContent + classes quand le
|
||||||
|
fetch aboutit. En cas d'échec persistant, reste sur "?". -->
|
||||||
|
<button id="user-badge" class="user-badge user-badge-unknown"
|
||||||
type="button" aria-label="Utilisateur connecté"
|
type="button" aria-label="Utilisateur connecté"
|
||||||
title="Utilisateur connecté"></button>
|
title="Utilisateur connecté"></button>
|
||||||
<h1 id="app-title">Planification</h1>
|
<h1 id="app-title">Planification</h1>
|
||||||
|
|||||||
@@ -4707,9 +4707,30 @@ function buildCard(tech, isoDate) {
|
|||||||
|
|
||||||
const isPompier = tech.interventions.some(iv => iv.isPompier);
|
const isPompier = tech.interventions.some(iv => iv.isPompier);
|
||||||
const isAbsent = isTechAbsent(tech, isoDate);
|
const isAbsent = isTechAbsent(tech, isoDate);
|
||||||
|
// v2026.5.30 : détecter aussi les absences récurrentes hardcodées (Pillonel vendredi)
|
||||||
|
// pour leur appliquer le code couleur cyan (comme Congé) au lieu du rouge Pompier.
|
||||||
|
const isRecurring = isPillonelAbsentFriday(tech, isoDate);
|
||||||
|
|
||||||
if (isPompier) card.classList.add("is-pompier");
|
if (isPompier) card.classList.add("is-pompier");
|
||||||
if (isAbsent) card.classList.add("is-absent");
|
if (isAbsent) card.classList.add("is-absent");
|
||||||
|
|
||||||
|
// v2026.5.27 : déterminer la catégorie d'absence principale (maladie/conge/pompier)
|
||||||
|
// pour appliquer le bon code couleur sur la carte entière.
|
||||||
|
// v2026.5.30 : les absences récurrentes hardcodées prennent la catégorie
|
||||||
|
// "recurring" (même cyan que Congé, texte distinct).
|
||||||
|
let absenceCategory = null; // "maladie" | "conge" | "pompier" | "recurring" | null
|
||||||
|
if (isRecurring) {
|
||||||
|
absenceCategory = "recurring";
|
||||||
|
} else if (isPompier) {
|
||||||
|
absenceCategory = "pompier";
|
||||||
|
} else if (isAbsent) {
|
||||||
|
const catBlock = tech.interventions.find(iv => iv.type === "AL-Absence" && iv.absenceCategory);
|
||||||
|
if (catBlock) absenceCategory = catBlock.absenceCategory;
|
||||||
|
}
|
||||||
|
if (absenceCategory) {
|
||||||
|
card.classList.add("absence-cat-" + absenceCategory);
|
||||||
|
}
|
||||||
|
|
||||||
const realInterventions = tech.interventions.filter(iv =>
|
const realInterventions = tech.interventions.filter(iv =>
|
||||||
iv.type !== "AL-Absence" && !iv.isPompier
|
iv.type !== "AL-Absence" && !iv.isPompier
|
||||||
);
|
);
|
||||||
@@ -4725,23 +4746,57 @@ function buildCard(tech, isoDate) {
|
|||||||
// --- Header ---
|
// --- Header ---
|
||||||
const header = document.createElement("div");
|
const header = document.createElement("div");
|
||||||
header.className = "card-header";
|
header.className = "card-header";
|
||||||
|
|
||||||
|
// v2026.5.27 : pastille colorée supprimée (v2026.5.28) — la barre gauche de la
|
||||||
|
// carte + le badge à droite suffisent pour indiquer la catégorie d'absence.
|
||||||
|
|
||||||
const nameEl = document.createElement("div");
|
const nameEl = document.createElement("div");
|
||||||
nameEl.className = "card-tech-name";
|
nameEl.className = "card-tech-name";
|
||||||
nameEl.textContent = tech.name;
|
nameEl.textContent = tech.name;
|
||||||
header.appendChild(nameEl);
|
header.appendChild(nameEl);
|
||||||
|
|
||||||
if (isPompier || isAbsent) {
|
if (isPompier || isAbsent || isRecurring) {
|
||||||
const badge = document.createElement("div");
|
const badge = document.createElement("div");
|
||||||
badge.className = "card-tech-badge";
|
badge.className = "card-tech-badge";
|
||||||
if (isPompier) {
|
if (isRecurring) {
|
||||||
|
// v2026.5.30 : absence récurrente (Pillonel vendredi) → badge "Absent" cyan
|
||||||
|
badge.classList.add("badge-recurring");
|
||||||
|
badge.textContent = "Absent";
|
||||||
|
} else if (isPompier) {
|
||||||
badge.classList.add("badge-pompier");
|
badge.classList.add("badge-pompier");
|
||||||
badge.textContent = "Pompier";
|
badge.textContent = "Pompier";
|
||||||
|
} else if (absenceCategory === "maladie") {
|
||||||
|
badge.classList.add("badge-maladie");
|
||||||
|
badge.textContent = "Maladie/Accident";
|
||||||
|
} else if (absenceCategory === "conge") {
|
||||||
|
// Déterminer singulier/pluriel selon la durée
|
||||||
|
const ab = absenceBlocks.find(a => a.absenceCategory === "conge") || absenceBlocks[0];
|
||||||
|
const multiDay = ab && ab.startDate && ab.endDate && ab.startDate !== ab.endDate;
|
||||||
|
badge.classList.add("badge-conge");
|
||||||
|
badge.textContent = multiDay ? "Congés" : "Congé";
|
||||||
} else {
|
} else {
|
||||||
badge.classList.add("badge-absent");
|
badge.classList.add("badge-absent");
|
||||||
badge.textContent = "Absent";
|
badge.textContent = "Absent";
|
||||||
}
|
}
|
||||||
header.appendChild(badge);
|
header.appendChild(badge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// v2026.5.32 : stats rapides pour la vue horizontale (cachées en classique)
|
||||||
|
const rowStats = document.createElement("div");
|
||||||
|
rowStats.className = "tech-row-stats";
|
||||||
|
const totalInterv = realInterventions.length;
|
||||||
|
const pill1 = document.createElement("span");
|
||||||
|
pill1.className = "stat-pill";
|
||||||
|
pill1.textContent = totalInterv + " interv.";
|
||||||
|
rowStats.appendChild(pill1);
|
||||||
|
if (morning > 0 || afternoon > 0) {
|
||||||
|
const pill2 = document.createElement("span");
|
||||||
|
pill2.className = "stat-pill";
|
||||||
|
pill2.textContent = morning + "m · " + afternoon + "a";
|
||||||
|
rowStats.appendChild(pill2);
|
||||||
|
}
|
||||||
|
header.appendChild(rowStats);
|
||||||
|
|
||||||
card.appendChild(header);
|
card.appendChild(header);
|
||||||
|
|
||||||
// --- Body ---
|
// --- Body ---
|
||||||
@@ -4762,30 +4817,60 @@ function buildCard(tech, isoDate) {
|
|||||||
} else if (isAbsent && absenceBlocks.length) {
|
} else if (isAbsent && absenceBlocks.length) {
|
||||||
const note = document.createElement("div");
|
const note = document.createElement("div");
|
||||||
note.className = "card-status-note absent";
|
note.className = "card-status-note absent";
|
||||||
const ab = absenceBlocks[0];
|
if (absenceCategory) {
|
||||||
if (ab.startDate && ab.endDate && ab.startDate !== ab.endDate) {
|
note.classList.add("absent-" + absenceCategory);
|
||||||
note.textContent = `Absent du ${ab.startDate.substring(0, 5)} au ${ab.endDate.substring(0, 5)}`;
|
|
||||||
} else {
|
|
||||||
note.textContent = "Absent toute la journée";
|
|
||||||
}
|
}
|
||||||
|
const ab = absenceBlocks[0];
|
||||||
|
// v2026.5.27 : libellé enrichi "Absent du XX au YY — Maladie" ou "Absent — Congé"
|
||||||
|
const multiDay = ab.startDate && ab.endDate && ab.startDate !== ab.endDate;
|
||||||
|
const catLabel = absenceCategory === "maladie" ? "Maladie/Accident"
|
||||||
|
: absenceCategory === "conge" ? (multiDay ? "Congés" : "Congé")
|
||||||
|
: null;
|
||||||
|
let txt;
|
||||||
|
if (multiDay) {
|
||||||
|
txt = `Absent du ${ab.startDate.substring(0, 5)} au ${ab.endDate.substring(0, 5)}`;
|
||||||
|
} else {
|
||||||
|
txt = "Absent toute la journée";
|
||||||
|
}
|
||||||
|
if (catLabel) txt += ` — ${catLabel}`;
|
||||||
|
note.textContent = txt;
|
||||||
body.appendChild(note);
|
body.appendChild(note);
|
||||||
|
|
||||||
// v5.0.4 : tooltip au hover sur toute la carte absent (pas juste un
|
// v5.0.4 : tooltip au hover sur toute la carte absent (pas juste un
|
||||||
// bouton visible). Contient : détail période + bouton supprimer si
|
// bouton visible). Contient : détail période + bouton supprimer si
|
||||||
// c'est une absence supprimable (actionId réel, pas pompier récurrent).
|
// c'est une absence supprimable (actionId réel, pas pompier récurrent).
|
||||||
|
// v2026.5.33 : en vue horizontale, attacher le hover SEULEMENT au badge
|
||||||
|
// (Congé / Maladie/Accident / Absent) pour éviter que la popup s'affiche
|
||||||
|
// dès qu'on approche de la ligne du tech. En vue classique, on garde la
|
||||||
|
// carte entière comme zone de hover (comportement d'origine).
|
||||||
if (ab.actionId && !ab.isPompier && !ab._recurring) {
|
if (ab.actionId && !ab.isPompier && !ab._recurring) {
|
||||||
// On attache le tooltip sur la CARD ENTIÈRE (card) — comme ça
|
|
||||||
// survoler n'importe où sur la zone grisée "absent" le déclenche.
|
|
||||||
const ivCopy = {
|
const ivCopy = {
|
||||||
...ab,
|
...ab,
|
||||||
type: "AL-Absence" // force pour buildTooltipHTML
|
type: "AL-Absence"
|
||||||
};
|
};
|
||||||
|
const _isHorizontalView = () => document.documentElement.classList.contains("view-horizontal");
|
||||||
|
// Hover sur la carte entière : actif SEULEMENT en vue classique
|
||||||
card.addEventListener("mouseenter", (e) => {
|
card.addEventListener("mouseenter", (e) => {
|
||||||
|
if (_isHorizontalView()) return; // bloqué en horizontal
|
||||||
showTooltip(e, ivCopy, card);
|
showTooltip(e, ivCopy, card);
|
||||||
});
|
});
|
||||||
card.addEventListener("mouseleave", () => {
|
card.addEventListener("mouseleave", () => {
|
||||||
|
if (_isHorizontalView()) return;
|
||||||
hideTooltip();
|
hideTooltip();
|
||||||
});
|
});
|
||||||
|
// Hover sur le badge (Congé / Maladie/Accident / Absent) : actif
|
||||||
|
// SEULEMENT en vue horizontale.
|
||||||
|
const badgeEl = card.querySelector(".card-tech-badge");
|
||||||
|
if (badgeEl) {
|
||||||
|
badgeEl.addEventListener("mouseenter", (e) => {
|
||||||
|
if (!_isHorizontalView()) return; // bloqué en classique
|
||||||
|
showTooltip(e, ivCopy, badgeEl);
|
||||||
|
});
|
||||||
|
badgeEl.addEventListener("mouseleave", () => {
|
||||||
|
if (!_isHorizontalView()) return;
|
||||||
|
hideTooltip();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5031,19 +5116,42 @@ function getStatusClass(iv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function bindTimelinePopover(el) {
|
function bindTimelinePopover(el) {
|
||||||
el.addEventListener("mouseenter", (e) => showTimelinePopover(e, el));
|
// v2026.5.33 : en vue horizontale, les interactions sont différentes :
|
||||||
|
// - hover : ouvre directement la GRANDE popup (pas la petite)
|
||||||
|
// - clic : ouvre la fiche EasyVista dans un nouvel onglet
|
||||||
|
// En vue classique, le comportement existant est conservé :
|
||||||
|
// - hover : petite popup qui suit la souris
|
||||||
|
// - clic simple : grande popup persistante
|
||||||
|
// - double-clic : fiche EasyVista nouvel onglet
|
||||||
|
// - Ctrl+clic : fiche EasyVista en arrière-plan
|
||||||
|
const _isHorizontalView = () => document.documentElement.classList.contains("view-horizontal");
|
||||||
|
|
||||||
|
el.addEventListener("mouseenter", (e) => {
|
||||||
|
if (_isHorizontalView()) {
|
||||||
|
// Grande popup directement en vue horizontale
|
||||||
|
if (el.dataset.ivIdx !== undefined) {
|
||||||
|
openPersistentTimelinePopup(el);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showTimelinePopover(e, el);
|
||||||
|
}
|
||||||
|
});
|
||||||
// v4.2.3 : la petite popup timeline SUIT la souris (différent de la grande
|
// v4.2.3 : la petite popup timeline SUIT la souris (différent de la grande
|
||||||
// popup des lignes d'intervention qui est ancrée). On n'utilise pas
|
// popup des lignes d'intervention qui est ancrée). On n'utilise pas
|
||||||
// moveTooltip() (no-op depuis v4.1.12) mais une fonction dédiée.
|
// moveTooltip() (no-op depuis v4.1.12) mais une fonction dédiée.
|
||||||
el.addEventListener("mousemove", (e) => moveTimelineTooltip(e));
|
el.addEventListener("mousemove", (e) => {
|
||||||
el.addEventListener("mouseleave", hideTooltip);
|
if (!_isHorizontalView()) {
|
||||||
|
moveTimelineTooltip(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
el.addEventListener("mouseleave", () => {
|
||||||
|
if (!_isHorizontalView()) {
|
||||||
|
hideTooltip();
|
||||||
|
}
|
||||||
|
// En vue horizontale, la grande popup est persistante donc on ne ferme
|
||||||
|
// pas au mouseleave (l'user peut interagir avec).
|
||||||
|
});
|
||||||
|
|
||||||
// v4.2.3 : clic / double-clic / Ctrl+clic sur un segment timeline
|
|
||||||
// - clic simple : ferme la petite popup et ouvre la GRANDE popup
|
|
||||||
// (ancrée juste en dessous de la timeline, persistante pour permettre
|
|
||||||
// de sélectionner du texte / copier)
|
|
||||||
// - double-clic : ouvre la fiche EasyVista dans un nouvel onglet actif
|
|
||||||
// - Ctrl+clic (Cmd+clic sur Mac) : ouvre dans un onglet en arrière-plan
|
|
||||||
const kind = el.dataset.kind;
|
const kind = el.dataset.kind;
|
||||||
const ivIdxStr = el.dataset.ivIdx;
|
const ivIdxStr = el.dataset.ivIdx;
|
||||||
// Seulement sur les segments avec une interventoin (pas les "hole" libres
|
// Seulement sur les segments avec une interventoin (pas les "hole" libres
|
||||||
@@ -5052,6 +5160,17 @@ function bindTimelinePopover(el) {
|
|||||||
|
|
||||||
let singleClickTimer = null;
|
let singleClickTimer = null;
|
||||||
el.addEventListener("click", (e) => {
|
el.addEventListener("click", (e) => {
|
||||||
|
// v2026.5.33 : en vue horizontale, tout clic simple = ouvrir la fiche EV
|
||||||
|
if (_isHorizontalView()) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
// Ctrl/Cmd/middle → arrière-plan, sinon nouvel onglet actif
|
||||||
|
const background = !!(e.ctrlKey || e.metaKey || e.button === 1);
|
||||||
|
openInterventionFromTimeline(el, { background });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vue classique (inchangé) :
|
||||||
// Ctrl / Cmd / molette → ouvrir fiche en arrière-plan
|
// Ctrl / Cmd / molette → ouvrir fiche en arrière-plan
|
||||||
if (e.ctrlKey || e.metaKey || e.button === 1) {
|
if (e.ctrlKey || e.metaKey || e.button === 1) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -5069,8 +5188,10 @@ function bindTimelinePopover(el) {
|
|||||||
}, 250);
|
}, 250);
|
||||||
});
|
});
|
||||||
el.addEventListener("dblclick", (e) => {
|
el.addEventListener("dblclick", (e) => {
|
||||||
// Annuler le clic simple en attente
|
// En vue horizontale le clic simple fait déjà l'ouverture, le dblclick
|
||||||
|
// devient inutile — on le laisse par sécurité (comportement idem).
|
||||||
if (singleClickTimer) { clearTimeout(singleClickTimer); singleClickTimer = null; }
|
if (singleClickTimer) { clearTimeout(singleClickTimer); singleClickTimer = null; }
|
||||||
|
if (_isHorizontalView()) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
openInterventionFromTimeline(el, { background: false });
|
openInterventionFromTimeline(el, { background: false });
|
||||||
|
|||||||
Reference in New Issue
Block a user