diff --git a/CHANGELOG.md b/CHANGELOG.md index e29c827..7a4a30a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Toutes les modifications importantes du projet sont consignées ici. Le format s’inspire de [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/) et le projet suit le [versionnage sémantique](https://semver.org/lang/fr/). +## [1.0.0-rc.21] — 2026-09-15 + +### Suivi de la température + +- ajout de la température à chaque contrôle d’animal pendant une tournée, préremplie à 38,5 °C et modifiable ; +- validation des températures enregistrées entre 30 et 45 °C ; +- regroupement du poids et de la température dans un graphique médical commun, avec une échelle dédiée à chaque unité ; +- reprise dans la courbe des températures saisies dans les notes médicales et pendant les tournées. + ## [1.0.0-rc.20] — 2026-09-13 ### Localisation des animaux diff --git a/HISTORIQUE.md b/HISTORIQUE.md index 29736fe..e2934d6 100644 --- a/HISTORIQUE.md +++ b/HISTORIQUE.md @@ -89,3 +89,7 @@ Ajout d’une date et d’une heure modifiables aux contrôles médicaux, avec r ## `1.0.0-rc.20` — Localisations cohérentes Simplification des lieux affichés dans la fiche, conservation de l’adresse actuelle et réparation des coordonnées manquantes après un import ou un placement. + +## `1.0.0-rc.21` — Température pendant les tournées + +Ajout d’une température préremplie à 38,5 °C lors du contrôle de chaque animal et affichage conjoint des courbes de poids et de température dans son dossier médical. diff --git a/README.md b/README.md index 914bc81..45914f2 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ L’option `--apply` ne doit être utilisée qu’après lecture des rapports. L ## État du projet -La candidate actuelle est `1.0.0-rc.20`. La branche 1.0 est gelée fonctionnellement : seuls les défauts bloquants découverts pendant les validations terrain sont corrigés avant `1.0.0`. +La candidate actuelle est `1.0.0-rc.21`. La branche 1.0 est gelée fonctionnellement : seuls les défauts bloquants découverts pendant les validations terrain sont corrigés avant `1.0.0`. Le contrôle de stabilisation est disponible dans [docs/AUDIT-1.0.md](docs/AUDIT-1.0.md). diff --git a/VERSION b/VERSION index dca2922..fee2ed6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0-rc.20 +1.0.0-rc.21 diff --git a/app/Controllers/AnimalBrowseActions.php b/app/Controllers/AnimalBrowseActions.php index 86e657b..845e5f9 100644 --- a/app/Controllers/AnimalBrowseActions.php +++ b/app/Controllers/AnimalBrowseActions.php @@ -704,6 +704,21 @@ trait AnimalBrowseActions $weightsStmt->execute([':id' => $id]); $weights = $weightsStmt->fetchAll(); + $temperaturesStmt = $db->prepare(" + SELECT measured_at, value FROM ( + SELECT noted_at AS measured_at, temperature_c AS value + FROM medical_notes + WHERE animal_id = :medical_id AND temperature_c IS NOT NULL + UNION ALL + SELECT observation.checked_at AS measured_at, observation.temperature_c AS value + FROM care_round_observations observation + WHERE observation.animal_id = :round_id AND observation.temperature_c IS NOT NULL + ) + ORDER BY datetime(measured_at) ASC + "); + $temperaturesStmt->execute([':medical_id' => $id, ':round_id' => $id]); + $temperatures = $temperaturesStmt->fetchAll(PDO::FETCH_ASSOC); + $stmt = $db->prepare(" SELECT value FROM measurements @@ -952,6 +967,7 @@ trait AnimalBrowseActions 'adopters' => $adopters, 'death' => $death, 'weights' => $weights, + 'temperatures' => $temperatures, 'lastWeight' => $lastWeight, 'prevWeight' => $prevWeight, 'photos' => $photos, diff --git a/app/Controllers/CareRoundsController.php b/app/Controllers/CareRoundsController.php index 64d74ad..5e899b1 100644 --- a/app/Controllers/CareRoundsController.php +++ b/app/Controllers/CareRoundsController.php @@ -139,6 +139,18 @@ final class CareRoundsController $value = (string) ($_POST[$field] ?? $opts[0]); $values[$field] = in_array($value, $opts, true) ? $value : $opts[0]; } + $temperatureInput = str_replace(',', '.', trim((string) ($_POST['temperature_c'] ?? ''))); + if (!is_numeric($temperatureInput)) { + http_response_code(400); + echo h(t('care.invalid_temperature')); + return; + } + $temperature = (float) $temperatureInput; + if ($temperature < 30 || $temperature > 45) { + http_response_code(400); + echo h(t('care.invalid_temperature')); + return; + } $db->prepare( 'UPDATE care_rounds SET performed_by_user_id=COALESCE(performed_by_user_id,:user) WHERE id=:id', )->execute([':user' => Auth::id(), ':id' => $roundId]); @@ -220,7 +232,7 @@ final class CareRoundsController $db->beginTransaction(); try { $stmt = $db->prepare( - "INSERT INTO care_round_observations(round_id,animal_id,food,water,urine,stool,general_state,comment,alert_signature) VALUES(:round,:animal,:food,:water,:urine,:stool,:general,:comment,:signature) ON CONFLICT(round_id,animal_id) DO UPDATE SET food=excluded.food,water=excluded.water,urine=excluded.urine,stool=excluded.stool,general_state=excluded.general_state,comment=excluded.comment,alert_signature=excluded.alert_signature,checked_at=datetime('now')", + "INSERT INTO care_round_observations(round_id,animal_id,food,water,urine,stool,general_state,temperature_c,comment,alert_signature) VALUES(:round,:animal,:food,:water,:urine,:stool,:general,:temperature,:comment,:signature) ON CONFLICT(round_id,animal_id) DO UPDATE SET food=excluded.food,water=excluded.water,urine=excluded.urine,stool=excluded.stool,general_state=excluded.general_state,temperature_c=excluded.temperature_c,comment=excluded.comment,alert_signature=excluded.alert_signature,checked_at=datetime('now')", ); $stmt->execute([ ':round' => $roundId, @@ -230,6 +242,7 @@ final class CareRoundsController ':urine' => $values['urine'], ':stool' => $values['stool'], ':general' => $values['general_state'], + ':temperature' => $temperature, ':comment' => $comment ?: null, ':signature' => $signature, ]); diff --git a/app/Views/_animal_show_medical.php b/app/Views/_animal_show_medical.php index 4bb698e..75a4211 100644 --- a/app/Views/_animal_show_medical.php +++ b/app/Views/_animal_show_medical.php @@ -235,14 +235,14 @@