ynh_extension_meeo/actions/NotesAction.php

43 lines
1.3 KiB
PHP
Raw Normal View History

2024-07-04 05:32:34 +00:00
<?php
namespace YesWiki\Meeo;
use YesWiki\Core\YesWikiAction;
2024-07-12 14:49:50 +00:00
use YesWiki\Bazar\Service\EntryManager;
use YesWiki\Core\Service\UserManager;
use YesWiki\Bazar\Service\ListManager;
2024-07-04 05:32:34 +00:00
class NotesAction extends YesWikiAction
{
public function formatArguments($arg)
{
return [];
}
public function run()
{
2024-07-12 14:49:50 +00:00
$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,
]);
}
2024-07-04 05:32:34 +00:00
}
}