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:
Pontoporeia
2026-06-08 18:31:10 +02:00
parent 3d524226a1
commit 3016c199bd
15 changed files with 164 additions and 37 deletions

View File

@@ -58,12 +58,14 @@ $adminMode = $adminMode ?? false;
$hint = 'Séparez les auteur·ices par des virgules.';
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
<?php if (!$adminMode): ?>
<?php
$name = 'mail'; $label = 'Contact visible (optionnel) [mail/site/insta/etc.] :'; $value = $oldFn('mail');
$attrs = ['autocomplete' => 'email'];
$hint = 'Un seul contact. Indiquez l\'URL complète pour un site (https://…), l\'adresse mail, le nom d\'utilisateur avec @ pour Instagram (@pseudo), ou l\'adresse complète pour Mastodon (@pseudo@instance). Ce contact sera visible publiquement sur la fiche du TFE.';
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
<?php endif; ?>
<div>
<label for="synopsis">Synopsis :<?= $adminMode ? '' : ' <span class="asterisk">*</span>' ?></label>

View File

@@ -32,7 +32,7 @@
* bool $showContact — Contact checkbox fieldset
* bool $showCoverPreview — cover image preview + remove checkbox
* bool $showExistingFiles — existing thesis files list (deletable)
* bool $showBackoffice — Backoffice fieldset (context_note, jury_points, remarks, baiu_link, exemplaires, contact_interne, is_published)
* bool $showBackoffice — Backoffice fieldset (context_note, jury_points, remarks, baiu_link, exemplaires, contact_visible, contact_interne, is_published)
* bool $showEmailConfirmation — E-mail de confirmation fieldset
* string $helpFn — fn(string $key): string (for help blocks)
@@ -408,9 +408,9 @@ if ($filesMode === 'add'): ?>
<fieldset>
<legend>Backoffice</legend>
<!-- 1. Note contextuelle -->
<!-- 1. Note contextuelle relative à soutenance -->
<div class="admin-form-group">
<label for="context_note">Note contextuelle :</label>
<label for="context_note">Note contextuelle relative à soutenance :</label>
<div>
<textarea id="context_note" name="context_note"
rows="4" maxlength="1500"><?= htmlspecialchars(
@@ -479,16 +479,25 @@ if ($filesMode === 'add'): ?>
<small>Case logistique : cocher si un exemplaire physique est disponible à l'ERG.</small>
</div>
<!-- 7. Contact interne -->
<!-- 7. Contact visible (public) -->
<div class="admin-form-group">
<label for="contact_interne">Contact interne :</label>
<label for="contact_visible">Contact visible :</label>
<input type="text" id="contact_visible" name="contact_visible"
value="<?= htmlspecialchars($currentContactVisible ?? $formData['contact_visible'] ?? '') ?>"
placeholder="email, URL, @pseudo...">
<small>Contact affiché publiquement sur la page du TFE (email, site web, réseau social…). Laisser vide pour ne rien afficher.</small>
</div>
<!-- 8. Contact interne (privé) -->
<div class="admin-form-group">
<label for="contact_interne">Contact interne (privé) :</label>
<input type="email" id="contact_interne" name="contact_interne"
value="<?= htmlspecialchars($contactInterne ?? $formData['contact_interne'] ?? '') ?>"
placeholder="ton.email@exemple.be">
<small>Adresse de contact interne (non visible publiquement). Peut être laissé vide.</small>
<small>Email privé de l'étudiant·e, utilisé pour l'envoi de la confirmation du formulaire. Non visible publiquement.</small>
</div>
<!-- 8. Publication -->
<!-- 9. Publication -->
<div class="admin-form-group">
<label class="admin-checkbox-label">
<input type="checkbox" name="is_published" value="1"