diff --git a/actions/ControleAction.php b/actions/ControleAction.php new file mode 100644 index 0000000..65a181a --- /dev/null +++ b/actions/ControleAction.php @@ -0,0 +1,20 @@ +getService(NoteManager::class); + return $noteManager->viewControle(); + } +} \ No newline at end of file diff --git a/actions/NotesAction.php b/actions/NotesAction.php index e306fce..46b409e 100644 --- a/actions/NotesAction.php +++ b/actions/NotesAction.php @@ -15,7 +15,6 @@ class NotesAction extends YesWikiAction public function run() { $noteManager = $this->getService(NoteManager::class); - // $noteManager->viewBulletins(); - $noteManager->viewCreateNotes(); + $noteManager->viewBulletins(); } } diff --git a/actions/documentation.yaml b/actions/documentation.yaml index 5fa4167..b1bc44d 100644 --- a/actions/documentation.yaml +++ b/actions/documentation.yaml @@ -9,4 +9,7 @@ actions: eleves: label: Eleves description: Liste des élèves + controle: + label: Controle + description: Affiche les informations d'un controle # La liste des actions de ce groupe \ No newline at end of file diff --git a/libs/controle/Controle.lib.php b/libs/controle/Controle.lib.php new file mode 100644 index 0000000..21c40bb --- /dev/null +++ b/libs/controle/Controle.lib.php @@ -0,0 +1,18 @@ +wiki = $wiki; + $this->intitule = $intitule; + $this->matiere = $matiere; + $this->coef = $coef; + } +} \ No newline at end of file diff --git a/services/EleveManager.php b/services/EleveManager.php index 65fa12b..9fb68c3 100644 --- a/services/EleveManager.php +++ b/services/EleveManager.php @@ -31,8 +31,12 @@ class EleveManager { return $this->entryManager->update($id, ['listeListeClassesbf_classe' => $classe, 'antispam' => true]); } + public function getAll() { + return $this->entryManager->search(['formsIds' => $this->formId]); + } + public function view() { - $eleves = $this->entryManager->search(['formsIds' => $this->formId]); + $eleves = $this->getAll(); // echo '
'.var_dump($eleves).'
'; $classes = $this->listManager->getOne('ListeClasses'); diff --git a/services/NoteManager.php b/services/NoteManager.php index ebf3d94..035eb01 100644 --- a/services/NoteManager.php +++ b/services/NoteManager.php @@ -8,6 +8,7 @@ use YesWiki\Bazar\Service\ListManager; use YesWiki\Core\Service\UserManager; use YesWiki\Wiki; use YesWiki\Meeo\Bulletin\Bulletin; +use YesWiki\Meeo\Service\EleveManager; class NoteManager { protected $wiki; @@ -39,6 +40,7 @@ class NoteManager { $bulletins = []; foreach ( $eleves as $eleve) { + //TODO enlever "Passerelle" $bulletins[] = new Bulletin($this->wiki, $eleve, "Passerelle"); } // echo var_dump($eleves); @@ -56,7 +58,14 @@ class NoteManager { } } - public function viewCreateNotes() { - return $this->wiki->render('@meeo/edu_create_notes.twig', []); + 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['label'], 'classes' => $classes['label'], 'eleves' => $eleves]); } } \ No newline at end of file diff --git a/templates/edu_controle.twig b/templates/edu_controle.twig new file mode 100644 index 0000000..cf1c5ea --- /dev/null +++ b/templates/edu_controle.twig @@ -0,0 +1,46 @@ + \ No newline at end of file diff --git a/templates/edu_create_notes.twig b/templates/edu_create_notes.twig deleted file mode 100644 index e69de29..0000000