mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 23:31:21 +02:00
Fix edit form: is_published reset, contact decoupling, note label, author name case
- Fix #1: Add is_published to getThesisRawFields() SELECT so the publish checkbox stays checked when editing an already-published TFE. - Fix #2: Rename 'Note contextuelle' → 'Note contextuelle relative à soutenance' in all templates and StudentEmail. - Fix #3: Update findOrCreateAuthor to also UPDATE the author name when a record is found by name (fixes inability to capitalise names). - Fix #4/#5: Decouple contact_interne (private author email) from contact_visible (public contact on TFE page). Add migration 037 to add contact_visible TEXT column to theses table and rebuild v_theses_full view. Update all controllers, templates, and DB methods to treat them independently. - Fix #6: Investigated libre→interne restriction — no code barrier found; likely resolved by is_published fix.
This commit is contained in:
@@ -148,6 +148,7 @@ class ThesisCreateController
|
||||
'subtitle' => $data['subtitle'],
|
||||
'synopsis' => $data['synopsis'],
|
||||
'context_note' => $data['contextNote'],
|
||||
'contact_visible' => $data['contactVisible'] ?? '',
|
||||
'baiu_link' => $data['lien'],
|
||||
'license_id' => $data['licenseId'],
|
||||
'license_custom' => $data['licenseCustom'],
|
||||
@@ -310,12 +311,17 @@ class ThesisCreateController
|
||||
if ($contactInterne !== '') {
|
||||
$mail = $contactInterne;
|
||||
}
|
||||
// contact_public: respected if present (admin form); defaults to true for student forms
|
||||
// where the spec says contact is always visible when provided.
|
||||
// contact_visible: what appears publicly on the TFE page
|
||||
// In admin mode: from contact_visible field. In student mode: from mail field.
|
||||
$contactVisible = trim($post['contact_visible'] ?? '');
|
||||
if ($contactVisible === '' && $mail !== '') {
|
||||
$contactVisible = $mail;
|
||||
}
|
||||
// showContact for backwards compat
|
||||
if (array_key_exists('contact_public', $post)) {
|
||||
$showContact = !empty($post['contact_public']);
|
||||
} else {
|
||||
$showContact = $mail !== '';
|
||||
$showContact = $contactVisible !== '';
|
||||
}
|
||||
|
||||
$annee = filter_var($post['année'] ?? '', FILTER_VALIDATE_INT);
|
||||
@@ -528,6 +534,7 @@ class ThesisCreateController
|
||||
return compact(
|
||||
'authorNames',
|
||||
'mail',
|
||||
'contactVisible',
|
||||
'showContact',
|
||||
'annee',
|
||||
'orientationId',
|
||||
|
||||
Reference in New Issue
Block a user