Always show durée and annexes fields in recapitulatif and public TFE pages

Previously these fields were conditionally hidden when empty, making
  it unclear whether the data was simply not entered. Now they always
  display: durée shows '–' when no data, annexes shows 'Non'.
This commit is contained in:
Pontoporeia
2026-07-08 15:05:35 +02:00
parent 6ecab96137
commit f6468c6d44
+12 -15
View File
@@ -132,23 +132,20 @@
<?php endif; ?>
<?php
$_hasPages = isset($thesis['duration_pages']) && $thesis['duration_pages'] !== null;
$_hasMins = isset($thesis['duration_minutes']) && $thesis['duration_minutes'] !== null;
if ($_hasPages || $_hasMins):
$_parts = [];
if ($_hasPages) $_parts[] = $thesis['duration_pages'] . ' pages';
if ($_hasMins) {
$_h = (int)floor($thesis['duration_minutes'] / 60);
$_m = $thesis['duration_minutes'] % 60;
$_parts[] = $_h . 'h' . str_pad((string)$_m, 2, '0', STR_PAD_LEFT);
}
$_hasPages = isset($thesis['duration_pages']) && $thesis['duration_pages'] !== null && $thesis['duration_pages'] !== '';
$_hasMins = isset($thesis['duration_minutes']) && $thesis['duration_minutes'] !== null && $thesis['duration_minutes'] !== '';
$_parts = [];
if ($_hasPages) $_parts[] = $thesis['duration_pages'] . ' pages';
if ($_hasMins) {
$_h = (int)floor((int)$thesis['duration_minutes'] / 60);
$_m = (int)$thesis['duration_minutes'] % 60;
$_parts[] = $_h . 'h' . str_pad((string)$_m, 2, '0', STR_PAD_LEFT);
}
$_duree = $_parts ? htmlspecialchars(implode(', ', $_parts)) : '';
?>
<dt>Durée</dt><dd><?= htmlspecialchars(implode(', ', $_parts)) ?></dd>
<?php endif; ?>
<dt>Durée</dt><dd><?= $_duree ?></dd>
<?php if (!empty($thesis['has_annexes'])): ?>
<dt>Annexes</dt><dd>Oui</dd>
<?php endif; ?>
<dt>Annexes</dt><dd><?= !empty($thesis['has_annexes']) ? 'Oui' : 'Non' ?></dd>
<?php if ($thesis['baiu_link']): ?>
<dt>Lien BAIU</dt><dd><a href="<?= htmlspecialchars($thesis['baiu_link']) ?>" target="_blank" rel="noopener"><?= htmlspecialchars($thesis['baiu_link']) ?></a></dd>