mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
refine: required confirmation_email field on both student forms, StudentEmail uses it directly
- Add dedicated 'confirmation_email' (type=email, required) field to student form at end of submission (partage + admin). - ThesisCreateController now validates it is present and a valid email; form is rejected if missing/invalid. - Autofocus mapping for confirmation_email errors. - StudentEmail uses confirmation_email directly (removed extractEmail hack that mined email from free-form contact field).
This commit is contained in:
@@ -173,6 +173,7 @@ class ThesisCreateController
|
||||
if (str_contains($message, 'langue')) return 'languages';
|
||||
if (str_contains($message, 'mots-clés')) return 'tag';
|
||||
if (str_contains($message, 'Lien URL')) return 'lien';
|
||||
if (str_contains($message, 'e-mail de confirmation')) return 'confirmation_email';
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -283,8 +284,18 @@ class ThesisCreateController
|
||||
}
|
||||
}
|
||||
|
||||
// Confirmation e-mail (required)
|
||||
$confirmationEmail = trim($post['confirmation_email'] ?? '');
|
||||
if ($confirmationEmail === '') {
|
||||
throw new Exception("L'adresse e-mail de confirmation est requise.");
|
||||
}
|
||||
$confirmationEmail = filter_var($confirmationEmail, FILTER_VALIDATE_EMAIL);
|
||||
if ($confirmationEmail === false) {
|
||||
throw new Exception("L'adresse e-mail de confirmation n'est pas valide.");
|
||||
}
|
||||
|
||||
return compact(
|
||||
'auteurName', 'mail', 'showContact', 'annee', 'orientationId', 'apProgramId',
|
||||
'auteurName', 'mail', 'showContact', 'confirmationEmail', 'annee', 'orientationId', 'apProgramId',
|
||||
'finalityId', 'titre', 'subtitle', 'synopsis', 'durationInfo',
|
||||
'juryMembers', 'keywords', 'languageIds', 'formatIds',
|
||||
'licenseId', 'lien', 'accessTypeId'
|
||||
|
||||
Reference in New Issue
Block a user