wiki = $wiki; $this->params = $params; $this->entryManager = $entryManager; $this->listManager = $listManager; $this->authController = $authController; $meeo_config = $this->params->get('meeo'); $this->formId = $meeo_config['notesFormId']; $this->eleveFormId = $meeo_config['elevesFormId']; } public function viewBulletins() { $eleveManager = $this->wiki->services->get(EleveManager::class); $username = $this->authController->getLoggedUserName(); // echo "
".$username."
"; include 'tools/meeo/libs/bulletin/Bulletin.lib.php'; $currentEleve = $eleveManager->getCurrentEleve($username); // echo "".var_dump($currentEleve)."
"; // if ($currentEleve == null) { $eleves = $eleveManager->getAll(); // $eleves = $ $this->entryManager->search(['formsIds' => $meeo_config['elevesFormId']]); // $entries = $this->entryManager->search(['formsIds' => $this->formId]); $bulletins = []; foreach ( $eleves as $eleve) { //TODO enlever "Passerelle" $bulletin = new Bulletin($this->wiki, $eleve, "Passerelle"); if ($bulletin->isVisible()) $bulletins[] = $bulletin; } // echo "".var_dump($eleves)."
"; // echo "".var_dump($entries)."
"; // echo "".var_dump($bulletins)."
"; return $this->wiki->render('@meeo/edu_notes.twig', [ "bulletins" => $bulletins, ]); // } else { // $bulletin = new Bulletin($this->wiki, $currentEleve); // return $this->wiki->render('@meeo/eleve_notes.twig', [ // "bulletin" => $bulletin, // ]); // } } public function viewControle() { $eleves = $this->wiki->services->get(EleveManager::class)->getAll(); // echo var_dump($eleves); $matieres = $this->listManager->getOne('ListeMatiere'); // echo var_dump($matieres); $classes = $this->listManager->getOne('ListeClasses'); // echo var_dump($classes); return $this->wiki->render('@meeo/edu_controle.twig', ['matieres' => $matieres['nodes'], 'classes' => $classes['nodes'], 'eleves' => $eleves]); } public function createNote($intitule, $eleve, $matiere, $note, $coef) { $note = [ 'bf_titre' => "Note : ".$intitule." - ".$eleve." - ".$matiere, 'bf_intitule' => $intitule, 'listeListeMatierebf_matiere' => $matiere, 'listefiche'.$this->eleveFormId.'bf_eleve' => $eleve, 'bf_note' => $note, 'bf_coef' => $coef, 'antispam' => true ]; $this->entryManager->create($this->formId, $note); } public function getNotes($eleveId, $matiereId) { echo "".$eleveId."
"; echo "".$matiereId."
"; $entries = $this->entryManager->search(['formsIds' => $this->formId, 'queries' =>[ 'listefiche'.$this->eleveFormId.'bf_eleve' => \strtolower($eleveId), 'listeListeMatierebf_matiere' => $matiereId ] ]); // echo "".var_dump($entries)."
"; return $entries; } }