partage: lock Année field to link's locked_year when present

When a student-access share link specifies a locked_year, the Année field
in the student-facing form is now pre-filled with that year and rendered
as disabled+readonly, with a hidden input ensuring the value is submitted.

- renderShareLinkForm() exposes  from ['locked_year']
- fieldset-academic.php checks for : if set, outputs a hidden
  input plus the visible field locked to that value; otherwise falls back
  to the normal editable field
This commit is contained in:
Pontoporeia
2026-07-08 13:50:03 +02:00
parent a3953800a4
commit f9d8fab120
2 changed files with 20 additions and 1 deletions
+4
View File
@@ -317,6 +317,10 @@ function renderShareLinkForm(string $slug, array $link): void
$oldFn = $shareOldFn;
$withAutofocusFn = $shareWithAutofocusFn;
// Locked academic year: if the link specifies a locked year, pre-fill
// and lock the Année field so students cannot change it.
$lockedYear = $link['locked_year'] ?? null;
// Synopsis extra: inject fieldset_synopsis help block
ob_start();
$helpContent = $helpFn('fieldset_synopsis');