diff --git a/commands/CreateFormsCommand.php b/commands/CreateFormsCommand.php index 67796e3..9ae6adf 100644 --- a/commands/CreateFormsCommand.php +++ b/commands/CreateFormsCommand.php @@ -16,6 +16,8 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; class CreateFormsCommand extends Command { protected $wiki; + protected $absenceFormId; + protected $noteFormId; protected $eleveFormId; protected $yunohostFormId; @@ -25,6 +27,8 @@ class CreateFormsCommand extends Command $this->wiki = $wiki; $params = $this->wiki->services->get(ParameterBagInterface::class); $meeo_config = $params->get('meeo'); + $this->absenceFormId = $meeo_config['absencesFormId']; + $this->noteFormId = $meeo_config['notesFormId']; $this->eleveFormId = $meeo_config['elevesFormId']; $this->yunohostFormId = $meeo_config['yunohostFormId']; } @@ -68,9 +72,8 @@ class CreateFormsCommand extends Command private function absencesForm(FormManager $formManager, $meeo_config) { - $formId = $meeo_config['absencesFormId']; $data = [ - "bn_id_nature" => $formId, + "bn_id_nature" => $this->absenceFormId, "bn_label_nature" => "Absences", "bn_description" => "Absences des élèves", "bn_condition" => "", @@ -108,12 +111,10 @@ EOT, private function notesForm(FormManager $formManager, $meeo_config) { - $formId = $meeo_config['notesFormId']; - $this->matiereList(); $data = [ - "bn_id_nature" => $formId, + "bn_id_nature" => $this->noteFormId, "bn_label_nature" => "Notes", "bn_description" => "Notes des élèves", "bn_condition" => "", @@ -151,13 +152,10 @@ EOT, } private function elevesForms(FormManager $formManager, $meeo_config) { - - $formId = $meeo_config['elevesFormId']; - $this->classeList(); $data = [ - "bn_id_nature" => $formId, + "bn_id_nature" => $this->eleveFormId, "bn_label_nature" => "Eleves", "bn_description" => "Liste des élèves", "bn_condition" => "",