Files
xamxam/app/templates/partials/form/fieldset-metadata.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
1.9 KiB
PHP

<?php
/**
* Shared partial — "Métadonnées complémentaires" fieldset.
*
* Now split: licence/access moved to licence-explanation fieldset.
* This fieldset keeps: duration (pages + minutes), lien (external link).
*
* Variables consumed:
* callable|null $oldFn — callable($key, $default='') for old/current values.
* callable|null $withAutofocusFn — callable($field, $attrs=[]) to inject autofocus.
* array $formData — raw form data (used for repopulation).
*/
$oldFn = $oldFn ?? (function_exists('old') ? 'old' : fn($k, $d = '') => $d);
$withAutofocusFn = $withAutofocusFn ?? fn($field, $attrs = []) => $attrs;
$formData = $formData ?? [];
?>
<fieldset>
<legend>Métadonnées complémentaires</legend>
<?php
$name = 'duration_pages'; $label = 'Nombre de pages :'; $value = $oldFn('duration_pages');
$type = 'number'; $placeholder = ''; $hint = 'Ex : 84';
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
<?php
$name = 'duration_minutes'; $label = 'Durée (minutes) :'; $value = $oldFn('duration_minutes');
$type = 'number'; $placeholder = ''; $hint = 'Ex : 32 (pour œuvres audio/vidéo)';
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
<div class="admin-form-group">
<label class="admin-checkbox-label">
<input type="checkbox" name="has_annexes" value="1"
<?= !empty($formData['has_annexes']) ? 'checked' : '' ?>>
Ce TFE comporte des annexes
</label>
</div>
<?php
$name = 'lien'; $label = 'Lien (site / ressource) :'; $value = $oldFn('lien');
$type = 'url'; $placeholder = 'https://...'; $hint = '';
$attrs = $withAutofocusFn('lien');
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
</fieldset>
<?php
unset($oldFn, $withAutofocusFn);