Compare commits
3 commits
202ce66ed6
...
a279834374
Author | SHA1 | Date | |
---|---|---|---|
|
a279834374 | ||
|
4f8b373bf0 | ||
|
8279969780 |
6 changed files with 77 additions and 8 deletions
|
@ -3,6 +3,9 @@
|
||||||
namespace YesWiki\Meeo;
|
namespace YesWiki\Meeo;
|
||||||
|
|
||||||
use YesWiki\Core\YesWikiAction;
|
use YesWiki\Core\YesWikiAction;
|
||||||
|
use YesWiki\Bazar\Service\EntryManager;
|
||||||
|
use YesWiki\Core\Service\UserManager;
|
||||||
|
use YesWiki\Bazar\Service\ListManager;
|
||||||
|
|
||||||
class NotesAction extends YesWikiAction
|
class NotesAction extends YesWikiAction
|
||||||
{
|
{
|
||||||
|
@ -13,6 +16,35 @@ class NotesAction extends YesWikiAction
|
||||||
|
|
||||||
public function run()
|
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,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,8 @@ EOT,
|
||||||
"bn_sem_type" => "",
|
"bn_sem_type" => "",
|
||||||
"bn_sem_use_template" => "1",
|
"bn_sem_use_template" => "1",
|
||||||
"bn_template" => <<<EOT
|
"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*** *** *** * *** * *** *** *** ***
|
liste***ListeMatière***Matière*** *** *** ***bf_matiere*** ***1*** *** *** * *** * *** *** *** ***
|
||||||
listefiche***5***Elève*** *** *** ***bf_eleve*** ***1*** *** *** * *** * *** *** *** ***
|
listefiche***5***Elève*** *** *** ***bf_eleve*** ***1*** *** *** * *** * *** *** *** ***
|
||||||
texte***bf_note***Note***0***20*** *** ***number***1*** *** *** * *** * *** *** *** ***
|
texte***bf_note***Note***0***20*** *** ***number***1*** *** *** * *** * *** *** *** ***
|
||||||
|
|
14
templates/edu_notes.twig
Normal file
14
templates/edu_notes.twig
Normal 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>
|
|
@ -1,11 +1,18 @@
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{% for entry in entries|sort((a,b) => a['bf_date_debut'] <=> b['bf_date_debut'])|reverse %}
|
{% for entry in entries|sort((a,b) => a['bf_date_debut'] <=> b['bf_date_debut'])|reverse %}
|
||||||
<div>
|
<div>
|
||||||
{% if entry['bf_date_debut'] == entry['bf_date_fin'] %}
|
<div>
|
||||||
<h5>{{ entry['bf_date_debut']|date("m/d/Y") }}</h5>
|
<h5>
|
||||||
{% else %}
|
{% if entry['bf_date_debut'] == entry['bf_date_fin'] %}
|
||||||
<h5>{{ entry['bf_date_debut']|date("m/d/Y H:i") }} - {{ entry['bf_date_fin']|date("m/d/Y H:i") }}</h5>
|
{{ entry['bf_date_debut']|date("m/d/Y") }}
|
||||||
{% endif %}
|
{% 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>
|
<div>
|
||||||
{% if entry['bf_commentaire']|default %}
|
{% if entry['bf_commentaire']|default %}
|
||||||
{{ entry['bf_commentaire'] }}
|
{{ entry['bf_commentaire'] }}
|
||||||
|
|
16
templates/eleve_notes.twig
Normal file
16
templates/eleve_notes.twig
Normal 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>
|
|
@ -1 +0,0 @@
|
||||||
<p>Notes</p>
|
|
Loading…
Reference in a new issue