This commit is contained in:
mckmonster 2024-08-02 18:24:43 +02:00
parent 8f754af0ca
commit eabc7168a9

View file

@ -17,7 +17,7 @@ class CreateFormsCommand extends Command
{
protected $wiki;
protected $absenceFormId;
protected $noteFormId;
protected $notesFormId;
protected $eleveFormId;
protected $yunohostFormId;
@ -28,7 +28,7 @@ class CreateFormsCommand extends Command
$params = $this->wiki->services->get(ParameterBagInterface::class);
$meeo_config = $params->get('meeo');
$this->absenceFormId = $meeo_config['absencesFormId'];
$this->noteFormId = $meeo_config['notesFormId'];
$this->notesFormId = $meeo_config['notesFormId'];
$this->eleveFormId = $meeo_config['elevesFormId'];
$this->yunohostFormId = $meeo_config['yunohostFormId'];
}
@ -63,6 +63,7 @@ class CreateFormsCommand extends Command
}
private function createOrUpdate($formManager, $formId, $data) {
echo $formId.": ".$data['bn_label_nature'];
$existingForm = $formManager->getOne($formId);
if ($existingForm)
return $formManager->update($data);
@ -114,7 +115,7 @@ EOT,
$this->matiereList();
$data = [
"bn_id_nature" => $this->noteFormId,
"bn_id_nature" => $this->notesFormId,
"bn_label_nature" => "Notes",
"bn_description" => "Notes des élèves",
"bn_condition" => "",
@ -134,7 +135,7 @@ EOT,
"bn_only_one_entry_message" => null
];
$this->createOrUpdate($formManager, $this->noteFormId, $data);
$this->createOrUpdate($formManager, $this->notesFormId, $data);
}
private function classeList()