Change information in Absence Form

This commit is contained in:
mckmonster 2024-07-09 17:31:48 +02:00
parent 6aea33d65a
commit b4e4473603
2 changed files with 9 additions and 6 deletions

View file

@ -54,10 +54,6 @@ class CreateFormsCommand extends Command
private function absencesForm(FormManager $formManager, $meeo_config) private function absencesForm(FormManager $formManager, $meeo_config)
{ {
$existingForm = $formManager->getOne($meeo_config['absences']['formId']);
if ($existingForm)
return false;
$data = [ $data = [
"bn_id_nature" => $meeo_config['absences']['formId'], "bn_id_nature" => $meeo_config['absences']['formId'],
"bn_label_nature" => "Absences", "bn_label_nature" => "Absences",
@ -69,7 +65,8 @@ class CreateFormsCommand extends Command
"bn_template" => <<<EOT "bn_template" => <<<EOT
titre***Absence : {{bf_eleve}} - {{bf_date_debut_evenement}}***Titre Automatique*** titre***Absence : {{bf_eleve}} - {{bf_date_debut_evenement}}***Titre Automatique***
listefiche***5***Elève*** *** *** *** *** ***1*** *** *** * *** * *** *** *** *** listefiche***5***Elève*** *** *** *** *** ***1*** *** *** * *** * *** *** *** ***
listedatedeb***bf_date_debut_evenement***Date*** *** *** *** *** ***1*** *** *** * *** * *** *** *** *** listedatedeb***bf_date_debut***Debut*** *** ***today*** *** ***1*** *** *** * *** * *** *** *** ***
listedatedeb***bf_date_fin***Fin*** *** ***today*** *** ***1*** *** *** * *** * *** *** *** ***
textelong***bf_commentaire***Commentaire*** *** *** *** ***wiki***0*** *** *** * *** * *** *** *** *** textelong***bf_commentaire***Commentaire*** *** *** *** ***wiki***0*** *** *** * *** * *** *** *** ***
EOT, EOT,
"bn_ce_i18n" => "fr-FR", "bn_ce_i18n" => "fr-FR",
@ -77,6 +74,10 @@ EOT,
"bn_only_one_entry_message" => null "bn_only_one_entry_message" => null
]; ];
$existingForm = $formManager->getOne($meeo_config['absences']['formId']);
if ($existingForm)
return $formManager->update($data);
return $formManager->create($data); return $formManager->create($data);
} }

View file

@ -1,9 +1,11 @@
<div class="panel-body"> <div class="panel-body">
{% for entry in entries %} {% for entry in entries %}
<div> <div>
<h5>{{ entry['bf_date_debut_evenement'] }}</h5> <h5>{{ entry['bf_date_debut_evenement']|date("m/d/Y H:i") }} - {{ entry['bf_date_fin_evenement']|date("m/d/Y H:i") }}</h5>
{% if entry['bf_commentaire']|default %} {% if entry['bf_commentaire']|default %}
<p>{{ entry['bf_commentaire'] }}</p> <p>{{ entry['bf_commentaire'] }}</p>
{% else %}
<p>Aucune information</p>
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}