forked from FroSteel/Planification
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ae440cbf1 | |||
| f6d549d522 | |||
| 565075933e |
+205
-3
@@ -85,7 +85,7 @@ async function fetchPlanningXml(origin, phpsessid, unixDate) {
|
||||
`&day_start_hour=8` +
|
||||
`&day_end_hour=19`;
|
||||
console.log("[bg] fetchPlanningXml →", url.substring(0, 140));
|
||||
const r = await fetch(url, { credentials: "include" });
|
||||
const r = await evFetch(url, origin);
|
||||
console.log("[bg] status =", r.status);
|
||||
if (!r.ok) {
|
||||
// v4.2 : classifier l'erreur HTTP pour que le viewer affiche le bon
|
||||
@@ -100,6 +100,32 @@ async function fetchPlanningXml(origin, phpsessid, unixDate) {
|
||||
return xml;
|
||||
}
|
||||
|
||||
/**
|
||||
* v5.0.9 : wrapper autour de fetch() qui ajoute systématiquement les
|
||||
* headers de sécurité attendus par EasyVista (Referer, Sec-Fetch-Site,
|
||||
* X-Requested-With). Sans ces headers, EV renvoie soit un <script> de
|
||||
* redirection (CSRF check), soit une page de login, même avec une session
|
||||
* valide.
|
||||
*
|
||||
* Observé dans les captures réseau du navigateur :
|
||||
* Referer: https://itsma.etat-de-vaud.ch/index.php?eventName=HelpDesk_PlanningItem
|
||||
* Sec-Fetch-Site: same-origin
|
||||
* X-Requested-With: XMLHttpRequest (parfois)
|
||||
*
|
||||
* @param {string} url - URL complète à fetcher
|
||||
* @param {string} origin - origine EasyVista (pour construire le Referer)
|
||||
* @param {object} [opts] - options fetch (method, body, headers supplémentaires)
|
||||
*/
|
||||
async function evFetch(url, origin, opts = {}) {
|
||||
const defaultHeaders = {
|
||||
"Referer": `${origin}/index.php?eventName=HelpDesk_PlanningItem`,
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
};
|
||||
const headers = Object.assign({}, defaultHeaders, opts.headers || {});
|
||||
const fetchOpts = Object.assign({ credentials: "include" }, opts, { headers });
|
||||
return await fetch(url, fetchOpts);
|
||||
}
|
||||
|
||||
/**
|
||||
* v4.2 : classifie un statut HTTP comme "session_expired" ou "ev_unreachable".
|
||||
* - 401, 403, 404 → session_expired (EV renvoie souvent 404 au lieu de rediriger
|
||||
@@ -118,7 +144,7 @@ function classifyHttpStatus(status) {
|
||||
*/
|
||||
async function fetchXhr2(origin, phpsessid, actionId) {
|
||||
const url = `${origin}/planning_xhr_2.php?PHPSESSID=${encodeURIComponent(phpsessid)}&id=${encodeURIComponent(actionId)}`;
|
||||
const r = await fetch(url, { credentials: "include" });
|
||||
const r = await evFetch(url, origin);
|
||||
if (!r.ok) {
|
||||
const err = new Error("HTTP " + r.status);
|
||||
err.kind = classifyHttpStatus(r.status);
|
||||
@@ -131,7 +157,7 @@ async function fetchXhr2(origin, phpsessid, actionId) {
|
||||
async function fetchFicheHtml(origin, phpsessid, formLink) {
|
||||
const url = `${origin}/index.php?${formLink}&PHPSESSID=${encodeURIComponent(phpsessid)}`;
|
||||
console.log("[bg] fetchFicheHtml →", url.substring(0, 120));
|
||||
const r = await fetch(url, { credentials: "include" });
|
||||
const r = await evFetch(url, origin);
|
||||
if (!r.ok) {
|
||||
const err = new Error("HTTP " + r.status);
|
||||
err.kind = classifyHttpStatus(r.status);
|
||||
@@ -140,6 +166,9 @@ async function fetchFicheHtml(origin, phpsessid, formLink) {
|
||||
}
|
||||
const html = await r.text();
|
||||
console.log("[bg] fiche status =", r.status, "| taille =", html.length);
|
||||
if (html.length < 500) {
|
||||
console.warn("[bg] ⚠ fiche très courte, contenu =", JSON.stringify(html));
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
@@ -285,6 +314,144 @@ async function fetchCurrentUser(origin, phpsessid) {
|
||||
return { name, login, service };
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// v4.2.6 : Création d'absence
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* Envoie un POST vers plan_set_holidays_popup.php pour créer une absence.
|
||||
* Format attendu (analysé depuis le HTML EasyVista) :
|
||||
* Query params : PHPSESSID, MAIN_DIRECTORY, ROOT_DIRECTORY, current_date,
|
||||
* empl_ids, begin_hour, end_hour, plagehoraire
|
||||
* Body : start_date, start_time, end_date, end_time, label_guid, dialog_action
|
||||
*
|
||||
* @param {string} origin - "https://itsma.vd.ch" ou similaire
|
||||
* @param {string} phpsessid
|
||||
* @param {Object} opts - { techIds: string[], startDate: "DD/MM/YYYY",
|
||||
* startTime: "HH:MM:SS", endDate, endTime,
|
||||
* typeGuid, currentDate }
|
||||
*/
|
||||
async function submitAbsence(origin, phpsessid, opts) {
|
||||
const emplIds = (opts.techIds || []).join(",");
|
||||
if (!emplIds) throw new Error("Aucun technicien sélectionné");
|
||||
|
||||
const internalurltime = Math.floor(Date.now() / 1000);
|
||||
const url = `${origin}/include/components/staff/planning/plan_set_holidays_popup.php`
|
||||
+ `?PHPSESSID=${encodeURIComponent(phpsessid)}`
|
||||
+ `&internalurltime=${internalurltime}`
|
||||
+ `&MAIN_DIRECTORY=${encodeURIComponent("/")}`
|
||||
+ `&ROOT_DIRECTORY=${encodeURIComponent("/ccv/data/www/itsma/htdocs/")}`
|
||||
+ `¤t_date=${encodeURIComponent(opts.currentDate)}`
|
||||
+ `&empl_ids=${encodeURIComponent(emplIds)}`
|
||||
+ `&begin_hour=8`
|
||||
+ `&end_hour=18`
|
||||
+ `&plagehoraire=0`;
|
||||
|
||||
const body = new URLSearchParams();
|
||||
body.set("start_date", opts.startDate);
|
||||
body.set("start_time", opts.startTime);
|
||||
body.set("end_date", opts.endDate);
|
||||
body.set("end_time", opts.endTime);
|
||||
body.set("label_guid", opts.typeGuid);
|
||||
body.set("dialog_action", "save_holidays");
|
||||
|
||||
console.log("[bg] submitAbsence →", url.substring(0, 140));
|
||||
console.log("[bg] body:", body.toString());
|
||||
|
||||
const r = await fetch(url, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||
body: body.toString()
|
||||
});
|
||||
|
||||
console.log("[bg] status =", r.status);
|
||||
|
||||
if (!r.ok) {
|
||||
throw new Error("HTTP " + r.status);
|
||||
}
|
||||
|
||||
const responseText = await r.text();
|
||||
if (looksLikeLoginPage(responseText)) {
|
||||
throw new Error("session_expired");
|
||||
}
|
||||
|
||||
// Succès : on ne sait pas le format exact de la réponse EasyVista, on
|
||||
// considère qu'un HTTP 200 non-login signifie succès.
|
||||
return { status: r.status };
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// v4.2.6 : Envoi sur douchette
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* Envoie la planification du jour sur la douchette des techs sélectionnés.
|
||||
*
|
||||
* Endpoint identifié (via l'inspection de la page EasyVista) :
|
||||
* POST /include/components/staff/planning/plan_set_tech_planif_popup.php
|
||||
* Query : PHPSESSID, current_date, empl_ids (CSV), begin_hour, end_hour,
|
||||
* plagehoraire
|
||||
* Body : dialog_action=save_planif
|
||||
*
|
||||
* Contrairement à l'absence, un seul POST suffit pour tous les techs (empl_ids
|
||||
* est une CSV), pas besoin de boucler.
|
||||
*
|
||||
* @param {string} origin
|
||||
* @param {string} phpsessid
|
||||
* @param {Object} opts - { techIds, currentDate }
|
||||
* @returns {{ okCount, errors }}
|
||||
*/
|
||||
async function submitDouchette(origin, phpsessid, opts) {
|
||||
const techIds = opts.techIds || [];
|
||||
if (techIds.length === 0) throw new Error("Aucun technicien sélectionné");
|
||||
|
||||
const emplIds = techIds.join(",");
|
||||
const internalurltime = Math.floor(Date.now() / 1000);
|
||||
const url = `${origin}/include/components/staff/planning/plan_set_tech_planif_popup.php`
|
||||
+ `?PHPSESSID=${encodeURIComponent(phpsessid)}`
|
||||
+ `&internalurltime=${internalurltime}`
|
||||
+ `&MAIN_DIRECTORY=${encodeURIComponent("/")}`
|
||||
+ `&ROOT_DIRECTORY=${encodeURIComponent("/ccv/data/www/itsma/htdocs/")}`
|
||||
+ `¤t_date=${encodeURIComponent(opts.currentDate)}`
|
||||
+ `&empl_ids=${encodeURIComponent(emplIds)}`
|
||||
+ `&begin_hour=8`
|
||||
+ `&end_hour=18`
|
||||
+ `&plagehoraire=0`;
|
||||
|
||||
const body = new URLSearchParams();
|
||||
body.set("dialog_action", "save_planif");
|
||||
|
||||
console.log("[bg] submitDouchette →", url.substring(0, 160));
|
||||
console.log("[bg] body:", body.toString());
|
||||
console.log("[bg] techs:", emplIds);
|
||||
|
||||
try {
|
||||
const r = await fetch(url, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||
body: body.toString()
|
||||
});
|
||||
console.log("[bg] status =", r.status);
|
||||
|
||||
if (r.status === 401 || r.status === 403) {
|
||||
return { okCount: 0, errors: techIds.map(t => ({ techId: t, error: "session_expired" })) };
|
||||
}
|
||||
if (!r.ok) {
|
||||
return { okCount: 0, errors: techIds.map(t => ({ techId: t, error: "HTTP " + r.status })) };
|
||||
}
|
||||
const responseText = await r.text();
|
||||
if (looksLikeLoginPage(responseText)) {
|
||||
return { okCount: 0, errors: techIds.map(t => ({ techId: t, error: "session_expired" })) };
|
||||
}
|
||||
return { okCount: techIds.length, errors: [] };
|
||||
} catch (err) {
|
||||
const msg = err && err.message ? err.message : String(err);
|
||||
return { okCount: 0, errors: techIds.map(t => ({ techId: t, error: msg })) };
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Messages du viewer
|
||||
// ============================================================================
|
||||
@@ -412,6 +579,41 @@ chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg.type === "submitAbsence") {
|
||||
// v4.2.6 : crée une absence dans EasyVista via POST vers
|
||||
// /include/components/staff/planning/plan_set_holidays_popup.php
|
||||
const session = await findEasyVistaSession();
|
||||
if (!session) {
|
||||
sendResponse({ ok: false, error: "no_session" });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const result = await submitAbsence(session.origin, session.phpsessid, msg);
|
||||
sendResponse({ ok: true, result });
|
||||
} catch (err) {
|
||||
sendResponse({ ok: false, error: err.message || String(err) });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg.type === "submitDouchette") {
|
||||
// v4.2.6 : envoie la planification sur la douchette de chaque tech.
|
||||
// On teste plusieurs URLs possibles (l'endpoint exact n'est pas dans
|
||||
// le HTML statique que nous avons analysé).
|
||||
const session = await findEasyVistaSession();
|
||||
if (!session) {
|
||||
sendResponse({ ok: false, error: "no_session" });
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const result = await submitDouchette(session.origin, session.phpsessid, msg);
|
||||
sendResponse({ ok: true, okCount: result.okCount, errors: result.errors });
|
||||
} catch (err) {
|
||||
sendResponse({ ok: false, error: err.message || String(err) });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg.type === "cleanupOldCaches") {
|
||||
const removed = await cleanupOldCaches(msg.daysToKeep || 7);
|
||||
sendResponse({ ok: true, removed });
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Planning Techniciens — Vue claire",
|
||||
"version": "4.2.3",
|
||||
"description": "Vue claire du planning EasyVista (itsma.etat-de-vaud.ch et itsma.vd.ch). v4.2.3 : titre renommé 'Planification', pastille d'initiales utilisateur à gauche (clic = popup nom complet), timeline petite popup qui suit la souris, clic timeline = grande popup persistante sous la timeline, double-clic = ouvre fiche, Ctrl+clic = fiche en arrière-plan, 2 contacts séparés par 'et' affichés sur 2 lignes, numéros courts 5 chiffres commençant par 6/7/8 avec espaces reconnus.",
|
||||
"name": "Planification",
|
||||
"version": "5.0.0",
|
||||
"description": "Vue claire du planning EasyVista (itsma.etat-de-vaud.ch et itsma.vd.ch). v4.3.0 : (1) conflits horaires entre interventions d'un même tech affichés en rouge + ⚠. (2) Réservations disparues retirées directement (pas de re-fetch inutile). (3) Popups épinglés détachés : plusieurs peuvent coexister, ancrés au contenu (scrollent avec la page), auto-positionnés sans se marcher dessus (toast si pas de place), Échap pour tout fermer, Ctrl×2 pour fermer si un seul épinglé. Inclut v4.2.9.",
|
||||
"permissions": [
|
||||
"activeTab",
|
||||
"scripting",
|
||||
@@ -15,7 +15,7 @@
|
||||
"https://itsma.vd.ch/*"
|
||||
],
|
||||
"action": {
|
||||
"default_title": "Ouvrir la vue claire du planning"
|
||||
"default_title": "Ouvrir la Planification"
|
||||
},
|
||||
"background": {
|
||||
"service_worker": "background.js"
|
||||
|
||||
+344
-16
@@ -179,27 +179,48 @@ html, body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 10px 16px;
|
||||
background: linear-gradient(90deg, #7a1f1f, #8b2a2a);
|
||||
padding: 12px 18px;
|
||||
/* v4.2.5 : rouge plus vif + bord plus épais pour visibilité max */
|
||||
background: linear-gradient(90deg, #c93030, #d84848);
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #5a1515;
|
||||
font-size: 13px;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.25);
|
||||
border-top: 2px solid #ff6060;
|
||||
border-bottom: 2px solid #7a1515;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
/* petite animation d'apparition pour attirer l'œil */
|
||||
animation: session-banner-in 0.22s ease-out;
|
||||
}
|
||||
@keyframes session-banner-in {
|
||||
from { opacity: 0; transform: translateY(-6px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
/* v4.2.5 : variante ORANGE pour "EV inaccessible" (distinct de session expirée) */
|
||||
.session-banner.ev-banner {
|
||||
background: linear-gradient(90deg, #c77920, #e09a3a);
|
||||
border-top: 2px solid #ffbb60;
|
||||
border-bottom: 2px solid #7a4a15;
|
||||
}
|
||||
.session-banner.ev-banner .btn-primary {
|
||||
color: #8a4a10;
|
||||
}
|
||||
.session-banner.hidden {
|
||||
display: none;
|
||||
}
|
||||
.session-banner-icon {
|
||||
font-size: 18px;
|
||||
font-size: 20px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.session-banner-text {
|
||||
flex: 1;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.session-banner-text strong {
|
||||
font-weight: 600;
|
||||
}
|
||||
.session-banner .btn-primary {
|
||||
background: #fff;
|
||||
color: #7a1f1f;
|
||||
color: #9a2020;
|
||||
border: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -207,8 +228,26 @@ html, body {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.session-banner .btn-sm {
|
||||
padding: 4px 12px;
|
||||
padding: 5px 12px;
|
||||
font-size: 12px;
|
||||
/* v4.2.5 : btn-sm non-primary dans la bannière = contour blanc */
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
font-weight: 500;
|
||||
}
|
||||
.session-banner .btn-sm:hover {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
.session-banner .btn-primary.btn-sm {
|
||||
/* reset : le primary override le style du btn-sm */
|
||||
background: #fff;
|
||||
color: #9a2020;
|
||||
border: 0;
|
||||
font-weight: 600;
|
||||
}
|
||||
.session-banner.ev-banner .btn-primary.btn-sm {
|
||||
color: #8a4a10;
|
||||
}
|
||||
.session-banner .btn-icon {
|
||||
background: transparent;
|
||||
@@ -217,12 +256,13 @@ html, body {
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
padding: 4px 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.session-banner .btn-icon:hover {
|
||||
background: rgba(255,255,255,0.15);
|
||||
}
|
||||
|
||||
/* Barre de progression pendant le rafraîchissement — v4.1.12 : texte
|
||||
/* Barre de progression pendant le rafraichissement — v4.1.12 : texte
|
||||
toujours lisible, que la zone verte l'ait atteint ou non (utilise
|
||||
mix-blend-mode:difference pour inverser la couleur du texte là où la
|
||||
barre verte est dessous). */
|
||||
@@ -398,7 +438,7 @@ html, body {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
/* Bouton "Arrêter" (apparaît pendant un refresh manuel) */
|
||||
/* Bouton "Arrêter" (apparaît pdt un refresh manuel) */
|
||||
.btn-abort {
|
||||
background: var(--danger-soft);
|
||||
color: var(--danger);
|
||||
@@ -826,10 +866,52 @@ html, body {
|
||||
width: 5px;
|
||||
}
|
||||
|
||||
.intervention-v2.is-ghost {
|
||||
opacity: 0.5;
|
||||
text-decoration: line-through;
|
||||
/* v4.2.5 : statut "terminée par le tech" (commentaire LOGIN: détecté).
|
||||
Vert PLUS CLAIR que status-closed (distinction visuelle du ✓ simple
|
||||
vs ✓✓ double). */
|
||||
.intervention-v2.status-terminated {
|
||||
background: var(--c-recup-soft, rgba(63, 185, 80, 0.12));
|
||||
box-shadow: inset 4px 0 0 var(--c-recup, #3fb950);
|
||||
}
|
||||
.intervention-v2.status-terminated:hover {
|
||||
background: var(--c-recup-soft, rgba(63, 185, 80, 0.12));
|
||||
filter: brightness(0.96);
|
||||
}
|
||||
.intervention-v2.status-terminated .intervention-dot {
|
||||
background: var(--c-recup, #3fb950);
|
||||
width: 5px;
|
||||
}
|
||||
.intervention-v2.status-terminated .iv-status-check {
|
||||
color: var(--c-recup, #3fb950);
|
||||
}
|
||||
.timeline-slot.status-terminated { background: var(--c-recup, #3fb950); }
|
||||
|
||||
/* v4.2.5 : carte "en cours d'analyse" (ghost juste disparu, on re-fetch la
|
||||
fiche pour décider du sort). Opacité réduite + petit spinner discret. */
|
||||
.intervention-v2._checking {
|
||||
opacity: 0.6;
|
||||
position: relative;
|
||||
}
|
||||
.intervention-v2._checking::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-top: -6px;
|
||||
border: 2px solid var(--border, #ccc);
|
||||
border-top-color: var(--text-muted, #666);
|
||||
border-radius: 50%;
|
||||
animation: iv-check-spin 0.9s linear infinite;
|
||||
}
|
||||
@keyframes iv-check-spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* .intervention-v2.is-ghost : retirée en v4.3.3 — on ne barre plus les
|
||||
cartes. La gestion des tickets disparus se fait via _disappearStatus
|
||||
(vert ✓/✓✓) ou _disappearRemove (retrait total). */
|
||||
|
||||
/* Ligne 1 : REF en titre centré gros gras */
|
||||
.iv-ref-header {
|
||||
@@ -866,6 +948,14 @@ html, body {
|
||||
}
|
||||
.intervention-v2.status-resolved .iv-status-check { color: var(--c-resolved); }
|
||||
|
||||
/* v4.2.5 : ✓✓ double check (clôturé/résolu) — un peu plus petit pour tenir
|
||||
les 2 caractères. Espacement négatif pour les rapprocher. */
|
||||
.iv-status-check.double {
|
||||
font-size: 14px;
|
||||
letter-spacing: -3px;
|
||||
padding-right: 3px; /* compenser le letter-spacing côté droit */
|
||||
}
|
||||
|
||||
.intervention-copy {
|
||||
grid-area: copy;
|
||||
align-self: start;
|
||||
@@ -1067,6 +1157,13 @@ html, body {
|
||||
========================================================================== */
|
||||
.tooltip {
|
||||
position: fixed !important;
|
||||
/* v4.2.4 : forcer un stacking context propre et l'isolation pour que le
|
||||
tooltip ne soit pas affecté par un éventuel filter/transform/contain
|
||||
sur un ancêtre (qui casserait position:fixed). `contain: layout` et
|
||||
`will-change: transform` garantissent aussi que le navigateur traite
|
||||
ce tooltip indépendamment. */
|
||||
isolation: isolate;
|
||||
contain: layout;
|
||||
z-index: 100;
|
||||
max-width: 620px;
|
||||
max-height: calc(100vh - 40px);
|
||||
@@ -1082,9 +1179,6 @@ html, body {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
transition: opacity 0.1s;
|
||||
/* v4.2 : sélection de texte autorisée en permanence. Avant (v4.1.10) on
|
||||
bloquait par défaut et n'activait qu'en mode épinglé, mais c'était
|
||||
contre-productif — on veut pouvoir copier un numéro sans pin d'abord. */
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
@@ -1401,6 +1495,15 @@ html, body {
|
||||
.btn-modal-cancel:hover {
|
||||
background: var(--bg-hover, rgba(128, 128, 128, 0.08));
|
||||
}
|
||||
/* v4.2.5 : bouton primaire (action principale) pour modals d'alerte */
|
||||
.btn-modal-primary {
|
||||
background: var(--c-accent, #3fb950);
|
||||
color: #fff;
|
||||
border-color: var(--c-accent, #3fb950);
|
||||
}
|
||||
.btn-modal-primary:hover {
|
||||
filter: brightness(1.08);
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────────────────────────────────────
|
||||
v4.1.20 : Message d'absence récurrente (Pillonel vendredi)
|
||||
@@ -1516,3 +1619,228 @@ html, body {
|
||||
from { opacity: 0; transform: translateY(-4px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────────────────────────────────────
|
||||
v4.2.6 : boutons d'action topbar (Absence, Douchette)
|
||||
───────────────────────────────────────────────────────────────────────── */
|
||||
.btn-action {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 12px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
background: transparent;
|
||||
color: var(--text, #e0e0e0);
|
||||
border: 1px solid var(--border, rgba(128, 128, 128, 0.3));
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: background 0.12s, border-color 0.12s;
|
||||
}
|
||||
.btn-action:hover {
|
||||
background: var(--bg-hover, rgba(128, 128, 128, 0.12));
|
||||
border-color: var(--border-strong, rgba(128, 128, 128, 0.5));
|
||||
}
|
||||
.btn-action:active {
|
||||
transform: translateY(1px);
|
||||
}
|
||||
.btn-action-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.btn-action-emoji {
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
}
|
||||
.btn-action-label {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────────────────────────────────────
|
||||
v4.2.6 : modals Absence et Douchette
|
||||
───────────────────────────────────────────────────────────────────────── */
|
||||
.modal-card.modal-wide {
|
||||
width: min(520px, 92vw);
|
||||
}
|
||||
.modal-form-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.modal-form-row {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
.modal-form-row > * {
|
||||
flex: 1;
|
||||
}
|
||||
.modal-form-label {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted, #888);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.3px;
|
||||
}
|
||||
.modal-form-input,
|
||||
.modal-form-select {
|
||||
padding: 8px 10px;
|
||||
font-size: 13px;
|
||||
background: var(--bg, #fff);
|
||||
color: var(--text, #111);
|
||||
border: 1px solid var(--border, rgba(128, 128, 128, 0.3));
|
||||
border-radius: 6px;
|
||||
font-family: inherit;
|
||||
}
|
||||
.modal-form-input:focus,
|
||||
.modal-form-select:focus {
|
||||
outline: none;
|
||||
border-color: var(--c-accent, #3fb950);
|
||||
box-shadow: 0 0 0 2px rgba(63, 185, 80, 0.15);
|
||||
}
|
||||
|
||||
/* Liste checkboxes techniciens */
|
||||
.modal-tech-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
/* v4.2.8 : plus de max-height → tous les techs (max 8 + "Tout") visibles
|
||||
d'un coup sans avoir à scroller dans la liste. */
|
||||
padding: 6px;
|
||||
background: var(--bg-muted, rgba(128, 128, 128, 0.06));
|
||||
border: 1px solid var(--border, rgba(128, 128, 128, 0.2));
|
||||
border-radius: 6px;
|
||||
}
|
||||
.modal-tech-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 6px 8px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
transition: background 0.1s;
|
||||
}
|
||||
.modal-tech-item:hover {
|
||||
background: var(--bg-hover, rgba(128, 128, 128, 0.12));
|
||||
}
|
||||
.modal-tech-item input[type="checkbox"] {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
cursor: pointer;
|
||||
accent-color: var(--c-accent, #3fb950);
|
||||
}
|
||||
.modal-tech-item.tech-selectall {
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid var(--border, rgba(128, 128, 128, 0.2));
|
||||
padding-bottom: 8px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.modal-tech-item.tech-selectall:hover {
|
||||
background: var(--bg-hover, rgba(128, 128, 128, 0.12));
|
||||
}
|
||||
|
||||
/* Boutons Appliquer/Envoyer/Annuler côte à côte */
|
||||
.modal-actions.horizontal {
|
||||
flex-direction: row;
|
||||
gap: 8px;
|
||||
}
|
||||
.modal-actions.horizontal .btn {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────────────────────────────────────
|
||||
v4.2.9 : blocage du scroll arrière quand une modal est ouverte.
|
||||
La classe body.modal-open est ajoutée/retirée automatiquement par
|
||||
initModalScrollLock() dans viewer.js dès qu'un .modal-overlay existe.
|
||||
───────────────────────────────────────────────────────────────────────── */
|
||||
body.modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* v4.2.9 : pied de page discret en bas à droite — affiche auteur + date + version */
|
||||
.app-footer {
|
||||
position: fixed;
|
||||
right: 8px;
|
||||
bottom: 4px;
|
||||
font-size: 10px;
|
||||
color: var(--text-faint, #8892a0);
|
||||
opacity: 0.55;
|
||||
pointer-events: none; /* ne capture pas les clics */
|
||||
user-select: none;
|
||||
font-variant-numeric: tabular-nums;
|
||||
letter-spacing: 0.2px;
|
||||
z-index: 1; /* sous les modals (qui sont à 10000) */
|
||||
}
|
||||
.app-footer:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────────────────────────────────────
|
||||
v4.3.0 : conflit d'horaire entre 2 interventions d'un même tech.
|
||||
Les heures s'affichent en rouge + icône ⚠ à côté.
|
||||
───────────────────────────────────────────────────────────────────────── */
|
||||
.iv-time-vertical.iv-time-overlap .iv-time-start,
|
||||
.iv-time-vertical.iv-time-overlap .iv-time-end,
|
||||
.iv-time-vertical.iv-time-overlap .iv-time-arrow {
|
||||
color: var(--danger, #b03030) !important;
|
||||
font-weight: 700;
|
||||
}
|
||||
.iv-time-overlap-warn {
|
||||
color: var(--danger, #b03030);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
margin-top: 2px;
|
||||
cursor: help;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ─────────────────────────────────────────────────────────────────────────
|
||||
v4.3.0 : popups épinglés détachés
|
||||
Ancrés au contenu (position:absolute coord document) → scrollent avec
|
||||
la page. Persistent jusqu'à fermeture explicite.
|
||||
───────────────────────────────────────────────────────────────────────── */
|
||||
.tooltip.pinned-popup {
|
||||
position: absolute !important; /* override le fixed du .tooltip */
|
||||
/* v4.3.3 corr : les popups épinglées doivent passer DERRIÈRE la topbar
|
||||
quand on scrolle (topbar sticky z-index 10). Donc on met 5 : au-dessus
|
||||
du contenu normal, mais sous la topbar / bannières / modals. */
|
||||
z-index: 5 !important;
|
||||
opacity: 1 !important;
|
||||
pointer-events: auto !important;
|
||||
/* Bordure plus visible pour distinguer du tooltip live */
|
||||
border: 2px solid var(--accent, #0f4f8b);
|
||||
box-shadow: 0 8px 24px rgba(0,0,0,0.18);
|
||||
/* Pas de contain: layout (hérité) car ça limite le rendu ; on laisse */
|
||||
animation: pinned-popup-in 0.15s ease-out;
|
||||
}
|
||||
@keyframes pinned-popup-in {
|
||||
from { opacity: 0; transform: scale(0.96); }
|
||||
to { opacity: 1; transform: scale(1); }
|
||||
}
|
||||
|
||||
/* Bouton × de fermeture du popup épinglé */
|
||||
.pinned-popup-close {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 6px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
padding: 0;
|
||||
line-height: 1;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
color: var(--text-muted, #888);
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: background 0.1s, color 0.1s;
|
||||
}
|
||||
.pinned-popup-close:hover {
|
||||
background: var(--danger-soft, #fbe6e6);
|
||||
color: var(--danger, #b03030);
|
||||
}
|
||||
|
||||
+29
-2
@@ -13,7 +13,7 @@
|
||||
<button id="user-badge" class="user-badge hidden"
|
||||
type="button" aria-label="Utilisateur connecté"
|
||||
title="Utilisateur connecté"></button>
|
||||
<h1>Planification</h1>
|
||||
<h1 id="app-title">Planification</h1>
|
||||
<div class="date-nav">
|
||||
<button id="nav-prev" class="btn btn-nav" title="Jour précédent" aria-label="Jour précédent">◀</button>
|
||||
<input type="date" id="date-picker" class="date-input">
|
||||
@@ -24,6 +24,21 @@
|
||||
<span id="refresh-check" class="refresh-check hidden" title="Mise à jour terminée">✓</span>
|
||||
</div>
|
||||
<div class="topbar-right">
|
||||
<!-- v4.2.6 : bouton créer une absence pour un ou plusieurs techs -->
|
||||
<button id="absence-btn" class="btn btn-action" title="Créer une absence pour un ou plusieurs techniciens">
|
||||
<svg class="btn-action-icon" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
||||
<rect x="3" y="5" width="18" height="16" rx="2" stroke="currentColor" stroke-width="1.8"/>
|
||||
<path d="M3 9h18M8 3v4M16 3v4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
||||
<circle cx="12" cy="15" r="4.2" stroke="currentColor" stroke-width="1.8" fill="none"/>
|
||||
<line x1="9" y1="15" x2="15" y2="15" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" transform="rotate(-45 12 15)"/>
|
||||
</svg>
|
||||
<span class="btn-action-label">Absence</span>
|
||||
</button>
|
||||
<!-- v4.2.6 : bouton envoyer la planification sur la douchette -->
|
||||
<button id="douchette-btn" class="btn btn-action" title="Envoyer la planification sur la douchette des techniciens">
|
||||
<span class="btn-action-emoji">🎯</span>
|
||||
<span class="btn-action-label">Douchette</span>
|
||||
</button>
|
||||
<button id="refresh-partial-btn" class="btn btn-refresh" title="Actualiser : ajoute les nouvelles interventions et retire celles qui ne sont plus dans le planning. Rapide, ne re-télécharge pas les fiches déjà connues.">
|
||||
<svg id="refresh-partial-icon" class="btn-refresh-icon" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M2 8a6 6 0 0 1 10.2-4.24M14 3v3h-3" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
||||
<span class="btn-refresh-label">Actualiser</span>
|
||||
@@ -49,12 +64,24 @@
|
||||
<span class="session-banner-icon">⚠</span>
|
||||
<span class="session-banner-text">
|
||||
<strong>Session EasyVista expirée.</strong>
|
||||
Les mises à jour sont interrompues. Reconnectez-vous à EasyVista, puis cliquez sur <b>Tout recharger</b> pour rafraîchir.
|
||||
Données affichées depuis le cache. Reconnectez-vous à EasyVista pour rafraîchir.
|
||||
</span>
|
||||
<button id="session-banner-reconnect" class="btn btn-primary btn-sm">Ouvrir EasyVista</button>
|
||||
<button id="session-banner-close" class="btn btn-icon" title="Masquer">×</button>
|
||||
</div>
|
||||
|
||||
<!-- v4.2.5 : Bannière EasyVista inaccessible (non bloquante, avec cache) -->
|
||||
<div id="ev-unreachable-banner" class="session-banner ev-banner hidden">
|
||||
<span class="session-banner-icon">⚠</span>
|
||||
<span class="session-banner-text">
|
||||
<strong>EasyVista est inaccessible.</strong>
|
||||
Données affichées depuis le cache.
|
||||
</span>
|
||||
<button id="ev-unreachable-banner-retry" class="btn btn-primary btn-sm">Réessayer</button>
|
||||
<button id="ev-unreachable-banner-open" class="btn btn-sm">Ouvrir EasyVista</button>
|
||||
<button id="ev-unreachable-banner-close" class="btn btn-icon" title="Masquer">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Barre de progression (visible uniquement pendant un refresh actif) -->
|
||||
<div id="progress-bar" class="progress-bar hidden">
|
||||
<div class="progress-bar-fill" id="progress-bar-fill"></div>
|
||||
|
||||
Reference in New Issue
Block a user