params->get('meeo'); $formId = $meeo_config['absencesFormId']; $eleveIdentifier = 'listefiche'.$meeo_config['elevesFormId'].'bf_eleve'; $groupeEE = $meeo_config['groupeEE']; $entryManager = $this->getService(EntryManager::class); $userManager = $this->getService(UserManager::class); $elevemanager = $this->getService(EleveManager::class); if ( $userManager->isInGroup($groupeEE, admincheck: false) ) { $entries = $entryManager->search(['formsIds' => $formId]); $grouped_entries = []; foreach ($entries as $entry) { // echo "
".var_dump($entry)."
"; $identifier = $entry[$eleveIdentifier]; //echo "".var_dump($identifier)."
"; $eleve = $elevemanager->getEleve($identifier); // echo "".var_dump($eleve)."
"; $nom = $eleve->getNom(); if (!isset($grouped_entries[$identifier])) { $grouped_entries[$identifier] = [ 'nom' => $nom, 'entries' => [] ]; } $grouped_entries[$identifier]['entries'][] = $entry; } return $this->render('@meeo/edu_absences.twig', [ "groups" => $grouped_entries, ]); } else { $username = $userManager->getLoggedUsername(); $eleves = $elevemanager->getAll(); foreach ($eleves as $eleve) { if ($eleve->getNom() == $username) { $selectedEleve = $eleve; } } $identifier = $selectedEleve->getId(); // echo "".var_dump($selectedEleve)."
"; $entries = $entryManager->search(['formsIds' => $formId, 'queries' => [ $eleveIdentifier => $identifier]]); return $this->render('@meeo/eleve_absences.twig', [ "entries" => $entries, ]); } } }