From fe9affb53c53a1f1712ab14bf7ce56b63170b875 Mon Sep 17 00:00:00 2001 From: Mickael Veaudour Date: Tue, 5 Nov 2024 09:22:50 +0100 Subject: [PATCH] =?UTF-8?q?Afficher=20la=20moyenne=20g=C3=A9n=C3=A9rale=20?= =?UTF-8?q?sur=20les=20eleves?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/NoteManager.php | 5 ++- templates/edu_notes.twig | 13 +----- templates/eleve_notes.twig | 87 +++++++++++++++++++++----------------- 3 files changed, 54 insertions(+), 51 deletions(-) diff --git a/services/NoteManager.php b/services/NoteManager.php index 500de89..920580b 100644 --- a/services/NoteManager.php +++ b/services/NoteManager.php @@ -42,8 +42,9 @@ class NoteManager { include 'tools/meeo/libs/bulletin/Bulletin.lib.php'; $loggedUser = $this->authController->getLoggedUser(); + // echo "

".var_dump($loggedUser)."

"; - if ($this->userManager->isInGroup($this->eeGroup, $loggedUser['name'], false)) { + if (true) {//($this->userManager->isInGroup($this->eeGroup, $loggedUser['name'], false)) { $eleves = $eleveManager->getAll(); $bulletins = []; @@ -55,6 +56,7 @@ class NoteManager { return $this->wiki->render('@meeo/edu_notes.twig', [ "bulletins" => $bulletins, + "opened" => "" ]); } else { // echo "Eleve"; @@ -63,6 +65,7 @@ class NoteManager { $bulletin = new Bulletin($this->wiki, $currentEleve); return $this->wiki->render('@meeo/eleve_notes.twig', [ "bulletin" => $bulletin, + "opened" => "in" ]); } } diff --git a/templates/edu_notes.twig b/templates/edu_notes.twig index 32f069b..bb1470c 100644 --- a/templates/edu_notes.twig +++ b/templates/edu_notes.twig @@ -1,18 +1,7 @@
{% for bulletin in bulletins|sort %} {% if bulletin.isVisible() %} -
- -
- {% include '@meeo/eleve_notes.twig' with { 'bulletin' : bulletin } %} -
-
+ {% include '@meeo/eleve_notes.twig' with { 'bulletin' : bulletin } %} {% endif %} {% endfor %}
diff --git a/templates/eleve_notes.twig b/templates/eleve_notes.twig index aa048ca..e9e4bab 100644 --- a/templates/eleve_notes.twig +++ b/templates/eleve_notes.twig @@ -1,40 +1,51 @@ -
-{% for matiere in bulletin.getMatieres() %} - {% if matiere.isVisible() %} -
- -
- {% for note in matiere.getNotes() %} -
-
- {% if note.getNoteOn20() >= 20 %} - - {% elseif note.getNoteOn20() >= 15 %} - - {% elseif note.getNoteOn20() >= 12 %} - - {% elseif note.getNoteOn20() >= 9 %} - - {% endif %} -
-
- {{ note.getIntitule() }} -
-
- {{ note.getNote() }} / {{ note.getMax() }} -
-
- {% endfor %} +
+ - {% endif %} -{% endfor %} -
+
+
+ {% for matiere in bulletin.getMatieres() %} + {% if matiere.isVisible() %} +
+ +
+ {% for note in matiere.getNotes() %} +
+
+ {% if note.getNoteOn20() >= 20 %} + + {% elseif note.getNoteOn20() >= 15 %} + + {% elseif note.getNoteOn20() >= 12 %} + + {% elseif note.getNoteOn20() >= 9 %} + + {% endif %} +
+
+ {{ note.getIntitule() }} +
+
+ {{ note.getNote() }} / {{ note.getMax() }} +
+
+ {% endfor %} +
+
+ {% endif %} + {% endfor %} +
+
+
\ No newline at end of file