mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user