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:
File diff suppressed because one or more lines are too long
@@ -21,3 +21,6 @@
|
|||||||
- [x] Standardise test group recipes: lint-php, lint-css, lint-js, test + add fix recipe + make lint pass clean
|
- [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] 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
|
- [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)
|
||||||
|
|||||||
@@ -340,17 +340,8 @@ class ThesisCreateController
|
|||||||
if ($contactVisible === '') {
|
if ($contactVisible === '') {
|
||||||
$contactVisible = trim($post['mail'] ?? '');
|
$contactVisible = trim($post['mail'] ?? '');
|
||||||
}
|
}
|
||||||
// showContact: whether to show the contact publicly on the TFE page.
|
// showContact: if a contact_visible is provided, it's automatically public.
|
||||||
// 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 = $contactVisible !== '';
|
||||||
}
|
|
||||||
|
|
||||||
$annee = filter_var($post['année'] ?? '', FILTER_VALIDATE_INT);
|
$annee = filter_var($post['année'] ?? '', FILTER_VALIDATE_INT);
|
||||||
if ($annee === false || $annee < 2000 || $annee > ((int) date('Y') + 1)) {
|
if ($annee === false || $annee < 2000 || $annee > ((int) date('Y') + 1)) {
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ class ThesisEditController
|
|||||||
$contactInterne = trim($post['contact_interne'] ?? '');
|
$contactInterne = trim($post['contact_interne'] ?? '');
|
||||||
$firstAuthorEmail = $contactInterne !== '' ? $contactInterne : null;
|
$firstAuthorEmail = $contactInterne !== '' ? $contactInterne : null;
|
||||||
// contact_public: whether to show the public contact on the TFE page
|
// contact_public: whether to show the public contact on the TFE page
|
||||||
$showContact = !empty($post['contact_public']);
|
$showContact = trim($post['contact_visible'] ?? '') !== '';
|
||||||
$authorNames = [];
|
$authorNames = [];
|
||||||
if ($authorsRaw !== '') {
|
if ($authorsRaw !== '') {
|
||||||
$authorNames = array_values(array_filter(array_map('trim', explode(',', $authorsRaw)), fn ($n) => $n !== ''));
|
$authorNames = array_values(array_filter(array_map('trim', explode(',', $authorsRaw)), fn ($n) => $n !== ''));
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class FormBootstrap
|
|||||||
$autofocusField = App::consumeAutofocus();
|
$autofocusField = App::consumeAutofocus();
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
$showContact = ($mode === 'add' || $mode === 'edit');
|
$showContact = false;
|
||||||
$showBackoffice = ($mode === 'add' || $mode === 'edit');
|
$showBackoffice = ($mode === 'add' || $mode === 'edit');
|
||||||
|
|
||||||
// Licence / access toggles: admin always enables all three
|
// Licence / access toggles: admin always enables all three
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<?php if (!empty($data["contact_visible"]) && !empty($data["contact_public"])): ?>
|
<?php if (!empty($data["contact_visible"])): ?>
|
||||||
<p class="tfe-meta-item">
|
<p class="tfe-meta-item">
|
||||||
<span class="tfe-meta-label">Contact :</span>
|
<span class="tfe-meta-label">Contact :</span>
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
Reference in New Issue
Block a user