centralise repertoire filter column rendering

- shared repFilterEntry() and  config array
- shared repFilterEntry() and $filterColumns config array
- fix single-valued FK fading via full intersection
This commit is contained in:
Pontoporeia
2026-05-05 18:27:47 +02:00
parent bca707ee96
commit b063312642
6 changed files with 121 additions and 177 deletions

View File

@@ -139,29 +139,40 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
try {
$importDb->beginTransaction();
$identifier = trim($row[0] ?? '');
$title = trim($row[1] ?? '');
$subtitle = trim($row[2] ?? '');
$authorsRaw = trim($row[3] ?? '');
$contact = trim($row[4] ?? '');
$supervisorsRaw = trim($row[5] ?? '');
$formatsRaw = trim($row[6] ?? '');
$year = intval($row[7] ?? 0);
$apCode = trim($row[8] ?? '');
$orientationCode = trim($row[9] ?? '');
$finalityName = trim($row[10] ?? '');
$keywordsRaw = trim($row[11] ?? '');
$synopsis = trim($row[12] ?? '');
$context = trim($row[13] ?? '');
$remarks = trim($row[14] ?? '');
$languageRaw = trim($row[15] ?? '');
$access = trim($row[16] ?? '');
$license = trim($row[17] ?? '');
$sizeInfo = trim($row[18] ?? '');
$juryPoints = !empty($row[19]) ? floatval($row[19]) : null;
$baiuLink = trim($row[20] ?? '');
// Pad row to expected column count to avoid offset warnings.
$expectedCols = 21;
while (count($row) < $expectedCols) $row[] = '';
if (empty($title) || empty($year)) throw new Exception("Titre et année requis.");
$identifier = trim($row[0]);
$title = trim($row[1]);
$subtitle = trim($row[2]);
$authorsRaw = trim($row[3]);
$contact = trim($row[4]);
$supervisorsRaw = trim($row[5]);
$formatsRaw = trim($row[6]);
$yearRaw = trim($row[7]);
$year = $yearRaw !== '' ? intval($yearRaw) : 0;
$apCode = trim($row[8]);
$orientationCode = trim($row[9]);
$finalityName = trim($row[10]);
$keywordsRaw = trim($row[11]);
$synopsis = trim($row[12]);
$context = trim($row[13]);
$remarks = trim($row[14]);
$languageRaw = trim($row[15]);
$access = trim($row[16]);
$license = trim($row[17]);
$sizeInfo = trim($row[18]);
$juryPoints = !empty($row[19]) ? floatval($row[19]) : null;
$baiuLink = trim($row[20]);
if ($title === '' || $year === 0) {
$missing = [];
if ($title === '') $missing[] = 'titre';
if ($year === 0) $missing[] = 'année';
throw new Exception("Champ(s) requis manquant(s) : " . implode(', ', $missing)
. " (id=\"" . ($identifier ?: '?') . "\", titre=\"" . mb_substr($title, 0, 80) . "\")");
}
$orientationId = $resolveOrientation($orientationCode);
$apProgramId = $resolveAP($apCode);

View File

@@ -416,6 +416,7 @@ main {
opacity 0.15s,
box-shadow 0.15s,
filter 0.15s;
width: fit-content;
}
.btn:hover {
@@ -563,7 +564,7 @@ main {
============================================================ */
fieldset {
background: var(--bg-secondary);
/*background: var(--bg-secondary);*/
border: 1px solid var(--border-primary);
border-radius: 4px;
padding: var(--space-m);