Préparer la version 1.0.0-rc.4

This commit is contained in:
Alexandre NOEL 2026-09-07 14:15:45 +02:00
commit 6e3beea211
38 changed files with 388 additions and 56 deletions

View file

@ -10,13 +10,18 @@ foreach (['unknown','stray_found','unwanted_litter','owner_health','owner_death'
$intakeReasonLabels[$key] = t('statistics.reason.' . $key);
}
$distributionLabels = ['Femelles' => t('statistics.value.females'),'Mâles' => t('statistics.value.males'),'Inconnu' => t('statistics.value.unknown'),'Non renseigné' => t('statistics.value.not_provided'),'Non renseignée' => t('statistics.value.not_provided_f'),'Moins d’un an' => t('statistics.value.under_year'),'1 à 2 ans' => t('statistics.value.one_two_years'),'3 à 7 ans' => t('statistics.value.three_seven_years'),'8 ans et plus' => t('statistics.value.eight_plus'),'Moins d’un mois' => t('statistics.value.under_month'),'1 à 3 mois' => t('statistics.value.one_three_months'),'3 à 6 mois' => t('statistics.value.three_six_months'),'6 à 12 mois' => t('statistics.value.six_twelve_months'),'Plus d’un an' => t('statistics.value.over_year'),'Chats' => t('statistics.value.cats'),'Chiens' => t('statistics.value.dogs'),'Inconnue' => t('statistics.value.unknown_f'),'Refuge' => t('status.refuge'),'Famille d’accueil' => t('status.fa'),'Accueil permanent' => t('statistics.value.permanent_foster'),'Chats libres suivis' => t('statistics.free_cats'),'Quarantaine' => t('status.quarantaine'),'Infirmerie' => t('status.soin'),'Réservé' => t('status.reserve'),'Site non renseigné' => t('statistics.value.unprovided_site')];
$speciesLabels = ['unknown' => t('statistics.value.unknown_f')];
foreach (SpeciesService::all(false) as $speciesOption) {
$speciesLabels[(string)$speciesOption['code']] = (string)$speciesOption['name'];
}
$groups = [
[t('statistics.intake_modes'),$distributions['intakeTypes'],$intakeTypeLabels,'green'],
[t('statistics.intake_reasons'),$distributions['intakeReasons'],$intakeReasonLabels,'orange'],
[t('statistics.colors'),$distributions['colors'],[],'blue'],
[t('statistics.breeds'),$distributions['breeds'],[],'purple'],
[t('statistics.species'),$distributions['species'],[],'cyan'],
[t('statistics.sex'),$distributions['sex'],[],'pink'],
[t('statistics.colors'),$distributions['colors'],[],'blue','color'],
[t('statistics.breeds'),$distributions['breeds'],[],'purple','breed'],
[t('statistics.hair_types'),$distributions['hairTypes'] ?? [],[],'azure','hair_type'],
[t('statistics.species'),$distributions['species'],$speciesLabels,'cyan','species'],
[t('statistics.sex'),$distributions['sex'],[],'pink','sex'],
[t('statistics.age_at_entry'),$distributions['ages'],[],'orange'],
[t('statistics.origins'),$distributions['origins'],[],'green','municipality'],
[t('statistics.adoption_delay'),$distributions['stays'],[],'azure'],
@ -312,11 +317,18 @@ if (empty($costs['by_clinic'])):?><span class="text-muted"><?= h(t('statistics.n
<?php foreach ($items as $label => $total): $display = $labels[$label] ?? $distributionLabels[$label] ?? $label;
$width = $maximum > 0 ? max(4, round($total / $maximum * 100)) : 0;
$pct = $sum > 0 ? round($total / $sum * 100) : 0;
$cityUrl = '/statistics?' . http_build_query(['year' => $allYears ? 'all' : $year,'municipality' => $label]); ?><div>
$cityUrl = '/statistics?' . http_build_query(['year' => $allYears ? 'all' : $year,'municipality' => $label]);
$filterValue = $linkType === 'sex' ? match ((string)$label) {
'Femelles' => 'F', 'Mâles' => 'M', default => ''
} : (string)$label;
$animalUrl = $linkType === 'species'
? '/animals?' . http_build_query(['status' => '', 'species' => SpeciesService::normalize((string)$label)])
: '/animals?' . http_build_query(['status' => '', 'attribute' => $linkType, 'value' => $filterValue]); ?><div>
<div class="d-flex justify-content-between gap-3 mb-1">
<?php if ($linkType === 'municipality' && $municipality === ''): ?><a
class="text-truncate fw-semibold" href="<?= h($cityUrl) ?>"
title="<?= h(t('statistics.show_city', ['city' => $display])) ?>"><?= h($display) ?></a><?php else: ?><span
title="<?= h(t('statistics.show_city', ['city' => $display])) ?>"><?= h($display) ?></a><?php elseif (in_array($linkType, ['color','breed','hair_type','species','sex'], true) && !str_starts_with((string)$label, 'Non renseign') && $filterValue !== ''): ?><a
class="text-truncate fw-semibold" href="<?= h($animalUrl) ?>"><?= h($display) ?></a><?php else: ?><span
class="text-truncate"
title="<?= h($display) ?>"><?= h($display) ?></span><?php endif; ?><strong
class="text-nowrap"><?= (int)$total ?> <span