Remove public contact visibility checkbox from admin add/edit forms

This commit is contained in:
Pontoporeia
2026-07-05 14:04:29 +02:00
parent ec6c939f4e
commit 8e309bbcb7
6 changed files with 9 additions and 15 deletions
File diff suppressed because one or more lines are too long
+3
View File
@@ -21,3 +21,6 @@
- [x] Standardise test group recipes: lint-php, lint-css, lint-js, test + add fix recipe + make lint pass clean
- [x] Remove Mot de passe column from acces.php, add key.svg icon button in Actions to copy password to clipboard, reorder actions (URL/password/edit/toggle/archive), switch URL icon to link-simple.svg
- [x] Fix CC2r: removed hidden seeds (were stale/overriding user input), render initial licence-choice from \$formData; Interne want_license unchecked clears CC2r+licence, switching from other modes preserves values; CC2r independent toggle; licence dropdown has no-licence placeholder
- [ ] Dans le formulaire admin, le contact privé ne se sauvegarde pas.
- [x] Remove "Rendre le contact visible publiquement sur la fiche du TFE" from admin add/edit forms
- [x] Auto-show contact on public TFE page when contact_visible is filled (no checkbox needed)
+2 -11
View File
@@ -340,17 +340,8 @@ class ThesisCreateController
if ($contactVisible === '') {
$contactVisible = trim($post['mail'] ?? '');
}
// showContact: whether to show the contact publicly on the TFE page.
// In admin mode, the checkbox always renders — unchecked = not sent.
// In student mode (partage), the checkbox is not shown, so we
// default to true when contact_visible is filled.
if ($adminMode) {
$showContact = !empty($post['contact_public']);
} elseif (array_key_exists('contact_public', $post)) {
$showContact = !empty($post['contact_public']);
} else {
$showContact = $contactVisible !== '';
}
// showContact: if a contact_visible is provided, it's automatically public.
$showContact = $contactVisible !== '';
$annee = filter_var($post['année'] ?? '', FILTER_VALIDATE_INT);
if ($annee === false || $annee < 2000 || $annee > ((int) date('Y') + 1)) {
+1 -1
View File
@@ -251,7 +251,7 @@ class ThesisEditController
$contactInterne = trim($post['contact_interne'] ?? '');
$firstAuthorEmail = $contactInterne !== '' ? $contactInterne : null;
// contact_public: whether to show the public contact on the TFE page
$showContact = !empty($post['contact_public']);
$showContact = trim($post['contact_visible'] ?? '') !== '';
$authorNames = [];
if ($authorsRaw !== '') {
$authorNames = array_values(array_filter(array_map('trim', explode(',', $authorsRaw)), fn ($n) => $n !== ''));
+1 -1
View File
@@ -103,7 +103,7 @@ class FormBootstrap
$autofocusField = App::consumeAutofocus();
// Controls
$showContact = ($mode === 'add' || $mode === 'edit');
$showContact = false;
$showBackoffice = ($mode === 'add' || $mode === 'edit');
// Licence / access toggles: admin always enables all three
+1 -1
View File
@@ -202,7 +202,7 @@
<?php endif; ?>
<?php if (!empty($data["contact_visible"]) && !empty($data["contact_public"])): ?>
<?php if (!empty($data["contact_visible"])): ?>
<p class="tfe-meta-item">
<span class="tfe-meta-label">Contact :</span>
<?php