mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 07:11:18 +02:00
Remove public contact visibility checkbox from admin add/edit forms
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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 !== ''));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user