diff --git a/liste_contacts.html b/liste_contacts.html index 1c77560..44b70d8 100644 --- a/liste_contacts.html +++ b/liste_contacts.html @@ -12,6 +12,11 @@ :root{ --gris-fonce:#484848; --orange:#FF5A1F; + /* Bleu badge/avatar (29 août 2026) : couleur commune au badge société et + à l'avatar (Jean-Marc a confirmé l'avatar réellement gris en + production — --gris-fonce reste donc défini et utilisé ailleurs dans + la feuille — puis a demandé d'unifier les deux en bleu). */ + --bleu-badge:#2E5AAC; --gris-clair:#C7C7C7; --zebra-jaune:#F7F3E3; --zebra-bleu:#E7EAF2; @@ -72,11 +77,27 @@ #bandeau-spacer{flex:1;} #avatar{ width:28px;height:28px;border-radius:50%; - background:var(--gris-fonce);color:#FFFFFF; + background:var(--bleu-badge);color:#FFFFFF; display:flex;align-items:center;justify-content:center; font-weight:700;font-size:10px;cursor:default; border:1px solid rgba(0,0,0,0.2); + margin-left:6px; } + /* Badge société (29 août 2026) : repère visuel d'environnement, à gauche + de l'avatar. "Bouton" non cliquable (cursor:default, pas de hover) — + forme pilule plutôt que le disque de l'avatar, pour bien distinguer les + deux informations (société vs utilisateur) tout en les regroupant + visuellement. Masqué (display:none) si USR_Societe est vide en base + pour l'utilisateur connecté — voir chargerPreferences(). */ + #badge-societe{ + height:20px;padding:0 10px;border-radius:10px; + background:var(--bleu-badge);color:#FFFFFF; + display:flex;align-items:center;justify-content:center; + font-weight:700;font-size:10px;letter-spacing:0.3px;cursor:default; + border:1px solid rgba(0,0,0,0.2); + white-space:nowrap; + } + #badge-societe[hidden]{display:none;} /* -------- En-tête colonnes -------- */ #entete-colonnes{ @@ -599,7 +620,8 @@
ASPIC
LISTE DES CONTACTS
-
JMP
+ +
@@ -1714,6 +1736,24 @@ async function chargerPreferences(){ const data = await reponse.json(); if(typeof data.USR_RatioPanneauContact === "number") PREFERENCES.USR_RatioPanneauContact = data.USR_RatioPanneauContact; if(typeof data.USR_RatioPanneauProspect === "number") PREFERENCES.USR_RatioPanneauProspect = data.USR_RatioPanneauProspect; + + // Avatar (29 août 2026) : jusqu'ici du texte figé "JMP" dans le HTML, + // jamais vraiment branché sur la session — corrigé au passage à + // l'occasion du badge société ci-dessous (voir journal). + const elAvatar = document.getElementById("avatar"); + if(elAvatar && data.USR_Code) elAvatar.textContent = data.USR_Code; + + // Badge société (29 août 2026) : repère d'environnement, masqué si + // l'utilisateur connecté n'a pas encore de USR_Societe renseignée. + const elBadge = document.getElementById("badge-societe"); + if(elBadge){ + if(data.USR_Societe){ + elBadge.textContent = data.USR_Societe; + elBadge.hidden = false; + } else { + elBadge.hidden = true; + } + } } catch(erreur){ console.error("Erreur de chargement de preferences.php :", erreur); // Pas de toast : une préférence d'affichage non chargée retombe sur le diff --git a/preferences.php b/preferences.php index 875e222..d31de29 100644 --- a/preferences.php +++ b/preferences.php @@ -1,10 +1,11 @@ prepare( - 'SELECT USR_RatioPanneauContact, USR_RatioPanneauProspect FROM ASP_Users WHERE USR_Code = ?' + 'SELECT USR_Code, USR_Societe, USR_RatioPanneauContact, USR_RatioPanneauProspect FROM ASP_Users WHERE USR_Code = ?' ); $stmt->execute([$_SESSION['USR_Code']]); $ligne = $stmt->fetch(); @@ -56,6 +60,8 @@ try { exit; } echo json_encode([ + 'USR_Code' => $ligne['USR_Code'], + 'USR_Societe' => $ligne['USR_Societe'], 'USR_RatioPanneauContact' => (int)$ligne['USR_RatioPanneauContact'], 'USR_RatioPanneauProspect' => (int)$ligne['USR_RatioPanneauProspect'], ]); diff --git a/version.php b/version.php index 1bcf588..0813337 100644 --- a/version.php +++ b/version.php @@ -20,7 +20,7 @@ * d'identification, avant toute connexion. */ -const ASPIC_VERSION = 'V1.000'; +const ASPIC_VERSION = 'V1.001'; if (basename($_SERVER['SCRIPT_NAME']) === 'version.php') { header('Content-Type: application/json; charset=utf-8');