mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
fix: resolve partage form submission issues
- Replace mb_strlen/mb_substr/mb_strtolower with strlen/substr/strtolower (mbstring extension missing on server, causing fatal error) - Scope annexes checkbox HTMX swap to #annexes-input-block with hx-select (prevents duplicating entire page inside Fichiers fieldset) - Split format+fichiers response: #format-fichiers-block (stable) and #format-extras-block (swappable, inside Fichiers fieldset). Format checkboxes use hx-select to extract only the extras, preserving file queue. - Keep format extras inline in Fichiers fieldset (no sub-fieldsets). Remove website legend input (URL only). - When PeerTube upload disabled, show direct file upload inputs for video/audio (name=files[]). - Add "Glissez-déposez" sort hint below TFE file queue. - Fix .fq-name overflow with width:0;min-width:100% chain. - Remove legend placeholder from .fq-item. - Merge "Récits et expérimentation" AP into "Narration Spéculative". Rename PACS to "Pratique de lart - outils critiques, arts et contexte simultanés". - Remove président·e field from jury fieldset, form templates, and controller validation. Keep DB column and display logic for existing data.
This commit is contained in:
@@ -165,18 +165,19 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
return $r ? (int)$r['id'] : null;
|
||||
};
|
||||
|
||||
// AP alias map: variant spellings → canonical DB name.
|
||||
// AP alias map: variant spellings → canonical code.
|
||||
$apAliases = [
|
||||
'l.i.e.n.s.' => 'Lieux, Interdisciplinarités, Écologie, Nécessité, Systèmes',
|
||||
'liens' => 'Lieux, Interdisciplinarités, Écologie, Nécessité, Systèmes',
|
||||
'l.i.e.n.s.' => 'LIENS',
|
||||
'liens' => 'LIENS',
|
||||
'lieux, interdisciplinarités, écologie, nécessité, systèmes'
|
||||
=> 'Lieux, Interdisciplinarités, Écologie, Nécessité, Systèmes',
|
||||
'récits et expérimentation' => 'Récits et expérimentation',
|
||||
'recits et experimentation' => 'Récits et expérimentation',
|
||||
'atelier pratiques situées' => 'Atelier Pratiques Situées',
|
||||
'design et politique du multiple' => 'Design et Politique du Multiple',
|
||||
'narration spéculative' => 'Narration Spéculative',
|
||||
=> 'LIENS',
|
||||
'récits et expérimentation' => 'NS',
|
||||
'recits et experimentation' => 'NS',
|
||||
'atelier pratiques situées' => 'APS',
|
||||
'design et politique du multiple' => 'DPM',
|
||||
'narration spéculative' => 'NS',
|
||||
'pacs' => 'PACS',
|
||||
'pratique de l''art' => 'PACS',
|
||||
];
|
||||
|
||||
// Resolve an AP string (code or full name) → ap_program id.
|
||||
@@ -184,14 +185,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
$raw = trim($raw);
|
||||
if ($raw === '') return null;
|
||||
|
||||
// 1. Try alias map (lowercase key)
|
||||
// 1. Try alias map (lowercase key) → canonical code
|
||||
$key = strtolower($raw);
|
||||
if (isset($apAliases[$key])) {
|
||||
$raw = $apAliases[$key];
|
||||
}
|
||||
|
||||
// 2. Exact name match
|
||||
$s = $importPdo->prepare("SELECT id FROM ap_programs WHERE name = ?");
|
||||
// 2. Match by code
|
||||
$s = $importPdo->prepare("SELECT id FROM ap_programs WHERE code = ?");
|
||||
$s->execute([$raw]);
|
||||
$r = $s->fetch();
|
||||
if ($r) return (int)$r['id'];
|
||||
@@ -257,7 +258,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
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) . "\")");
|
||||
. " (id=\"" . ($identifier ?: '?') . "\", titre=\"" . substr($title, 0, 80) . "\")");
|
||||
}
|
||||
|
||||
$orientationId = $resolveOrientation($orientationCode);
|
||||
|
||||
Reference in New Issue
Block a user