[Absences] Display the realname

This commit is contained in:
mckmonster 2024-07-04 09:27:29 +02:00
parent c1fdd1100c
commit 94f2d3a898
2 changed files with 10 additions and 5 deletions

View file

@ -15,13 +15,18 @@ class AbsencesAction extends YesWikiAction
$entryManager = $this->getService(EntryManager::class); $entryManager = $this->getService(EntryManager::class);
$entries = $entryManager->search(['formsIds' => '6']); $entries = $entryManager->search(['formsIds' => '6']);
$grouped_entries = []; $grouped_entries = [];
foreach ($entries as $entry) { foreach ($entries as $entry) {
$identifier = $entry['listefiche5bf_eleve']; $identifier = $entry['listefiche5bf_eleve'];
$nom = $entryManager->getOne($identifier)['bf_nom'];
if (!isset($grouped_entries[$identifier])) { 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', [ return $this->render('@meeo/absences.twig', [

View file

@ -1,13 +1,13 @@
<div id="accordion" class="panel-group" role="tablist" aria-multiselectable="true"> <div id="accordion" class="panel-group" role="tablist" aria-multiselectable="true">
{% for identifier, entries in groups %} {% for identifier, group in groups %}
<div class="panel"> <div class="panel">
<button id="head_{{ identifier }}" class="panel-heading collapsed" data-parent="#accordion" data-target="#{{ identifier }}" data-toggle="collapse" aria-expanded="false"> <button id="head_{{ identifier }}" class="panel-heading collapsed" data-parent="#accordion" data-target="#{{ identifier }}" data-toggle="collapse" aria-expanded="false">
<h4 class="panel-title">{{ identifier }}</h4> <h4 class="panel-title">{{ group['nom'] }}</h4>
</button> </button>
<div id="{{ identifier }}" class="panel-collapse collapse" aria-expanded="false"> <div id="{{ identifier }}" class="panel-collapse collapse" aria-expanded="false">
<div class="panel-body"> <div class="panel-body">
<ul> <ul>
{% for entry in entries %} {% for entry in group['entries'] %}
<li> <li>
<div> <div>
{{ entry['bf_date_debut_evenement'] }} {{ entry['bf_date_debut_evenement'] }}