Compare commits
No commits in common. "a279834374dd679d7336d7e7578daf7fcbb4fbdd" and "202ce66ed6f9db7fbf955110c43d070434864824" have entirely different histories.
a279834374
...
202ce66ed6
6 changed files with 8 additions and 77 deletions
|
@ -3,9 +3,6 @@
|
||||||
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
|
||||||
{
|
{
|
||||||
|
@ -16,35 +13,6 @@ class NotesAction extends YesWikiAction
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
$meeo_config = $this->params->get('meeo');
|
return $this->render('@meeo/notes.twig');
|
||||||
$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,8 +112,7 @@ EOT,
|
||||||
"bn_sem_type" => "",
|
"bn_sem_type" => "",
|
||||||
"bn_sem_use_template" => "1",
|
"bn_sem_use_template" => "1",
|
||||||
"bn_template" => <<<EOT
|
"bn_template" => <<<EOT
|
||||||
titre***Note : {{bf_intitule}} - {{bf_eleve}} - {{bf_matiere}}***Titre Automatique***
|
titre*** ***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*** *** *** * *** * *** *** *** ***
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
<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,18 +1,11 @@
|
||||||
<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>
|
||||||
<div>
|
{% if entry['bf_date_debut'] == entry['bf_date_fin'] %}
|
||||||
<h5>
|
<h5>{{ entry['bf_date_debut']|date("m/d/Y") }}</h5>
|
||||||
{% if entry['bf_date_debut'] == entry['bf_date_fin'] %}
|
{% else %}
|
||||||
{{ entry['bf_date_debut']|date("m/d/Y") }}
|
<h5>{{ entry['bf_date_debut']|date("m/d/Y H:i") }} - {{ entry['bf_date_fin']|date("m/d/Y H:i") }}</h5>
|
||||||
{% else %}
|
{% endif %}
|
||||||
{{ 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'] }}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
<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
templates/notes.twig
Normal file
1
templates/notes.twig
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<p>Notes</p>
|
Loading…
Reference in a new issue