ver. 0.283: Legacy class cleanup — S, Html, Email, Image, Log, Mobile_Detect → Shared namespace

- Migrate class.S → Shared\Helpers\Helpers (140+ files), remove 12 unused methods
- Migrate class.Html → Shared\Html\Html
- Migrate class.Email → Shared\Email\Email
- Migrate class.Image → Shared\Image\ImageManipulator
- Delete class.Log (unused), class.Mobile_Detect (outdated UA detection)
- Remove grid library loading from admin (index.php, ajax.php)
- Replace gridEdit usage in 10 admin templates with grid-edit-replacement.php
- Fix grid-edit-replacement.php AJAX to send values as JSON (grid.js compat)
- Remove mobile layout conditionals (m_html/m_css/m_js) from Site + LayoutsRepository
- Remove \Log::save_log() calls from OrderAdminService, ShopOrder, Order

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 23:06:06 +01:00
parent 285cbe5515
commit 319491975d
159 changed files with 1501 additions and 3043 deletions

View File

@@ -162,7 +162,7 @@ class ShopOrderController
public function order_details(): string
{
$orderId = (int)\S::get('order_id');
$orderId = (int)\Shared\Helpers\Helpers::get('order_id');
$order = $this->service->details($orderId);
$coupon = null;
@@ -186,7 +186,7 @@ class ShopOrderController
public function order_edit(): string
{
$orderId = (int)\S::get('order_id');
$orderId = (int)\Shared\Helpers\Helpers::get('order_id');
return \Tpl::view('shop-order/order-edit', [
'order' => $this->service->details($orderId),
@@ -204,42 +204,42 @@ class ShopOrderController
public function order_save(): void
{
$saved = $this->service->saveOrderByAdmin([
'order_id' => (int)\S::get('order_id'),
'client_name' => (string)\S::get('client_name'),
'client_surname' => (string)\S::get('client_surname'),
'client_street' => (string)\S::get('client_street'),
'client_postal_code' => (string)\S::get('client_postal_code'),
'client_city' => (string)\S::get('client_city'),
'client_email' => (string)\S::get('client_email'),
'firm_name' => (string)\S::get('firm_name'),
'firm_street' => (string)\S::get('firm_street'),
'firm_postal_code' => (string)\S::get('firm_postal_code'),
'firm_city' => (string)\S::get('firm_city'),
'firm_nip' => (string)\S::get('firm_nip'),
'transport_id' => (int)\S::get('transport_id'),
'inpost_paczkomat' => (string)\S::get('inpost_paczkomat'),
'payment_method_id' => (int)\S::get('payment_method_id'),
'order_id' => (int)\Shared\Helpers\Helpers::get('order_id'),
'client_name' => (string)\Shared\Helpers\Helpers::get('client_name'),
'client_surname' => (string)\Shared\Helpers\Helpers::get('client_surname'),
'client_street' => (string)\Shared\Helpers\Helpers::get('client_street'),
'client_postal_code' => (string)\Shared\Helpers\Helpers::get('client_postal_code'),
'client_city' => (string)\Shared\Helpers\Helpers::get('client_city'),
'client_email' => (string)\Shared\Helpers\Helpers::get('client_email'),
'firm_name' => (string)\Shared\Helpers\Helpers::get('firm_name'),
'firm_street' => (string)\Shared\Helpers\Helpers::get('firm_street'),
'firm_postal_code' => (string)\Shared\Helpers\Helpers::get('firm_postal_code'),
'firm_city' => (string)\Shared\Helpers\Helpers::get('firm_city'),
'firm_nip' => (string)\Shared\Helpers\Helpers::get('firm_nip'),
'transport_id' => (int)\Shared\Helpers\Helpers::get('transport_id'),
'inpost_paczkomat' => (string)\Shared\Helpers\Helpers::get('inpost_paczkomat'),
'payment_method_id' => (int)\Shared\Helpers\Helpers::get('payment_method_id'),
]);
if ($saved) {
\S::alert('Zamówienie zostało zapisane.');
\Shared\Helpers\Helpers::alert('Zamówienie zostało zapisane.');
}
header('Location: /admin/shop_order/order_details/order_id=' . (int)\S::get('order_id'));
header('Location: /admin/shop_order/order_details/order_id=' . (int)\Shared\Helpers\Helpers::get('order_id'));
exit;
}
public function notes_save(): void
{
$this->service->saveNotes((int)\S::get('order_id'), (string)\S::get('notes'));
$this->service->saveNotes((int)\Shared\Helpers\Helpers::get('order_id'), (string)\Shared\Helpers\Helpers::get('notes'));
}
public function order_status_change(): void
{
$response = $this->service->changeStatus(
(int)\S::get('order_id'),
(int)\S::get('status'),
(string)\S::get('email') === 'true'
(int)\Shared\Helpers\Helpers::get('order_id'),
(int)\Shared\Helpers\Helpers::get('status'),
(string)\Shared\Helpers\Helpers::get('email') === 'true'
);
echo json_encode($response);
@@ -248,7 +248,7 @@ class ShopOrderController
public function order_resend_confirmation_email(): void
{
$response = $this->service->resendConfirmationEmail((int)\S::get('order_id'));
$response = $this->service->resendConfirmationEmail((int)\Shared\Helpers\Helpers::get('order_id'));
echo json_encode(['result' => $response]);
exit;
@@ -256,7 +256,7 @@ class ShopOrderController
public function set_order_as_unpaid(): void
{
$orderId = (int)\S::get('order_id');
$orderId = (int)\Shared\Helpers\Helpers::get('order_id');
$this->service->setOrderAsUnpaid($orderId);
header('Location: /admin/shop_order/order_details/order_id=' . $orderId);
@@ -265,8 +265,8 @@ class ShopOrderController
public function set_order_as_paid(): void
{
$orderId = (int)\S::get('order_id');
$this->service->setOrderAsPaid($orderId, (int)\S::get('send_mail') === 1);
$orderId = (int)\Shared\Helpers\Helpers::get('order_id');
$this->service->setOrderAsPaid($orderId, (int)\Shared\Helpers\Helpers::get('send_mail') === 1);
header('Location: /admin/shop_order/order_details/order_id=' . $orderId);
exit;
@@ -274,12 +274,12 @@ class ShopOrderController
public function send_order_to_apilo(): void
{
$orderId = (int)\S::get('order_id');
$orderId = (int)\Shared\Helpers\Helpers::get('order_id');
if ($this->service->sendOrderToApilo($orderId)) {
\S::alert('Zamówienie zostanie wysłane ponownie do apilo.com');
\Shared\Helpers\Helpers::alert('Zamówienie zostanie wysłane ponownie do apilo.com');
} else {
\S::alert('Wystąpił błąd podczas wysyłania zamówienia do apilo.com');
\Shared\Helpers\Helpers::alert('Wystąpił błąd podczas wysyłania zamówienia do apilo.com');
}
header('Location: /admin/shop_order/order_details/order_id=' . $orderId);
@@ -288,7 +288,7 @@ class ShopOrderController
public function toggle_trustmate_send(): void
{
echo json_encode($this->service->toggleTrustmateSend((int)\S::get('order_id')));
echo json_encode($this->service->toggleTrustmateSend((int)\Shared\Helpers\Helpers::get('order_id')));
exit;
}
@@ -299,8 +299,8 @@ class ShopOrderController
public function order_delete(): void
{
if ($this->service->deleteOrder((int)\S::get('id'))) {
\S::alert('Zamówienie zostało usunięte');
if ($this->service->deleteOrder((int)\Shared\Helpers\Helpers::get('id'))) {
\Shared\Helpers\Helpers::alert('Zamówienie zostało usunięte');
}
header('Location: /admin/shop_order/list/');