Compare commits

..

3 commits

Author SHA1 Message Date
mckmonster
a279834374 [Notes] Rajout de l'affichage pour un élève 2024-07-12 16:57:59 +02:00
mckmonster
4f8b373bf0 [Notes] 1ere passe 2024-07-12 16:49:50 +02:00
mckmonster
8279969780 [Absences] Rajout de la possibilité d'editer une absence. 2024-07-10 12:32:03 +02:00
6 changed files with 77 additions and 8 deletions

View file

@ -3,6 +3,9 @@
namespace YesWiki\Meeo;
use YesWiki\Core\YesWikiAction;
use YesWiki\Bazar\Service\EntryManager;
use YesWiki\Core\Service\UserManager;
use YesWiki\Bazar\Service\ListManager;
class NotesAction extends YesWikiAction
{
@ -13,6 +16,35 @@ class NotesAction extends YesWikiAction
public function run()
{
return $this->render('@meeo/notes.twig');
$meeo_config = $this->params->get('meeo');
$formId = $meeo_config['notes']['formId'];
$eleveIdentifier = 'listefiche'.$meeo_config['elevesFormId'].'bf_eleve';
$groupeEE = $meeo_config['groupeEE'];
$entryManager = $this->getService(EntryManager::class);
$userManager = $this->getService(UserManager::class);
$listManager = $this->getService(ListManager::class);
if ( $userManager->isInGroup($groupeEE, admincheck: false) ) {
$eleves = $entryManager->search(['formsIds' => $meeo_config['elevesFormId']]);
$entries = $entryManager->search(['formsIds' => $formId]);
$matieres = $listManager->getOne('ListeMatiere');
// echo var_dump($eleves);
// echo var_dump($entries);
// echo var_dump($matieres);
return $this->render('@meeo/edu_notes.twig', [
"eleves" => $eleves,
"entries" => $entries,
"matieres" => $matieres,
]);
} else {
$entries = $entryManager->search(['formsIds' => $formId]);
$matieres = $listManager->getOne('ListeMatiere');
return $this->render('@meeo/eeleve_notes.twig', [
"entries" => $entries,
"matieres" => $matieres,
]);
}
}
}

View file

@ -112,7 +112,8 @@ EOT,
"bn_sem_type" => "",
"bn_sem_use_template" => "1",
"bn_template" => <<<EOT
titre*** ***Titre Automatique***
titre***Note : {{bf_intitule}} - {{bf_eleve}} - {{bf_matiere}}***Titre Automatique***
texte***bf_intitule***Intitulé*** *** *** *** ***text***1*** *** *** * *** * *** *** *** ***
liste***ListeMatière***Matière*** *** *** ***bf_matiere*** ***1*** *** *** * *** * *** *** *** ***
listefiche***5***Elève*** *** *** ***bf_eleve*** ***1*** *** *** * *** * *** *** *** ***
texte***bf_note***Note***0***20*** *** ***number***1*** *** *** * *** * *** *** *** ***

14
templates/edu_notes.twig Normal file
View file

@ -0,0 +1,14 @@
<div id="accordion" class="panel-group" role="tablist" aria-multiselectable="true">
{% for identifier, eleve in eleves|sort %}
<div class="panel panel-default">
<button id="head_{{ identifier }}" class="panel-heading collapsed" data-parent="#accordion" data-target="#{{ identifier }}" data-toggle="collapse" aria-expanded="false">
<h4 class="panel-title">{{ eleve['bf_nom'] }}</h4>
</button>
<div id="{{ identifier }}" class="panel-collapse collapse in" aria-expanded="false">
{% set filteredEntries = entries|filter(e => e['listefiche5bf_eleve'] == identifier) %}
{% include '@meeo/eleve_notes.twig' with { 'entries' : filteredEntries } %}
</div>
</div>
{% endfor %}
</div>

View file

@ -1,11 +1,18 @@
<div class="panel-body">
{% for entry in entries|sort((a,b) => a['bf_date_debut'] <=> b['bf_date_debut'])|reverse %}
<div>
{% if entry['bf_date_debut'] == entry['bf_date_fin'] %}
<h5>{{ entry['bf_date_debut']|date("m/d/Y") }}</h5>
{% else %}
<h5>{{ entry['bf_date_debut']|date("m/d/Y H:i") }} - {{ entry['bf_date_fin']|date("m/d/Y H:i") }}</h5>
{% endif %}
<div>
<h5>
{% if entry['bf_date_debut'] == entry['bf_date_fin'] %}
{{ entry['bf_date_debut']|date("m/d/Y") }}
{% else %}
{{ entry['bf_date_debut']|date("m/d/Y H:i") }} - {{ entry['bf_date_fin']|date("m/d/Y H:i") }}
{% endif %}
<a class="btn btn-default btn-xs" href="{{ url({ tag: entry['id_fiche'], handler: 'edit' }) }}">
<i class="fa fa-pencil-alt"></i>
</a>
</h5>
</div>
<div>
{% if entry['bf_commentaire']|default %}
{{ entry['bf_commentaire'] }}

View file

@ -0,0 +1,16 @@
<div id="accordion" class="panel-group" role="tablist" aria-multiselectable="true">
{% for identifier, matiere in matieres['label'] %}
<div class="panel panel-primary">
<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>
</button>
<div id="{{ identifier }}" class="panel-collapse collapse in" aria-expanded="false">
{% for idEntry, entry in entries|filter(e => e['listeListeMatièrebf_matiere'] == identifier) -%}
<div>
{{ entry['bf_intitule'] }} : {{ entry['bf_note'] }}
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>

View file

@ -1 +0,0 @@
<p>Notes</p>