diff --git a/TODO.md b/TODO.md index 777d468..4dff1f0 100644 --- a/TODO.md +++ b/TODO.md @@ -66,3 +66,4 @@ - [x] Handle jury_promoteur[] and jury_promoteur_ulb_name[] as arrays in partage/index.php - [x] Make Auteur(s) and Accès columns sortable alphabetically in admin list - [x] Merge both .recap-section sections into one + add margin-bottom: var(--space-l) +- [x] Fix Fatal error: old() type error in jury-fieldset.php — switch from global old() to $oldFn callable diff --git a/app/public/assets/css/form.css b/app/public/assets/css/form.css index 42c70f4..9ba4870 100644 --- a/app/public/assets/css/form.css +++ b/app/public/assets/css/form.css @@ -832,7 +832,8 @@ a.recap-file-name:hover { padding-top: var(--space-m); width: 100%; max-width: 620px; - margin-bottom: var(--space-l); + /* margin-bottom: var(--space-l); */ + padding-bottom: var(--space-xl); } .recap-section h2 { diff --git a/app/templates/admin/acces.php b/app/templates/admin/acces.php index 223a18c..fd91655 100644 --- a/app/templates/admin/acces.php +++ b/app/templates/admin/acces.php @@ -506,6 +506,19 @@ +%%%%%%% diff from: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision) +\\\\\\\ to: wpspurnq 76964b90 "Make Auteur(s) and Accès columns sortable alphabetically in admin list" (rebased revision) ++ $linkName = $link['name'] ?? ''; +++ $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : ''; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff from: wpspurnq 76964b90 "Make Auteur(s) and Accès columns sortable alphabetically in admin list" (rebased revision) +\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ to: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision) +- $linkName = $link['name'] ?? ''; +- $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : ''; +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff from: somsyvxz 14a3cd10 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebase destination) +\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ to: snsxswsz 1675e31b "fix: jury-fieldset.php calling old() with wrong signature for partage" (rebased revision) + $linkName = $link['name'] ?? ''; + $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : ''; + $linkLockedYear = $link['locked_year'] ?? null; ++%%%%%%% diff from: somsyvxz 249f7943 "Bulk bar anti-shift, tags icons, AP no-wrap, credits reorder" (rebased revision) ++\\\\\\\ to: snsxswsz 5a33fb93 "fix: jury-fieldset.php calling old() with wrong signature for partage" (rebased revision) +++ $linkName = $link['name'] ?? ''; ++ $linkExpiresVal = $link['expires_at'] ? date('Y-m-d\TH:i', strtotime($link['expires_at'])) : ''; ?> diff --git a/app/templates/partials/form/jury-fieldset.php b/app/templates/partials/form/jury-fieldset.php index 0daf990..852c267 100644 --- a/app/templates/partials/form/jury-fieldset.php +++ b/app/templates/partials/form/jury-fieldset.php @@ -12,8 +12,11 @@ * $juryPresident string|null (Deprecated — no longer displayed) * $showPromoteurUlb bool Show ULB promoteur field (default: true) * $promoteurUlbConditional bool If true, field is hidden unless finality=Approfondi + * callable|null $oldFn — callable($key, $default='') to retrieve old/current values; + * falls back to the global old() function when null. + * array $formData — raw form data array (used for jury repopulation). * - * In add-mode repopulation: if old() exists and values are null, populate from it. + * In add-mode repopulation: if $oldFn is provided and values are null, populate from it. */ $juryPromoteur = $juryPromoteur ?? null; @@ -25,12 +28,13 @@ $lecteursExternes = $lecteursExternes ?? []; $showPromoteurUlb = $showPromoteurUlb ?? true; $promoteurUlbConditional = $promoteurUlbConditional ?? false; $adminMode = $adminMode ?? false; +$oldFn = $oldFn ?? (function_exists('old') ? 'old' : fn($k, $d = '') => $d); // Add-mode repopulation from flash data $addMode = ($juryPromoteur === null && empty($juryPromoteurs) && $juryPromoteurUlb === null && empty($juryPromoteursUlb) && empty($lecteursInternes) && empty($lecteursExternes)); -if ($addMode && function_exists('old')) { +if ($addMode) { // jury_promoteur may be array (new form) or scalar (legacy) - $promoteursOld = old('jury_promoteur'); + $promoteursOld = $oldFn('jury_promoteur'); if (is_array($promoteursOld)) { foreach ($promoteursOld as $name) { $name = trim($name ?? ''); @@ -40,7 +44,7 @@ if ($addMode && function_exists('old')) { $juryPromoteur = $promoteursOld; } // jury_promoteur_ulb_name may be array (new form) or scalar (legacy) - $promoteursUlbOld = old('jury_promoteur_ulb_name'); + $promoteursUlbOld = $oldFn('jury_promoteur_ulb_name'); if (is_array($promoteursUlbOld)) { foreach ($promoteursUlbOld as $name) { $name = trim($name ?? ''); @@ -50,11 +54,11 @@ if ($addMode && function_exists('old')) { $juryPromoteurUlb = $promoteursUlbOld; } for ($i = 0; $i < 10; $i++) { - $n = old("jury_lecteur_interne:$i"); + $n = $oldFn("jury_lecteur_interne:$i"); if (is_string($n) && $n !== '') $lecteursInternes[] = ['name' => $n]; } for ($i = 0; $i < 10; $i++) { - $n = old("jury_lecteur_externe:$i"); + $n = $oldFn("jury_lecteur_externe:$i"); if (is_string($n) && $n !== '') $lecteursExternes[] = ['name' => $n]; } }