mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-26 08:39:18 +02:00
Fix migrations and deploy issues + errors + linting
- scan both pending/ and applied/ dirs so remote catch-up works - fix remote 500s: run.php handles per-statement errors so VIEW rebuilds run after duplicate columns; replace mb_strimwidth with substr (no mbstring extension on server) - add missing migration: 015_license_custom.sql (column existed in schema.sql but was never migrated) - remote: fgetcsv enclosure single-char + AdminLogger permission-denied guard + deploy always migrates - fix admin-filters wrapping: restore flex-wrap, flex-basis on inputs/selects, shrink-protect buttons - fix phpstan: remove redundant ?? [] after isset guard in ThesisEditController - biome: exclude vendored min.js via includes patterns; lint whole js dir; modernise beforeunload-guard.js
This commit is contained in:
@@ -46,7 +46,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
'autorisation', 'licence', 'license', 'taille', 'points', 'lien baiu',
|
||||
];
|
||||
for ($scan = 0; $scan < 8; $scan++) {
|
||||
$hrow = fgetcsv($handle, 0, ',', '\"', '');
|
||||
$hrow = fgetcsv($handle, 0, ',', '"', '');
|
||||
if ($hrow === false) break;
|
||||
$headerRowNum++;
|
||||
$normRow = array_map(fn($s) => strtolower(trim((string)$s)), $hrow);
|
||||
@@ -84,7 +84,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
$idPos = $colIdx['identifiant'] ?? 0;
|
||||
$peekRow = null;
|
||||
while (true) {
|
||||
$peek = fgetcsv($handle, 0, ',', '\"', '');
|
||||
$peek = fgetcsv($handle, 0, ',', '"', '');
|
||||
if ($peek === false) break;
|
||||
$headerRowNum++;
|
||||
$val = trim((string)($peek[$idPos] ?? ''));
|
||||
@@ -216,7 +216,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
|
||||
$row = $peekRow;
|
||||
$usePeek = false;
|
||||
} else {
|
||||
$row = fgetcsv($handle, 0, ',', '\"', '');
|
||||
$row = fgetcsv($handle, 0, ',', '"', '');
|
||||
if ($row === false) break;
|
||||
}
|
||||
$lineNumber++;
|
||||
|
||||
@@ -737,7 +737,22 @@
|
||||
.admin-list-toolbar .admin-filters {
|
||||
flex: 1;
|
||||
margin-bottom: 0;
|
||||
flex-wrap: nowrap;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.admin-list-toolbar .admin-filters input[type="text"] {
|
||||
min-width: 10rem;
|
||||
flex: 1 1 10rem;
|
||||
}
|
||||
|
||||
.admin-list-toolbar .admin-filters select {
|
||||
min-width: 7rem;
|
||||
flex: 1 1 7rem;
|
||||
}
|
||||
|
||||
.admin-list-toolbar .admin-filters .btn {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.admin-list-toolbar__right {
|
||||
|
||||
@@ -4,20 +4,19 @@
|
||||
* Attach to any form with a data-beforeunload-guard attribute.
|
||||
* No effect when JavaScript is unavailable (form posts normally).
|
||||
*/
|
||||
(function () {
|
||||
var forms = document.querySelectorAll('form[data-beforeunload-guard]');
|
||||
(() => {
|
||||
const forms = document.querySelectorAll('form[data-beforeunload-guard]');
|
||||
if (!forms.length) return;
|
||||
|
||||
var dirty = false;
|
||||
let dirty = false;
|
||||
|
||||
for (var i = 0; i < forms.length; i++) {
|
||||
var form = forms[i];
|
||||
form.addEventListener('input', function () { dirty = true; });
|
||||
form.addEventListener('change', function () { dirty = true; });
|
||||
form.addEventListener('submit', function () { dirty = false; });
|
||||
for (const form of forms) {
|
||||
form.addEventListener('input', () => { dirty = true; });
|
||||
form.addEventListener('change', () => { dirty = true; });
|
||||
form.addEventListener('submit', () => { dirty = false; });
|
||||
}
|
||||
|
||||
window.addEventListener('beforeunload', function (e) {
|
||||
window.addEventListener('beforeunload', (e) => {
|
||||
if (dirty) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user