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:
@@ -186,28 +186,24 @@ final class DashboardController
|
||||
}
|
||||
|
||||
/**
|
||||
* Suivi des quotas : combien d'agents dépassent leur quota annuel, combien
|
||||
* n'ont encore aucune heure planifiée, et le volume restant à affecter.
|
||||
* Suivi des quotas : combien d'agents dépassent leur quota annuel et combien
|
||||
* 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
|
||||
{
|
||||
$tracking = $this->dashboardModel->quotaTracking($year);
|
||||
$overCount = 0;
|
||||
$emptyCount = 0;
|
||||
$remainingMinutes = 0;
|
||||
$targetMinutes = 0;
|
||||
$allocatedMinutes = 0;
|
||||
|
||||
foreach ($tracking as $agent) {
|
||||
$targetMinutes += $agent['quota_cible_minutes'];
|
||||
$allocatedMinutes += $agent['minutes_affectees'];
|
||||
if ($agent['minutes_restantes'] < 0) {
|
||||
$overCount++;
|
||||
}
|
||||
if ($agent['minutes_affectees'] === 0) {
|
||||
$emptyCount++;
|
||||
}
|
||||
$remainingMinutes += max(0, $agent['minutes_restantes']);
|
||||
}
|
||||
|
||||
// Tri décroissant sur le taux : les dépassements remontent en tête,
|
||||
@@ -221,10 +217,6 @@ final class DashboardController
|
||||
'agent_count' => count($tracking),
|
||||
'depassement_count' => $overCount,
|
||||
'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),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ window.PTA_PAGE_CONFIG = <?= json_encode([
|
||||
'params' => $pageConfig,
|
||||
], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE) ?>;
|
||||
</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): ?>
|
||||
<script src="assets/js/<?= htmlspecialchars($script) ?>?v=7.10"></script>
|
||||
<script src="assets/js/<?= htmlspecialchars($script) ?>?v=7.11"></script>
|
||||
<?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>
|
||||
</html>
|
||||
|
||||
@@ -67,7 +67,7 @@ $showGroupLabels = $visiblePageCount > 4;
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<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>
|
||||
<body>
|
||||
<main class="app-shell">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<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>
|
||||
<body class="role-page-body">
|
||||
<main class="role-page-shell">
|
||||
|
||||
@@ -92,16 +92,6 @@
|
||||
<strong id="dashboard-quota-agents">—</strong>
|
||||
<small>actifs</small>
|
||||
</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">
|
||||
<span>Sans aucune heure</span>
|
||||
<strong id="dashboard-quota-empty">—</strong>
|
||||
|
||||
@@ -34,9 +34,6 @@
|
||||
quotaTile: document.querySelector('#dashboard-tile-quota'),
|
||||
quotaSubtitle: document.querySelector('#dashboard-quota-subtitle'),
|
||||
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'),
|
||||
quotaBody: document.querySelector('#dashboard-quota-body'),
|
||||
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.`;
|
||||
}
|
||||
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);
|
||||
|
||||
const items = Array.isArray(quota.apercu) ? quota.apercu : [];
|
||||
|
||||
Reference in New Issue
Block a user