Retrait des cumuls « Consommation globale » et « Reste à affecter » du tableau de bord

Ces deux cartes additionnaient les heures de tous les agents suivis, quotités
confondues : le pourcentage et le solde obtenus ne décrivaient la situation
d'aucun agent réel et n'appelaient aucune action. Le bloc « Suivi des quotas
annuels » conserve les indicateurs actionnables (agents suivis, agents sans
aucune heure) et le tableau agent par agent.

Les agrégats correspondants sont retirés du payload de api/dashboard_summary.php
et de leur calcul dans DashboardController : plus aucun consommateur ne les lit.
La tuile « Quotas dépassés » et son compteur de dépassements sont inchangés.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
PTA
2026-08-11 15:09:15 +02:00
parent b13b52b22b
commit 935cc3ea1c
6 changed files with 9 additions and 36 deletions

View File

@@ -186,28 +186,24 @@ final class DashboardController
} }
/** /**
* Suivi des quotas : combien d'agents dépassent leur quota annuel, combien * Suivi des quotas : combien d'agents dépassent leur quota annuel et combien
* n'ont encore aucune heure planifiée, et le volume restant à affecter. * n'ont encore aucune heure planifiée. Les cumuls tous agents confondus
* (consommation globale, reste à affecter) ne sont volontairement pas exposés :
* une somme d'agents aux quotités différentes ne décrit aucune situation réelle.
*/ */
private function quotaPayload(int $year): array private function quotaPayload(int $year): array
{ {
$tracking = $this->dashboardModel->quotaTracking($year); $tracking = $this->dashboardModel->quotaTracking($year);
$overCount = 0; $overCount = 0;
$emptyCount = 0; $emptyCount = 0;
$remainingMinutes = 0;
$targetMinutes = 0;
$allocatedMinutes = 0;
foreach ($tracking as $agent) { foreach ($tracking as $agent) {
$targetMinutes += $agent['quota_cible_minutes'];
$allocatedMinutes += $agent['minutes_affectees'];
if ($agent['minutes_restantes'] < 0) { if ($agent['minutes_restantes'] < 0) {
$overCount++; $overCount++;
} }
if ($agent['minutes_affectees'] === 0) { if ($agent['minutes_affectees'] === 0) {
$emptyCount++; $emptyCount++;
} }
$remainingMinutes += max(0, $agent['minutes_restantes']);
} }
// Tri décroissant sur le taux : les dépassements remontent en tête, // Tri décroissant sur le taux : les dépassements remontent en tête,
@@ -221,10 +217,6 @@ final class DashboardController
'agent_count' => count($tracking), 'agent_count' => count($tracking),
'depassement_count' => $overCount, 'depassement_count' => $overCount,
'sans_heure_count' => $emptyCount, 'sans_heure_count' => $emptyCount,
'minutes_restantes' => $remainingMinutes,
'minutes_cible' => $targetMinutes,
'minutes_affectees' => $allocatedMinutes,
'taux_global' => $targetMinutes > 0 ? round(($allocatedMinutes / $targetMinutes) * 100, 1) : 0.0,
'apercu' => array_slice($tracking, 0, self::QUOTA_APERCU_MAX), 'apercu' => array_slice($tracking, 0, self::QUOTA_APERCU_MAX),
]; ];
} }

View File

@@ -28,10 +28,10 @@ window.PTA_PAGE_CONFIG = <?= json_encode([
'params' => $pageConfig, 'params' => $pageConfig,
], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>; ], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>;
</script> </script>
<script src="assets/js/core.js?v=7.10"></script> <script src="assets/js/core.js?v=7.11"></script>
<?php foreach ($scripts as $script): ?> <?php foreach ($scripts as $script): ?>
<script src="assets/js/<?= htmlspecialchars($script) ?>?v=7.10"></script> <script src="assets/js/<?= htmlspecialchars($script) ?>?v=7.11"></script>
<?php endforeach; ?> <?php endforeach; ?>
<script src="assets/js/page-bootstrap.js?v=7.10"></script> <script src="assets/js/page-bootstrap.js?v=7.11"></script>
</body> </body>
</html> </html>

View File

@@ -67,7 +67,7 @@ $showGroupLabels = $visiblePageCount > 4;
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars($pageTitle) ?> — PTA</title> <title><?= htmlspecialchars($pageTitle) ?> — PTA</title>
<link rel="stylesheet" href="assets/style.css?v=7.10"> <link rel="stylesheet" href="assets/style.css?v=7.11">
</head> </head>
<body> <body>
<main class="app-shell"> <main class="app-shell">

View File

@@ -12,7 +12,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Choisir votre accès — PTA</title> <title>Choisir votre accès — PTA</title>
<link rel="stylesheet" href="assets/style.css?v=7.10"> <link rel="stylesheet" href="assets/style.css?v=7.11">
</head> </head>
<body class="role-page-body"> <body class="role-page-body">
<main class="role-page-shell"> <main class="role-page-shell">

View File

@@ -92,16 +92,6 @@
<strong id="dashboard-quota-agents">—</strong> <strong id="dashboard-quota-agents">—</strong>
<small>actifs</small> <small>actifs</small>
</article> </article>
<article class="summary-card">
<span>Consommation globale</span>
<strong id="dashboard-quota-rate">—</strong>
<small id="dashboard-quota-rate-detail">du quota cumulé</small>
</article>
<article class="summary-card">
<span>Reste à affecter</span>
<strong id="dashboard-quota-remaining">—</strong>
<small>hors agents déjà au-delà</small>
</article>
<article class="summary-card"> <article class="summary-card">
<span>Sans aucune heure</span> <span>Sans aucune heure</span>
<strong id="dashboard-quota-empty">—</strong> <strong id="dashboard-quota-empty">—</strong>

View File

@@ -34,9 +34,6 @@
quotaTile: document.querySelector('#dashboard-tile-quota'), quotaTile: document.querySelector('#dashboard-tile-quota'),
quotaSubtitle: document.querySelector('#dashboard-quota-subtitle'), quotaSubtitle: document.querySelector('#dashboard-quota-subtitle'),
quotaAgents: document.querySelector('#dashboard-quota-agents'), quotaAgents: document.querySelector('#dashboard-quota-agents'),
quotaRate: document.querySelector('#dashboard-quota-rate'),
quotaRateDetail: document.querySelector('#dashboard-quota-rate-detail'),
quotaRemaining: document.querySelector('#dashboard-quota-remaining'),
quotaEmptyAgents: document.querySelector('#dashboard-quota-empty'), quotaEmptyAgents: document.querySelector('#dashboard-quota-empty'),
quotaBody: document.querySelector('#dashboard-quota-body'), quotaBody: document.querySelector('#dashboard-quota-body'),
quotaEmptyState: document.querySelector('#dashboard-quota-empty-state'), quotaEmptyState: document.querySelector('#dashboard-quota-empty-state'),
@@ -232,12 +229,6 @@
`Année civile ${quota.annee} · heures validées et brouillon comprises, motifs décomptés uniquement.`; `Année civile ${quota.annee} · heures validées et brouillon comprises, motifs décomptés uniquement.`;
} }
if (elements.quotaAgents) elements.quotaAgents.textContent = String(quota.agent_count || 0); if (elements.quotaAgents) elements.quotaAgents.textContent = String(quota.agent_count || 0);
if (elements.quotaRate) elements.quotaRate.textContent = `${Number(quota.taux_global || 0)} %`;
if (elements.quotaRateDetail) {
elements.quotaRateDetail.textContent =
`${formatDuration(Number(quota.minutes_affectees || 0))} sur ${formatDuration(Number(quota.minutes_cible || 0))}`;
}
if (elements.quotaRemaining) elements.quotaRemaining.textContent = formatDuration(Number(quota.minutes_restantes || 0));
if (elements.quotaEmptyAgents) elements.quotaEmptyAgents.textContent = String(quota.sans_heure_count || 0); if (elements.quotaEmptyAgents) elements.quotaEmptyAgents.textContent = String(quota.sans_heure_count || 0);
const items = Array.isArray(quota.apercu) ? quota.apercu : []; const items = Array.isArray(quota.apercu) ? quota.apercu : [];