Files
xamxam/app/templates/partials/form/fieldset-academic.php
Pontoporeia 24d68dda59 refactor form structure per new spec + fix
- split jury into interne/externe/ULB,
- remove president from student form,
- add language_autre,
- split duration into pages+minutes+annexes,
- move licence to degrés d'ouverture with CC2r,
- add license_custom,
- filter PACS from student AP list,
- editable généralités help block,
- Libre toggle per settings

Fix:
- missing comma after cc4r column in schema.sql
- remove duplicate form footer from partage template
- remove couverture from student files fieldset; add promoteur ULB conditional disable via JS on Approfondi
- promoteur ULB: remove 'si applicable', make required when visible
2026-05-07 19:43:43 +02:00

50 lines
2.0 KiB
PHP

<?php
/**
* Shared partial — "Cadre académique" fieldset.
*
* Variables consumed:
* callable|null $oldFn — callable($key, $default='') for old/current values.
* callable|null $withAutofocusFn — callable($field, $attrs=[]) to inject autofocus.
* array $orientations — options for the orientation select.
* array $apPrograms — options for the AP select.
* array $finalityTypes — options for the finality select.
* array $formData — raw form data (used for selected state).
*/
$oldFn = $oldFn ?? (function_exists('old') ? 'old' : fn($k, $d = '') => $d);
$withAutofocusFn = $withAutofocusFn ?? fn($field, $attrs = []) => $attrs;
$formData = $formData ?? [];
?>
<fieldset>
<legend>Cadre académique</legend>
<?php
$name = 'année'; $label = 'Année :'; $value = $oldFn('année'); $required = true;
$type = 'number';
$placeholder = date('Y');
$attrs = $withAutofocusFn('année', ['min' => 2000, 'max' => date('Y') + 1]);
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
<?php
$name = 'orientation'; $label = 'Orientation :'; $options = $orientations;
$selected = $formData['orientation'] ?? ''; $required = true; $placeholder = '';
$attrs = $withAutofocusFn('orientation');
include APP_ROOT . '/templates/partials/form/select-field.php';
?>
<?php
$name = 'ap'; $label = 'Atelier pluridisciplinaire :'; $options = $apPrograms;
$selected = $formData['ap'] ?? ''; $required = true; $placeholder = '';
$attrs = $withAutofocusFn('ap');
include APP_ROOT . '/templates/partials/form/select-field.php';
?>
<?php
$name = 'finality'; $label = 'Finalité du master :'; $options = $finalityTypes;
$selected = $formData['finality'] ?? ''; $required = true; $placeholder = '';
$attrs = $withAutofocusFn('finality');
include APP_ROOT . '/templates/partials/form/select-field.php';
?>
</fieldset>
<?php
unset($oldFn, $withAutofocusFn);