Compare commits
No commits in common. "43d586f57b16932b714b2757ec7736f85e2a2887" and "450836cac56b9392dc6e24f13095e7934608c5a4" have entirely different histories.
43d586f57b
...
450836cac5
19 changed files with 79 additions and 458 deletions
|
@ -14,7 +14,7 @@ class AbsencesAction extends YesWikiAction
|
|||
public function run()
|
||||
{
|
||||
$meeo_config = $this->params->get('meeo');
|
||||
$formId = $meeo_config['absencesFormId'];
|
||||
$formId = $meeo_config['absences']['formId'];
|
||||
$eleveIdentifier = 'listefiche'.$meeo_config['elevesFormId'].'bf_eleve';
|
||||
$groupeEE = $meeo_config['groupeEE'];
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Meeo;
|
||||
|
||||
use YesWiki\Core\YesWikiAction;
|
||||
use YesWiki\Meeo\Service\NoteManager;
|
||||
|
||||
class ControleAction extends YesWikiAction
|
||||
{
|
||||
public function formatArguments($arg)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$noteManager = $this->getService(NoteManager::class);
|
||||
return $noteManager->viewControle();
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
use YesWiki\Core\YesWikiAction;
|
||||
use YesWiki\Bazar\Service\EntryManager;
|
||||
use YesWiki\Bazar\Service\ListManager;
|
||||
use YesWiki\Meeo\Service\EleveManager;
|
||||
|
||||
class ElevesAction extends YesWikiAction
|
||||
{
|
||||
public function formatArguments($arg)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$eleveManager = $this->getService(EleveManager::class);
|
||||
return $eleveManager->view();
|
||||
}
|
||||
}
|
|
@ -3,7 +3,8 @@
|
|||
namespace YesWiki\Meeo;
|
||||
|
||||
use YesWiki\Core\YesWikiAction;
|
||||
use YesWiki\Meeo\Service\NoteManager;
|
||||
use YesWiki\Bazar\Service\EntryManager;
|
||||
use YesWiki\Core\Service\UserManager;
|
||||
|
||||
class NotesAction extends YesWikiAction
|
||||
{
|
||||
|
@ -14,7 +15,36 @@ class NotesAction extends YesWikiAction
|
|||
|
||||
public function run()
|
||||
{
|
||||
$noteManager = $this->getService(NoteManager::class);
|
||||
$noteManager->viewBulletins();
|
||||
$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);
|
||||
|
||||
if ( $userManager->isInGroup($groupeEE, admincheck: false) ) {
|
||||
$eleves = $entryManager->search(['formsIds' => $meeo_config['elevesFormId']]);
|
||||
$entries = $entryManager->search(['formsIds' => $formId]);
|
||||
|
||||
include 'tools/meeo/libs/Bulletin.lib.php';
|
||||
|
||||
$bulletins = [];
|
||||
foreach ( $eleves as $eleve) {
|
||||
$bulletins[] = new Bulletin($this->wiki, $eleve, "Passerelle");
|
||||
}
|
||||
// echo var_dump($eleves);
|
||||
// echo var_dump($entries);
|
||||
// echo var_dump($matieres);
|
||||
return $this->render('@meeo/edu_notes.twig', [
|
||||
"bulletins" => $bulletins,
|
||||
]);
|
||||
} else {
|
||||
$entries = $entryManager->search(['formsIds' => $formId]);
|
||||
|
||||
return $this->render('@meeo/eleve_notes.twig', [
|
||||
"bulletin" => $bulletin,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
label: MeeO # Nom affiché dans la barre d'action de l'éditeur
|
||||
actions:
|
||||
absences:
|
||||
label: Absences
|
||||
label: _T(MEEO_ABSENCES_LABEL)
|
||||
description: Absences des élèves
|
||||
notes:
|
||||
label: Notes
|
||||
label: _T(MEEO_NOTES_LABEL)
|
||||
description: Notes des élèves
|
||||
eleves:
|
||||
label: Eleves
|
||||
description: Liste des élèves
|
||||
controle:
|
||||
label: Controle
|
||||
description: Affiche les informations d'un controle
|
||||
# La liste des actions de ce groupe
|
|
@ -52,19 +52,10 @@ class CreateFormsCommand extends Command
|
|||
;
|
||||
}
|
||||
|
||||
private function createOrUpdate($formManager, $formId, $data) {
|
||||
$existingForm = $formManager->getOne($formId);
|
||||
if ($existingForm)
|
||||
return $formManager->update($data);
|
||||
|
||||
return $formManager->create($data);
|
||||
}
|
||||
|
||||
private function absencesForm(FormManager $formManager, $meeo_config)
|
||||
{
|
||||
$formId = $meeo_config['absencesFormId'];
|
||||
$data = [
|
||||
"bn_id_nature" => $formId,
|
||||
"bn_id_nature" => $meeo_config['absences']['formId'],
|
||||
"bn_label_nature" => "Absences",
|
||||
"bn_description" => "Absences des élèves",
|
||||
"bn_condition" => "",
|
||||
|
@ -73,7 +64,7 @@ class CreateFormsCommand extends Command
|
|||
"bn_sem_use_template" => "1",
|
||||
"bn_template" => <<<EOT
|
||||
titre***Absence : {{bf_eleve}} - {{bf_date_debut_evenement}}***Titre Automatique***
|
||||
listefiche***6***Elève*** *** *** *** *** ***1*** *** *** * *** * *** *** *** ***
|
||||
listefiche***5***Elève*** *** *** *** *** ***1*** *** *** * *** * *** *** *** ***
|
||||
listedatedeb***bf_date_debut***Debut*** *** ***today*** *** ***1*** *** *** * *** * *** *** *** ***
|
||||
listedatedeb***bf_date_fin***Fin*** *** ***today*** *** ***1*** *** *** * *** * *** *** *** ***
|
||||
textelong***bf_commentaire***Commentaire*** *** *** *** ***wiki***0*** *** *** * *** * *** *** *** ***
|
||||
|
@ -83,7 +74,11 @@ EOT,
|
|||
"bn_only_one_entry_message" => null
|
||||
];
|
||||
|
||||
$this->createOrUpdate($formManager, $formId, $data);
|
||||
$existingForm = $formManager->getOne($meeo_config['absences']['formId']);
|
||||
if ($existingForm)
|
||||
return $formManager->update($data);
|
||||
|
||||
return $formManager->create($data);
|
||||
}
|
||||
|
||||
private function matiereList()
|
||||
|
@ -92,22 +87,24 @@ EOT,
|
|||
$tripleStore = $this->wiki->services->get(TripleStore::class);
|
||||
|
||||
if (!$pageManager->getOne('ListeMatiere')) {
|
||||
$pageManager->save('ListeMatiere', '{"label":{"francais":"Français","math":"Math"},"titre_liste":"Matieres"}');
|
||||
$pageManager->save('ListeMatière', '{"label":{"francais":"Français","math":"Math"},"titre_liste":"Matieres"}');
|
||||
// in case, there is already some triples for 'ListOuinonLms', delete them
|
||||
$tripleStore->delete('ListeMatiere', 'http://outils-reseaux.org/_vocabulary/type', null);
|
||||
$tripleStore->delete('ListeMatière', 'http://outils-reseaux.org/_vocabulary/type', null);
|
||||
// create the triple to specify this page is a list
|
||||
$tripleStore->create('ListeMatiere', 'http://outils-reseaux.org/_vocabulary/type', 'liste', '', '');
|
||||
$tripleStore->create('ListeMatière', 'http://outils-reseaux.org/_vocabulary/type', 'liste', '', '');
|
||||
}
|
||||
}
|
||||
|
||||
private function notesForm(FormManager $formManager, $meeo_config)
|
||||
{
|
||||
$formId = $meeo_config['notesFormId'];
|
||||
$existingForm = $formManager->getOne($meeo_config['notes']['formId']);
|
||||
if ($existingForm)
|
||||
return false;
|
||||
|
||||
$this->matiereList();
|
||||
|
||||
$data = [
|
||||
"bn_id_nature" => $formId,
|
||||
"bn_id_nature" => $meeo_config['notes']['formId'],
|
||||
"bn_label_nature" => "Notes",
|
||||
"bn_description" => "Notes des élèves",
|
||||
"bn_condition" => "",
|
||||
|
@ -118,7 +115,7 @@ EOT,
|
|||
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***6***Elève*** *** *** ***bf_eleve*** ***1*** *** *** * *** * *** *** *** ***
|
||||
listefiche***5***Elève*** *** *** ***bf_eleve*** ***1*** *** *** * *** * *** *** *** ***
|
||||
texte***bf_note***Note***0***20*** *** ***number***1*** *** *** * *** * *** *** *** ***
|
||||
texte***bf_coef***Coefficient***0.5***10***1*** ***number***0*** *** *** * *** * *** *** *** ***
|
||||
EOT,
|
||||
|
@ -127,63 +124,32 @@ EOT,
|
|||
"bn_only_one_entry_message" => null
|
||||
];
|
||||
|
||||
$this->createOrUpdate($formManager, $formId, $data);
|
||||
}
|
||||
|
||||
private function classeList()
|
||||
{
|
||||
$pageManager = $this->wiki->services->get(PageManager::class);
|
||||
$tripleStore = $this->wiki->services->get(TripleStore::class);
|
||||
|
||||
if (!$pageManager->getOne('ListeClasses')) {
|
||||
$pageManager->save('ListeClasses', '{"label":{},"titre_liste":"Classe"}');
|
||||
// in case, there is already some triples for 'ListOuinonLms', delete them
|
||||
$tripleStore->delete('ListeClasses', 'http://outils-reseaux.org/_vocabulary/type', null);
|
||||
// create the triple to specify this page is a list
|
||||
$tripleStore->create('ListeClasses', 'http://outils-reseaux.org/_vocabulary/type', 'liste', '', '');
|
||||
}
|
||||
}
|
||||
|
||||
private function elevesForms(FormManager $formManager, $meeo_config) {
|
||||
|
||||
$formId = $meeo_config['elevesFormId'];
|
||||
|
||||
$this->classeList();
|
||||
|
||||
$data = [
|
||||
"bn_id_nature" => $formId,
|
||||
"bn_label_nature" => "Eleves",
|
||||
"bn_description" => "Liste des élèves",
|
||||
"bn_condition" => "",
|
||||
"bn_sem_context" => "",
|
||||
"bn_sem_type" => "",
|
||||
"bn_sem_use_template" => "1",
|
||||
"bn_template" => <<<EOT
|
||||
texte***bf_titre***Nom d'utilisateur*** *** *** *** ***text***1*** *** *** * *** * *** *** *** ***
|
||||
texte***bf_nom***Nom complet*** *** *** *** ***text***1*** *** *** * *** * *** *** *** ***
|
||||
champs_mail***bf_mail***Email*** *** % *** ***form*** ***1***0*** *** * *** % *** *** *** ***
|
||||
liste***ListeClasses***Classe*** *** ***aucune***bf_classe*** ***1*** *** *** * *** * *** *** *** ***
|
||||
EOT,
|
||||
"bn_ce_i18n" => "fr-FR",
|
||||
"bn_only_one_entry" => "N",
|
||||
"bn_only_one_entry_message" => null
|
||||
];
|
||||
|
||||
$this->createOrUpdate($formManager, $formId, $data);
|
||||
return $formManager->create($data);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$formManager = $this->wiki->services->get(FormManager::class);
|
||||
$params = $this->wiki->services->get(ParameterBagInterface::class);
|
||||
if (!$params->has('meeo')) {
|
||||
$result = $formManager->getAll();
|
||||
$lastFormId = array_key_last($result);
|
||||
$meeo_config = [
|
||||
'absences' => [
|
||||
'formId' => $lastFormId + 1,
|
||||
],
|
||||
'notes' => [
|
||||
'formId' => $lastFormId + 2,
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$meeo_config = $params->get('meeo');
|
||||
}
|
||||
|
||||
$this->absencesForm($formManager, $meeo_config);
|
||||
|
||||
$this->notesForm($formManager, $meeo_config);
|
||||
|
||||
$this->elevesForms($formManager, $meeo_config);
|
||||
|
||||
echo 'Succeed\n';
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Meeo\Commands;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use YesWiki\Wiki;
|
||||
use YesWiki\Bazar\Service\EntryManager;
|
||||
|
||||
class UpdateElevesFromYunohostCommand extends Command {
|
||||
protected $wiki;
|
||||
|
||||
public function __construct(Wiki &$wiki) {
|
||||
parent::__construct();
|
||||
$this->wiki = $wiki;
|
||||
}
|
||||
|
||||
protected function configure() {
|
||||
$this
|
||||
// the name of the command : ./yeswicli helloworld:hello"
|
||||
->setName('meeo:update')
|
||||
// the short description shown while running "./yeswicli list"
|
||||
->setDescription('Update la liste des élèves depuis les utilisateurs Yunohost')
|
||||
|
||||
// the full command description shown when running the command with
|
||||
// the "--help" option
|
||||
// ->setHelp("This command display the message \"Hello !\" with options for uppercase of add a username.\n" .
|
||||
// "The argument \"username\" can be used to add a username. Example : \n" .
|
||||
// "Command line'./yeswicli helloworld:hello \"John Smith\"' gives \"Hello John Smith !\"")
|
||||
|
||||
// add argument for username
|
||||
// second parameter could be InputArgument::OPTIONAL <=> null, InputArgument::REQUIRED, InputArgument::IS_ARRAY
|
||||
// third parameter is the description
|
||||
// forth parameter is default value
|
||||
// ->addArgument('username', InputArgument::OPTIONAL, 'Username')
|
||||
|
||||
// add option to display output as UPPERCASE
|
||||
// second parameter null|string is shortcut
|
||||
// third parameter null|int could be InputOption::VALUE_NONE <=> null, InputOption::VALUE_REQUIRED
|
||||
// , InputOption::VALUE_OPTIONAL, InputOption::VALUE_IS_ARRAY, InputOption::VALUE_NEGATABLE
|
||||
// forth parameter is the description
|
||||
// ->addOption('uppercase', 'u', InputOption::VALUE_NONE, 'Display output in UPPERCASE')
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output) {
|
||||
$entryManager = $this->wiki->services->get(EntryManager::class);
|
||||
$params = $this->wiki->services->get(ParameterBagInterface::class);
|
||||
$meeo_config = $params->get('meeo');
|
||||
$yunohostFormId = $meeo_config['yunohostFormId'];
|
||||
$elevesFormId = $meeo_config['elevesFormId'];
|
||||
|
||||
$yunohostEntries = $entryManager->search(['formsIds' => $yunohostFormId]);
|
||||
foreach ($yunohostEntries as $yunohostEntry) {
|
||||
$eleveEntry = $entryManager->search(['formsIds' => $elevesFormId, 'queries' => [
|
||||
'bf_titre' => $yunohostEntry['bf_titre']
|
||||
]]);
|
||||
if ($eleveEntry == null) {
|
||||
$entryManager->create($elevesFormId, [
|
||||
'bf_titre' => $yunohostEntry['bf_titre'],
|
||||
'bf_nom' => $yunohostEntry['bf_nom'],
|
||||
'bf_mail' => $yunohostEntry['bf_mail'],
|
||||
'antispam' => 1
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
10
config.yaml
10
config.yaml
|
@ -1,17 +1,11 @@
|
|||
parameters:
|
||||
meeo:
|
||||
elevesFormId: 6
|
||||
absencesFormId: 7
|
||||
notesFormId: 8
|
||||
yunohostFormId: 5
|
||||
groupeEE: 'EquipeEducative'
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
public: true
|
||||
|
||||
YesWiki\Meeo\Service\:
|
||||
resource: 'services/*'
|
||||
# YesWiki\MeeO\Service\:
|
||||
# resource: 'services/*'
|
||||
|
||||
# Allows to use controllers as services
|
||||
# YesWiki\MeeO\Controller\:
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
<?php
|
||||
namespace YesWiki\Meeo\Controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use YesWiki\Core\ApiResponse;
|
||||
use YesWiki\Core\YesWikiController;
|
||||
use YesWiki\Meeo\Service\EleveManager;
|
||||
|
||||
class ApiController extends YesWikiController
|
||||
{
|
||||
/**
|
||||
* @Route("/api/meeo/eleves",methods={"POST"},options={"acl":{"public"}})
|
||||
*/
|
||||
public function eleveUpdate(Request $request) {
|
||||
$eleveController = $this->getService(EleveManager::class);
|
||||
$content = $request->getContent();
|
||||
|
||||
parse_str($content, $parameters);
|
||||
|
||||
$datas = [];
|
||||
foreach ($parameters as $cle => $valeur) {
|
||||
$clef_action = explode('_', $cle);
|
||||
if ($clef_action[1] == 'classe' && $valeur != 'aucune') {
|
||||
$datas[] = $eleveController->updateClasse($clef_action[0], $valeur);
|
||||
}
|
||||
if ($clef_action[1] == 'del') {
|
||||
$eleveController->del($clef_action[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->wiki->redirect('?Eleves', 200);
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
$(document).ready(function(){
|
||||
$("#classe").on("change", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$("#eleves div.form-group").filter(function() {
|
||||
var text = $(this).attr('classe').toLowerCase();
|
||||
$(this).toggle(text.indexOf(value) > -1);
|
||||
});
|
||||
});
|
||||
});
|
6
lang/meeo_fr.inc.php
Normal file
6
lang/meeo_fr.inc.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'MEEO_ABSENCES_LABEL' => 'Absences',
|
||||
'MEEO_NOTES_LABEL' => 'Notes',
|
||||
];
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Meeo\Bulletin;
|
||||
namespace YesWiki\Meeo;
|
||||
|
||||
include 'tools/meeo/libs/bulletin/Matiere.lib.php';
|
||||
include 'tools/meeo/libs/Matiere.lib.php';
|
||||
|
||||
use YesWiki\Bazar\Service\ListManager;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Meeo\Bulletin;
|
||||
namespace YesWiki\Meeo;
|
||||
|
||||
include 'tools/meeo/libs/bulletin/Note.lib.php';
|
||||
include 'tools/meeo/libs/Note.lib.php';
|
||||
|
||||
use YesWiki\Bazar\Service\EntryManager;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Meeo\Bulletin;
|
||||
namespace YesWiki\Meeo;
|
||||
|
||||
class Note {
|
||||
private $intitule;
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\MeeO\Controle\Controle;
|
||||
|
||||
class Control {
|
||||
private $wiki;
|
||||
private $intitule;
|
||||
private $matiere;
|
||||
private $coef;
|
||||
private $eleves;
|
||||
|
||||
public function __construct($wiki, $intitule, $matiere, $coef) {
|
||||
$this->wiki = $wiki;
|
||||
$this->intitule = $intitule;
|
||||
$this->matiere = $matiere;
|
||||
$this->coef = $coef;
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Meeo\Service;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use YesWiki\Bazar\Service\EntryManager;
|
||||
use YesWiki\Bazar\Service\ListManager;
|
||||
use YesWiki\Wiki;
|
||||
|
||||
class EleveManager {
|
||||
|
||||
private $formId;
|
||||
private $entryManager;
|
||||
private $listManager;
|
||||
private $wiki;
|
||||
|
||||
public function __construct( Wiki $wiki, ParameterBagInterface $params, EntryManager $entryManager, ListManager $listManager)
|
||||
{
|
||||
$meeo_config = $params->get('meeo');
|
||||
$this->wiki = $wiki;
|
||||
$this->formId = $meeo_config['elevesFormId'];
|
||||
$this->entryManager = $entryManager;
|
||||
$this->listManager = $listManager;
|
||||
}
|
||||
|
||||
public function del($id) {
|
||||
$this->entryManager->delete($id);
|
||||
}
|
||||
|
||||
public function updateClasse($id, $classe) {
|
||||
return $this->entryManager->update($id, ['listeListeClassesbf_classe' => $classe, 'antispam' => true]);
|
||||
}
|
||||
|
||||
public function getAll() {
|
||||
return $this->entryManager->search(['formsIds' => $this->formId]);
|
||||
}
|
||||
|
||||
public function view() {
|
||||
$eleves = $this->getAll();
|
||||
// echo '<p>'.var_dump($eleves).'</p>';
|
||||
|
||||
$classes = $this->listManager->getOne('ListeClasses');
|
||||
|
||||
return $this->wiki->render('@meeo/edu_eleves.twig', ['eleves' => $eleves, 'classes' => $classes['label']]);
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace YesWiki\Meeo\Service;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use YesWiki\Bazar\Service\EntryManager;
|
||||
use YesWiki\Bazar\Service\ListManager;
|
||||
use YesWiki\Core\Service\UserManager;
|
||||
use YesWiki\Wiki;
|
||||
use YesWiki\Meeo\Bulletin\Bulletin;
|
||||
use YesWiki\Meeo\Service\EleveManager;
|
||||
|
||||
class NoteManager {
|
||||
protected $wiki;
|
||||
protected $params;
|
||||
protected $entryManager;
|
||||
protected $listManager;
|
||||
protected $userManager;
|
||||
|
||||
public function __construct( Wiki $wiki, ParameterBagInterface $params, EntryManager $entryManager, ListManager $listManager, UserManager $userManager)
|
||||
{
|
||||
$this->wiki = $wiki;
|
||||
$this->params = $params;
|
||||
$this->entryManager = $entryManager;
|
||||
$this->listManager = $listManager;
|
||||
$this->userManager = $userManager;
|
||||
}
|
||||
|
||||
public function viewBulletins() {
|
||||
$meeo_config = $this->params->get('meeo');
|
||||
$formId = $meeo_config['notesFormId'];
|
||||
$eleveIdentifier = 'listefiche'.$meeo_config['elevesFormId'].'bf_eleve';
|
||||
$groupeEE = $meeo_config['groupeEE'];
|
||||
|
||||
if ( $this->userManager->isInGroup($groupeEE, admincheck: false) ) {
|
||||
$eleves = $this->entryManager->search(['formsIds' => $meeo_config['elevesFormId']]);
|
||||
$entries = $this->entryManager->search(['formsIds' => $formId]);
|
||||
|
||||
include 'tools/meeo/libs/bulletin/Bulletin.lib.php';
|
||||
|
||||
$bulletins = [];
|
||||
foreach ( $eleves as $eleve) {
|
||||
//TODO enlever "Passerelle"
|
||||
$bulletins[] = new Bulletin($this->wiki, $eleve, "Passerelle");
|
||||
}
|
||||
// echo var_dump($eleves);
|
||||
// echo var_dump($entries);
|
||||
// echo var_dump($matieres);
|
||||
return $this->wiki->render('@meeo/edu_notes.twig', [
|
||||
"bulletins" => $bulletins,
|
||||
]);
|
||||
} else {
|
||||
$entries = $entryManager->search(['formsIds' => $formId]);
|
||||
|
||||
return $this->wiki->render('@meeo/eleve_notes.twig', [
|
||||
"bulletin" => $bulletin,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function viewControle() {
|
||||
$eleves = $this->wiki->services->get(EleveManager::class)->getAll();
|
||||
// echo var_dump($eleves);
|
||||
$matieres = $this->listManager->getOne('ListeMatiere');
|
||||
// echo var_dump($matieres);
|
||||
$classes = $this->listManager->getOne('ListeClasses');
|
||||
// echo var_dump($classes);
|
||||
return $this->wiki->render('@meeo/edu_controle.twig', ['matieres' => $matieres['label'], 'classes' => $classes['label'], 'eleves' => $eleves]);
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
{{ include_javascript('tools/meeo/javascripts/edu_controle_filter.js') }}
|
||||
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="intitule">Intitulé:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="intitule" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="matiere">Matière:</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="matiere" required>
|
||||
{% for clef, matiere in matieres %}
|
||||
<option value="{{ clef }}">{{ matiere }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="classe">Classe:</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="classe" required>
|
||||
{% for classe in classes %}
|
||||
<option>{{ classe }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2" for="coef">Coefficient:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number" class="form-control" id="coef" value="1" min="0.5" max="10" step="0.5">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Eleves</h2>
|
||||
<div id="eleves">
|
||||
{% for eleve in eleves %}
|
||||
<div class="form-group" classe="{{ eleve['listeListeClassesbf_classe'] }}" hidden>
|
||||
<label class="control-label col-sm-2" for="{{ eleve['id_fiche'] }}">{{ eleve['bf_nom'] }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="number" class="form-control" id="{{ eleve['id_fiche'] }}" min="0" max="20" step="0.1" required>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default">Envoyer</button>
|
||||
</form>
|
|
@ -1,29 +0,0 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-8"><h2>Nom</h5></div>
|
||||
<div class="col-sm-3"><h2>Classe</h2></div>
|
||||
<div class="col-sm-1 text-center"><h2><span class="glyphicon glyphicon-trash"></span></h2></div>
|
||||
</div>
|
||||
<form action="?api/meeo/eleves" method="post" enctype="application/json">
|
||||
{% for eleve in eleves|sort %}
|
||||
<div class="row form-group" id="{{eleve['id_fiche']}}" name="{{eleve['id_fiche']}}">
|
||||
<div class="col-sm-8">{{ eleve['bf_nom'] }}</div>
|
||||
<div class="col-sm-3">
|
||||
<select id="{{eleve['id_fiche']}}_classe" name="{{eleve['id_fiche']}}_classe" class="form-control">
|
||||
{% for identifier, classe in classes %}
|
||||
<option value="{{identifier}}" {% if eleve['listeListeClassesbf_classe'] == identifier %}selected{% endif %} >{{classe}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-1 text-center">
|
||||
<input id="{{eleve['id_fiche']}}_del" name="{{eleve['id_fiche']}}_del" class="form-check-input" type="checkbox" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 text-center">
|
||||
<button class="btn btn-default">Valider</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
Loading…
Reference in a new issue