Remove duration_pages/duration_minutes/file_size_info; rename cc4r → cc2r in DB and code

This commit is contained in:
Pontoporeia
2026-05-09 18:39:38 +02:00
parent cc0ae32df0
commit c4a23d5c2d
18 changed files with 130 additions and 309 deletions

View File

@@ -79,9 +79,8 @@
['fieldset_files', 'Format(s) + Fichiers',
['Formats (PDF, vidéo, audio, site web…)', 'Couverture', 'Note d\'intention', 'Fichier principal', 'Annexes']],
// Métadonnées complémentaires
['fieldset_metadata', 'Métadonnées complémentaires',
['Nombre de pages', 'Durée (minutes)']],
// Métadonnées complémentaires (supprimé)
// Ces champs sont redondants avec les fichiers attachés
// Degrés d'ouverture et licences
['fieldset_access', 'Degrés d\'ouverture et licences',

View File

@@ -14,8 +14,6 @@
'orientation' => $thesis['orientation'],
'ap' => $thesis['ap_program'],
'finality' => $thesis['finality_type'],
'duration_pages' => $currentRaw['duration_pages'] ?? '',
'duration_minutes' => $currentRaw['duration_minutes'] ?? '',
'lien' => $thesis['baiu_link'] ?? '',
'contact_public' => $currentAuthorShowContact ?? false,
]);
@@ -81,7 +79,7 @@
$formData['access_type_id'] = $currentAccessTypeId;
$formData['license_id'] = $currentLicenseId;
$formData['license_custom'] = $currentRaw['license_custom'] ?? '';
$formData['cc2r'] = $currentRaw['cc4r'] ?? false;
$formData['cc2r'] = $currentRaw['cc2r'] ?? false;
// Optional sections
$showContact = false; // Admin: contact visibility controlled by filling 'mail' field in fieldset-tfe-info

View File

@@ -81,9 +81,6 @@
<?php if ($thesis['keywords']): ?>
<dt>Mots-clés</dt><dd><?= htmlspecialchars($thesis['keywords']) ?></dd>
<?php endif; ?>
<?php if ($thesis['file_size_info']): ?>
<dt>Durée / Taille</dt><dd><?= htmlspecialchars($thesis['file_size_info']) ?></dd>
<?php endif; ?>
<?php if ($thesis['baiu_link']): ?>
<dt>Lien</dt><dd><a href="<?= htmlspecialchars($thesis['baiu_link']) ?>" target="_blank" rel="noopener"><?= htmlspecialchars($thesis['baiu_link']) ?></a></dd>
<?php endif; ?>

View File

@@ -1,34 +0,0 @@
<?php
/**
* Shared partial — "Métadonnées complémentaires" fieldset.
*
* Fields: duration (pages + minutes).
* Annexes checkbox + file input moved to Fichiers fieldset (fichiers-fragment.php).
* Lien BAIU moved to Backoffice fieldset.
*
* Variables consumed:
* callable|null $oldFn — callable($key, $default='') for old/current values.
* callable|null $withAutofocusFn — callable($field, $attrs=[]) to inject autofocus.
* array $formData — raw form data (used for repopulation).
*/
$oldFn = $oldFn ?? (function_exists('old') ? 'old' : fn($k, $d = '') => $d);
$withAutofocusFn = $withAutofocusFn ?? fn($field, $attrs = []) => $attrs;
$formData = $formData ?? [];
?>
<fieldset>
<legend>Métadonnées complémentaires</legend>
<?php
$name = 'duration_pages'; $label = 'Nombre de pages :'; $value = $oldFn('duration_pages');
$type = 'number'; $placeholder = ''; $hint = 'Ex : 84';
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
<?php
$name = 'duration_minutes'; $label = 'Durée (minutes) :'; $value = $oldFn('duration_minutes');
$type = 'number'; $placeholder = ''; $hint = 'Ex : 32 (pour œuvres audio/vidéo)';
include APP_ROOT . '/templates/partials/form/text-field.php';
?>
</fieldset>
<?php

View File

@@ -399,15 +399,8 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
</div><!-- #edit-existing-files-block -->
<?php endif; ?>
<!-- ═══════════════════ Métadonnées complémentaires ═══════════════════ -->
<?php
if ($mode === "partage" && isset($helpFn)) {
$helpContent = $helpFn("fieldset_metadata");
$helpKey = 'fieldset_metadata';
include APP_ROOT . "/templates/partials/form/form-help-block.php";
}
include APP_ROOT .
"/templates/partials/form/fieldset-metadata.php"; ?>
<!-- ═══════════════════ Métadonnées complémentaires ═══════════════════
(Durée/Nombre de pages supprimés — redondants avec les fichiers attachés) -->
<!-- ═══════════════════ Degrés d'ouverture et licences ═══════════════════ -->
<?php

View File

@@ -82,13 +82,6 @@
</div>
<?php endif; ?>
<?php if (!empty($data["file_size_info"])): ?>
<div>
<dt>Durée :</dt>
<dd><?= htmlspecialchars($data["file_size_info"]) ?></dd>
</div>
<?php endif; ?>
<?php if (!empty($data["keywords"])): ?>
<div>
<dt>Mots-clés :</dt>