Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09d266204e | |||
| 8f43f5ab4d |
@@ -3,6 +3,7 @@ $orderId = (int)($this -> order['id'] ?? 0);
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="site-title">Szczegóły zamówienia: <?= htmlspecialchars((string)($this -> order['number'] ?? ''), ENT_QUOTES, 'UTF-8');?></div>
|
<div class="site-title">Szczegóły zamówienia: <?= htmlspecialchars((string)($this -> order['number'] ?? ''), ENT_QUOTES, 'UTF-8');?></div>
|
||||||
|
<script>document.title = 'Zamówienie <?= htmlspecialchars((string)($this -> order['number'] ?? ''), ENT_QUOTES, 'UTF-8');?> - shopPro';</script>
|
||||||
|
|
||||||
<div class="od-actions mb15">
|
<div class="od-actions mb15">
|
||||||
<a href="/admin/shop_order/list/" class="btn btn-dark btn-sm">
|
<a href="/admin/shop_order/list/" class="btn btn-dark btn-sm">
|
||||||
|
|||||||
@@ -322,7 +322,7 @@
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/admin/settings/globalSearchAjax/',
|
url: '/admin/settings/globalSearchAjax/',
|
||||||
type: 'GET',
|
type: 'POST',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
data: { q: phrase },
|
data: { q: phrase },
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
@@ -333,8 +333,12 @@
|
|||||||
|
|
||||||
renderResults(response.items || []);
|
renderResults(response.items || []);
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function(xhr) {
|
||||||
$results.html('<div class="admin-global-search-empty">Błąd połączenia</div>').addClass('open');
|
var msg = 'Błąd połączenia';
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
msg = 'Błąd parsowania odpowiedzi';
|
||||||
|
}
|
||||||
|
$results.html('<div class="admin-global-search-empty">' + msg + '</div>').addClass('open');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,26 +73,45 @@ class SettingsController
|
|||||||
*/
|
*/
|
||||||
public function globalSearchAjax(): void
|
public function globalSearchAjax(): void
|
||||||
{
|
{
|
||||||
global $mdb;
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
|
header('Cache-Control: no-store');
|
||||||
|
|
||||||
$phrase = trim((string)\Shared\Helpers\Helpers::get('q'));
|
try {
|
||||||
if ($phrase === '' || mb_strlen($phrase) < 2) {
|
$this->executeGlobalSearch();
|
||||||
|
} catch (\Throwable $e) {
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'status' => 'ok',
|
'status' => 'error',
|
||||||
'items' => [],
|
'items' => [],
|
||||||
]);
|
]);
|
||||||
exit;
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function executeGlobalSearch(): void
|
||||||
|
{
|
||||||
|
global $mdb;
|
||||||
|
|
||||||
|
$phrase = isset($_REQUEST['q']) ? trim((string)$_REQUEST['q']) : '';
|
||||||
|
if ($phrase === '' || mb_strlen($phrase) < 2) {
|
||||||
|
echo json_encode(['status' => 'ok', 'items' => []]);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phrase = mb_substr($phrase, 0, 120);
|
$phrase = mb_substr($phrase, 0, 120);
|
||||||
$phraseNormalized = preg_replace('/\s+/', ' ', $phrase);
|
$phraseNormalized = trim((string)preg_replace('/\s+/', ' ', $phrase));
|
||||||
$phraseNormalized = trim((string)$phraseNormalized);
|
|
||||||
$like = '%' . $phrase . '%';
|
$like = '%' . $phrase . '%';
|
||||||
$likeNormalized = '%' . $phraseNormalized . '%';
|
$likeNormalized = '%' . $phraseNormalized . '%';
|
||||||
|
|
||||||
$items = [];
|
$items = [];
|
||||||
$defaultLang = (string)$this->languagesRepository->defaultLanguage();
|
|
||||||
|
|
||||||
|
$defaultLang = '1';
|
||||||
|
try {
|
||||||
|
$defaultLang = (string)$this->languagesRepository->defaultLanguage();
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// fallback to '1'
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Produkty ---
|
||||||
try {
|
try {
|
||||||
$productStmt = $mdb->query(
|
$productStmt = $mdb->query(
|
||||||
'SELECT '
|
'SELECT '
|
||||||
@@ -115,7 +134,10 @@ class SettingsController
|
|||||||
$productStmt = false;
|
$productStmt = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$productRows = $productStmt ? $productStmt->fetchAll() : [];
|
$productRows = ($productStmt && method_exists($productStmt, 'fetchAll'))
|
||||||
|
? $productStmt->fetchAll(\PDO::FETCH_ASSOC)
|
||||||
|
: [];
|
||||||
|
|
||||||
if (is_array($productRows)) {
|
if (is_array($productRows)) {
|
||||||
foreach ($productRows as $row) {
|
foreach ($productRows as $row) {
|
||||||
$productId = (int)($row['id'] ?? 0);
|
$productId = (int)($row['id'] ?? 0);
|
||||||
@@ -147,6 +169,7 @@ class SettingsController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Zamowienia ---
|
||||||
try {
|
try {
|
||||||
$orderStmt = $mdb->query(
|
$orderStmt = $mdb->query(
|
||||||
'SELECT '
|
'SELECT '
|
||||||
@@ -178,7 +201,10 @@ class SettingsController
|
|||||||
$orderStmt = false;
|
$orderStmt = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$orderRows = $orderStmt ? $orderStmt->fetchAll() : [];
|
$orderRows = ($orderStmt && method_exists($orderStmt, 'fetchAll'))
|
||||||
|
? $orderStmt->fetchAll(\PDO::FETCH_ASSOC)
|
||||||
|
: [];
|
||||||
|
|
||||||
if (is_array($orderRows)) {
|
if (is_array($orderRows)) {
|
||||||
foreach ($orderRows as $row) {
|
foreach ($orderRows as $row) {
|
||||||
$orderId = (int)($row['id'] ?? 0);
|
$orderId = (int)($row['id'] ?? 0);
|
||||||
@@ -214,11 +240,12 @@ class SettingsController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo json_encode([
|
$json = json_encode(['status' => 'ok', 'items' => array_slice($items, 0, 20)]);
|
||||||
'status' => 'ok',
|
if ($json === false) {
|
||||||
'items' => array_slice($items, 0, 20),
|
echo json_encode(['status' => 'ok', 'items' => []], JSON_UNESCAPED_UNICODE);
|
||||||
]);
|
return;
|
||||||
exit;
|
}
|
||||||
|
echo $json;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ Logi zmian z migracji na Domain-Driven Architecture. Najnowsze na gorze.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## ver. 0.314 (2026-02-23) - Fix wyszukiwarki admin + title zamówienia
|
||||||
|
|
||||||
|
- **FIX**: Globalna wyszukiwarka w panelu admina przestała zwracać wyniki — dodano `Content-Type: application/json` i `Cache-Control: no-store` (zapobiega cache'owaniu przez proxy/CDN), zmiana AJAX z GET na POST, `fetchAll(PDO::FETCH_ASSOC)`, top-level try/catch z gwarantowaną odpowiedzią JSON
|
||||||
|
- **NEW**: `document.title` w widoku szczegółów zamówienia pokazuje numer zamówienia (np. "Zamówienie ZAM/123 - shopPro")
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## ver. 0.313 (2026-02-23) - Fix sync płatności Apilo + logowanie
|
## ver. 0.313 (2026-02-23) - Fix sync płatności Apilo + logowanie
|
||||||
|
|
||||||
- **FIX**: `syncApiloPayment()` i `syncApiloStatus()` — `(int)` cast na `apilo_order_id` (format `"PPxxxxxx"`) dawał `0`, przez co metody pomijały sync z API Apilo. Zmiana na `empty()`
|
- **FIX**: `syncApiloPayment()` i `syncApiloStatus()` — `(int)` cast na `apilo_order_id` (format `"PPxxxxxx"`) dawał `0`, przez co metody pomijały sync z API Apilo. Zmiana na `empty()`
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
1. Może warto przepisać zadania cron, na tabelę, tak żeby zadania cron się kolejkowały i wykonywały za podstawie wpisów z bazy danych, takż żeby własnie nie było sytuacji, że zamówienie będzie próbowało zmienić status w apilo, zanim to zamówienie tam trafi. Czy wszystkie takie zadania trafiałyby do kolejki i wykonywałyby się chronologicznie. Ewentualnie jakieś inne podejście możesz zaproponować.
|
||||||
BIN
updates/0.30/ver_0.313.zip
Normal file
BIN
updates/0.30/ver_0.313.zip
Normal file
Binary file not shown.
24
updates/0.30/ver_0.313_manifest.json
Normal file
24
updates/0.30/ver_0.313_manifest.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"changelog": "FIX - sync płatności Apilo (int cast na apilo_order_id PPxxxxxx dawał 0) + logowanie decyzji sync do pp_log",
|
||||||
|
"version": "0.313",
|
||||||
|
"files": {
|
||||||
|
"added": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"deleted": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"modified": [
|
||||||
|
"admin/templates/shop-order/order-details.php",
|
||||||
|
"autoload/Domain/Order/OrderAdminService.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"checksum_zip": "sha256:f344da1f3270abfc63653f8912ec1abbc006154db784cfee5a565fc0daaa75f8",
|
||||||
|
"sql": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"date": "2026-02-23",
|
||||||
|
"directories_deleted": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
|
<b>ver. 0.313 - 23.02.2026</b><br />
|
||||||
|
FIX - sync płatności Apilo (int cast na apilo_order_id PPxxxxxx dawał 0) + logowanie decyzji sync do pp_log
|
||||||
|
<hr>
|
||||||
<b>ver. 0.312 - 23.02.2026</b><br />
|
<b>ver. 0.312 - 23.02.2026</b><br />
|
||||||
FIX - krytyczne bugi integracji Apilo: curl_getinfo po curl_close, nieskończona pętla wysyłki, ceny 0.00 PLN, walidacja cen
|
FIX - krytyczne bugi integracji Apilo: curl_getinfo po curl_close, nieskończona pętla wysyłki, ceny 0.00 PLN, walidacja cen
|
||||||
<hr>
|
<hr>
|
||||||
<b>ver. 0.311 - 23.02.2026</b><br />
|
<b>ver. 0.311 - 23.02.2026</b><br />
|
||||||
FIX - race condition callback płatności Apilo, persistence filtrów tabel admin, poprawki cen zamówień
|
FIX - race condition callback płatności Apilo, persistence filtrów tabel admin, poprawki cen zamówień
|
||||||
<hr>
|
<hr>
|
||||||
<b>ver. 0.310 - 23.02.2026</b><br />
|
<b>ver. 0.310 - 23.02.2026</b><br />
|
||||||
NEW - Zakladka Logi w sekcji Integracje (podglad pp_log z paginacja, sortowaniem, filtrami)
|
NEW - Zakladka Logi w sekcji Integracje (podglad pp_log z paginacja, sortowaniem, filtrami)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?
|
<?
|
||||||
$current_ver = 313;
|
$current_ver = 314;
|
||||||
|
|
||||||
for ($i = 1; $i <= $current_ver; $i++)
|
for ($i = 1; $i <= $current_ver; $i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user