ver. 0.309: ApiloLogger + cache-busting CSS/JS + poprawki UI

- ApiloLogger: logowanie operacji Apilo do pp_log z kontekstem JSON
- Cache-busting: ?ver=filemtime() dla CSS i JS w admin main-layout
- Fix: inicjalizacja $mdb przed SettingsRepository w admin/index.php
- Fix: rzutowanie (string) w ShopProductController::escapeHtml()
- UI: text-overflow ellipsis dla kategorii produktow + title tooltip
- JS: navigator.clipboard API w copyToClipboard() z fallbackiem
- CSS: uproszczenie .site-content, usuniecie .with-menu
- Migracja: pp_log + kolumny action, order_id, context

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 09:31:28 +01:00
parent f31630b69c
commit 4de5479c41
14 changed files with 192 additions and 2042 deletions

View File

@@ -425,13 +425,29 @@ class OrderAdminService
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$apiloResultRaw = curl_exec($ch);
$http_code = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
$apiloResult = json_decode((string)$apiloResultRaw, true);
if (!is_array($apiloResult) || (int)($apiloResult['updates'] ?? 0) !== 1) {
\Domain\Integrations\ApiloLogger::log(
$mdb,
'resend_order',
$orderId,
'Błąd ponownego wysyłania zamówienia do Apilo (HTTP: ' . $http_code . ')',
['apilo_order_id' => $order['apilo_order_id'], 'http_code' => $http_code, 'response' => $apiloResult]
);
curl_close($ch);
return false;
}
\Domain\Integrations\ApiloLogger::log(
$mdb,
'resend_order',
$orderId,
'Zamówienie ponownie wysłane do Apilo (apilo_order_id: ' . $order['apilo_order_id'] . ')',
['apilo_order_id' => $order['apilo_order_id'], 'http_code' => $http_code, 'response' => $apiloResult]
);
$query = "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'pp_shop_orders' AND COLUMN_NAME != 'id'";
$stmt = $mdb->query($query);
$columns = $stmt ? $stmt->fetchAll(\PDO::FETCH_COLUMN) : [];
@@ -685,6 +701,23 @@ class OrderAdminService
self::appendApiloLog("PAYMENT RESPONSE\nHTTP: " . $http_code . "\nCURL: " . $curl_error . "\n" . print_r($apilo_response, true));
}
$success = ($curl_error === '' && $http_code >= 200 && $http_code < 300);
\Domain\Integrations\ApiloLogger::log(
$db,
'payment_sync',
(int)$order['id'],
$success
? 'Płatność zsynchronizowana z Apilo (apilo_order_id: ' . $order['apilo_order_id'] . ')'
: 'Błąd synchronizacji płatności (HTTP: ' . $http_code . ($curl_error ? ', cURL: ' . $curl_error : '') . ')',
[
'apilo_order_id' => $order['apilo_order_id'],
'http_code' => $http_code,
'curl_error' => $curl_error,
'response' => json_decode((string)$apilo_response, true),
]
);
if ($curl_error !== '') return false;
if ($http_code < 200 || $http_code >= 300) return false;
@@ -729,6 +762,24 @@ class OrderAdminService
self::appendApiloLog("STATUS RESPONSE\nHTTP: " . $http_code . "\nCURL: " . $curl_error . "\n" . print_r($apilo_result, true));
}
$success = ($curl_error === '' && $http_code >= 200 && $http_code < 300);
\Domain\Integrations\ApiloLogger::log(
$db,
'status_sync',
(int)$order['id'],
$success
? 'Status zsynchronizowany z Apilo (apilo_order_id: ' . $order['apilo_order_id'] . ', status: ' . $status . ')'
: 'Błąd synchronizacji statusu (HTTP: ' . $http_code . ($curl_error ? ', cURL: ' . $curl_error : '') . ')',
[
'apilo_order_id' => $order['apilo_order_id'],
'status' => $status,
'http_code' => $http_code,
'curl_error' => $curl_error,
'response' => json_decode((string)$apilo_result, true),
]
);
if ($curl_error !== '') return false;
if ($http_code < 200 || $http_code >= 300) return false;