From 94f2d3a89895b64169f1d98715b78164d463e1fe Mon Sep 17 00:00:00 2001 From: mckmonster Date: Thu, 4 Jul 2024 09:27:29 +0200 Subject: [PATCH] [Absences] Display the realname --- actions/AbsencesAction.php | 9 +++++++-- templates/absences.twig | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/actions/AbsencesAction.php b/actions/AbsencesAction.php index a5cd9d7..60126a1 100644 --- a/actions/AbsencesAction.php +++ b/actions/AbsencesAction.php @@ -15,13 +15,18 @@ class AbsencesAction extends YesWikiAction $entryManager = $this->getService(EntryManager::class); $entries = $entryManager->search(['formsIds' => '6']); + $grouped_entries = []; foreach ($entries as $entry) { $identifier = $entry['listefiche5bf_eleve']; + $nom = $entryManager->getOne($identifier)['bf_nom']; if (!isset($grouped_entries[$identifier])) { - $grouped_entries[$identifier] = []; + $grouped_entries[$identifier] = [ + 'nom' => $nom, + 'entries' => [] + ]; } - $grouped_entries[$identifier][] = $entry; + $grouped_entries[$identifier]['entries'][] = $entry; } return $this->render('@meeo/absences.twig', [ diff --git a/templates/absences.twig b/templates/absences.twig index 9c69bc1..1df7eae 100644 --- a/templates/absences.twig +++ b/templates/absences.twig @@ -1,13 +1,13 @@
-{% for identifier, entries in groups %} +{% for identifier, group in groups %}