feat(120): alert component unification
Phase 120 - Plan 01:
- Reusable PHP alert component (resources/views/components/alert.php)
with inline SVG icon per type, optional dismiss button.
- Missing .alert--info SCSS variant added (#eff6ff/#bfdbfe/#1e3a8a) -
fixes black-on-white alert after Fakturownia test connection.
- Flash::push(type, message) + Flash::all() with BC for set/get;
legacy key heuristic (error/.save/warning -> typed entries).
- Central flash renderer in 3 layouts (app/auth/public) iterating
Flash::all() through component (.alerts-stack wrap).
- Vanilla JS alert-dismiss.js with idempotent guard and delegated
click handler on [data-alert-dismiss].
- 36 views migrated off inline <div class="alert alert--TYPE">;
.flash--error/success removed from views (orders/show, shipments/prepare).
- SCSS rebuilt: public/assets/css/{app,login}.css.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,11 +30,13 @@ $buyerEmailDefault = trim((string) ($buyerAddr['email'] ?? $orderRow['buyer_emai
|
||||
</div>
|
||||
|
||||
<?php if ($errorMsg !== ''): ?>
|
||||
<div class="alert alert--danger mt-12"><?= $e($errorMsg) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMsg; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($hasExistingInvoices): ?>
|
||||
<div class="alert alert--warning mt-12">
|
||||
<?php
|
||||
ob_start();
|
||||
?>
|
||||
<strong>Uwaga!</strong> Do tego zamowienia wystawiono juz <?= $e((string) count($existingInvoicesList)) ?> fakture/y:
|
||||
<ul class="mt-4">
|
||||
<?php foreach ($existingInvoicesList as $ei): ?>
|
||||
@@ -46,7 +48,10 @@ $buyerEmailDefault = trim((string) ($buyerAddr['email'] ?? $orderRow['buyer_emai
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$existingInvoicesHtml = ob_get_clean();
|
||||
?>
|
||||
<div class="mt-12"><?php $type='warning'; $messageHtml = $existingInvoicesHtml; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; unset($messageHtml); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form id="invoice-create-form" method="post" action="/orders/<?= $e((string) $orderIdVal) ?>/invoice/store" class="mt-16">
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
</header>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger login-alert" role="alert">
|
||||
<?= $e($errorMessage) ?>
|
||||
</div>
|
||||
<div class="login-alert"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="login-form" action="/login" method="post" novalidate>
|
||||
|
||||
@@ -41,7 +41,7 @@ $orderStatusOptions = is_array($orderStatusOptions ?? null) ? $orderStatusOption
|
||||
<h2 class="section-title"><?= $isEdit ? 'Edytuj zadanie automatyczne' : 'Nowe zadanie automatyczne' ?></h2>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="<?= $isEdit ? '/settings/automation/update' : '/settings/automation/store' ?>" method="post" novalidate class="mt-12" id="js-automation-form">
|
||||
|
||||
@@ -56,10 +56,10 @@ $buildHistoryUrl = static function (array $overrides = []) use ($historyFiltersD
|
||||
<p class="muted mt-8">Reguly automatyzacji wykonywane po wystapieniu zdarzenia.</p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<nav class="content-tabs-nav mt-12" aria-label="Zakladki automatyzacji">
|
||||
|
||||
36
resources/views/components/alert.php
Normal file
36
resources/views/components/alert.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Reusable alert component.
|
||||
*
|
||||
* Required scope vars:
|
||||
* - $e : escape callable from template engine
|
||||
* - $type : string (info|success|warning|danger), default 'info'
|
||||
* - $message : string, escaped via $e()
|
||||
* Optional:
|
||||
* - $messageHtml : trusted HTML payload (used INSTEAD of $message when set)
|
||||
* - $dismissible : bool, default true
|
||||
* - $role : 'alert' (default) or 'status'
|
||||
*/
|
||||
|
||||
$allowedTypes = ['info', 'success', 'warning', 'danger'];
|
||||
$alertType = isset($type) && in_array($type, $allowedTypes, true) ? $type : 'info';
|
||||
|
||||
$alertMessage = isset($message) ? (string) $message : '';
|
||||
$alertMessageRaw = isset($messageHtml) ? (string) $messageHtml : null;
|
||||
$alertDismissible = !isset($dismissible) || (bool) $dismissible;
|
||||
$alertRole = (isset($role) && $role === 'status') ? 'status' : 'alert';
|
||||
|
||||
$alertIcons = [
|
||||
'info' => '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>',
|
||||
'success' => '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>',
|
||||
'warning' => '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>',
|
||||
'danger' => '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',
|
||||
];
|
||||
?>
|
||||
<div class="alert alert--<?= $e($alertType) ?>" role="<?= $e($alertRole) ?>" data-alert>
|
||||
<span class="alert__icon" aria-hidden="true"><?= $alertIcons[$alertType] ?></span>
|
||||
<div class="alert__body"><?php if ($alertMessageRaw !== null): ?><?= $alertMessageRaw ?><?php else: ?><?= $e($alertMessage) ?><?php endif; ?></div>
|
||||
<?php if ($alertDismissible): ?>
|
||||
<button type="button" class="alert__dismiss" data-alert-dismiss aria-label="Zamknij">×</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -184,6 +184,17 @@
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
<?php $flashEntries = \App\Core\Support\Flash::all(); ?>
|
||||
<?php if (!empty($flashEntries)): ?>
|
||||
<div class="alerts-stack" data-flash-stack>
|
||||
<?php foreach ($flashEntries as $flashEntry): ?>
|
||||
<?php $type = (string) ($flashEntry['type'] ?? 'info'); ?>
|
||||
<?php $message = (string) ($flashEntry['message'] ?? ''); ?>
|
||||
<?php $dismissible = true; ?>
|
||||
<?php include __DIR__ . '/../components/alert.php'; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?= $content ?>
|
||||
</main>
|
||||
</div>
|
||||
@@ -194,6 +205,7 @@
|
||||
<script src="/assets/js/modules/invoice-config-form.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/invoice-config-form.js') ?: 0 ?>"></script>
|
||||
<script src="/assets/js/modules/invoice-requested-toggle.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/invoice-requested-toggle.js') ?: 0 ?>"></script>
|
||||
<script src="/assets/js/modules/confirm-delete.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/confirm-delete.js') ?: 0 ?>"></script>
|
||||
<script src="/assets/js/modules/alert-dismiss.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/alert-dismiss.js') ?: 0 ?>"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
|
||||
<script src="/assets/js/modules/statistics-summary-charts.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/statistics-summary-charts.js') ?: 0 ?>"></script>
|
||||
<script>
|
||||
|
||||
@@ -14,7 +14,19 @@
|
||||
<div class="bg-orb bg-orb-right" aria-hidden="true"></div>
|
||||
|
||||
<main class="login-page">
|
||||
<?php $flashEntries = \App\Core\Support\Flash::all(); ?>
|
||||
<?php if (!empty($flashEntries)): ?>
|
||||
<div class="alerts-stack" data-flash-stack>
|
||||
<?php foreach ($flashEntries as $flashEntry): ?>
|
||||
<?php $type = (string) ($flashEntry['type'] ?? 'info'); ?>
|
||||
<?php $message = (string) ($flashEntry['message'] ?? ''); ?>
|
||||
<?php $dismissible = true; ?>
|
||||
<?php include __DIR__ . '/../components/alert.php'; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?= $content ?>
|
||||
</main>
|
||||
<script src="/assets/js/modules/alert-dismiss.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/alert-dismiss.js') ?: 0 ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -28,7 +28,19 @@
|
||||
</head>
|
||||
<body>
|
||||
<main class="public-page">
|
||||
<?php $flashEntries = \App\Core\Support\Flash::all(); ?>
|
||||
<?php if (!empty($flashEntries)): ?>
|
||||
<div class="alerts-stack" data-flash-stack>
|
||||
<?php foreach ($flashEntries as $flashEntry): ?>
|
||||
<?php $type = (string) ($flashEntry['type'] ?? 'info'); ?>
|
||||
<?php $message = (string) ($flashEntry['message'] ?? ''); ?>
|
||||
<?php $dismissible = true; ?>
|
||||
<?php include __DIR__ . '/../components/alert.php'; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?= $content ?>
|
||||
</main>
|
||||
<script src="/assets/js/modules/alert-dismiss.js?ver=<?= filemtime(dirname(__DIR__, 3) . '/public/assets/js/modules/alert-dismiss.js') ?: 0 ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -13,9 +13,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--warning mt-12" role="alert">
|
||||
<?= $e((string) $errorMessage) ?>
|
||||
</div>
|
||||
<div class="mt-12"><?php $type='warning'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -22,7 +22,9 @@ $hasExistingReceipts = $existingReceiptsList !== [];
|
||||
</div>
|
||||
|
||||
<?php if ($hasExistingReceipts): ?>
|
||||
<div class="alert alert--warning mt-12">
|
||||
<?php
|
||||
ob_start();
|
||||
?>
|
||||
<strong>Uwaga!</strong> Do tego zamówienia wystawiono już <?= $e((string) count($existingReceiptsList)) ?> paragon(ów):
|
||||
<ul class="mt-4">
|
||||
<?php foreach ($existingReceiptsList as $er): ?>
|
||||
@@ -35,7 +37,10 @@ $hasExistingReceipts = $existingReceiptsList !== [];
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
$existingReceiptsHtml = ob_get_clean();
|
||||
?>
|
||||
<div class="mt-12"><?php $type='warning'; $messageHtml = $existingReceiptsHtml; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; unset($messageHtml); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form id="receipt-create-form" method="post" action="/orders/<?= $e((string) $orderIdVal) ?>/receipt/store" class="mt-16">
|
||||
|
||||
@@ -134,10 +134,10 @@ foreach ($addressesList as $address) {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($flashSuccessMsg !== ''): ?>
|
||||
<div class="flash flash--success mt-12"><?= $e($flashSuccessMsg) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $flashSuccessMsg; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($flashErrorMsg !== ''): ?>
|
||||
<div class="flash flash--error mt-12"><?= $e($flashErrorMsg) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $flashErrorMsg; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="order-status-change mt-12">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/** @var array<string, mixed>|null $config */
|
||||
$config = is_array($config ?? null) ? $config : null;
|
||||
$accounts = is_array($fakturowniaAccounts ?? null) ? $fakturowniaAccounts : [];
|
||||
$fakturowniaSettings = is_array($fakturowniaSettings ?? null) ? $fakturowniaSettings : [];
|
||||
$isEdit = $config !== null;
|
||||
$cid = (int) ($config['id'] ?? 0);
|
||||
|
||||
@@ -13,8 +13,10 @@ $orderReference = (string) ($config['order_reference'] ?? 'none');
|
||||
$paymentToDays = (int) ($config['payment_to_days'] ?? 7);
|
||||
$defaultKind = (string) ($config['default_kind'] ?? 'vat');
|
||||
$isDelegated = ((int) ($config['is_delegated'] ?? 0)) === 1;
|
||||
$integrationId = (int) ($config['integration_id'] ?? 0);
|
||||
$isActive = $isEdit ? ((int) ($config['is_active'] ?? 0)) === 1 : true;
|
||||
$fakturowniaConfigured = trim((string) ($fakturowniaSettings['account_prefix'] ?? '')) !== ''
|
||||
&& !empty($fakturowniaSettings['has_api_token']);
|
||||
$fakturowniaActive = !empty($fakturowniaSettings['is_active']);
|
||||
|
||||
$success = trim((string) ($successMessage ?? ''));
|
||||
$error = trim((string) ($errorMessage ?? ''));
|
||||
@@ -25,10 +27,10 @@ $error = trim((string) ($errorMessage ?? ''));
|
||||
<h2 class="section-title"><?= $isEdit ? 'Edycja konfiguracji faktury' : 'Nowa konfiguracja faktury' ?></h2>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($error) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $error; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($success !== ''): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e($success) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $success; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
@@ -105,24 +107,15 @@ $error = trim((string) ($errorMessage ?? ''));
|
||||
</div>
|
||||
|
||||
<div class="form-field mt-12" data-invoice-delegation<?= $isDelegated ? '' : ' style="display:none"' ?>>
|
||||
<label class="form-field">
|
||||
<span class="field-label">Konto Fakturowni *</span>
|
||||
<select class="form-control" name="integration_id"<?= $isDelegated ? ' required' : '' ?>>
|
||||
<option value="">— wybierz konto —</option>
|
||||
<?php foreach ($accounts as $acc):
|
||||
$aid = (int) ($acc['integration_id'] ?? 0);
|
||||
$accName = (string) ($acc['name'] ?? '');
|
||||
$accPrefix = (string) ($acc['account_prefix'] ?? '');
|
||||
?>
|
||||
<option value="<?= $aid ?>"<?= $aid === $integrationId ? ' selected' : '' ?>>
|
||||
<?= $e($accName) ?><?= $accPrefix !== '' ? ' (' . $e($accPrefix) . '.fakturownia.pl)' : '' ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php if ($accounts === []): ?>
|
||||
<small class="field-hint">Brak skonfigurowanych kont Fakturowni. <a href="/settings/integrations/fakturownia/new">Dodaj konto</a> aby moc delegowac.</small>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<span class="field-label">Konto Fakturowni</span>
|
||||
<?php if ($fakturowniaConfigured && $fakturowniaActive): ?>
|
||||
<span class="badge badge--success">Globalna konfiguracja aktywna</span>
|
||||
<?php elseif ($fakturowniaConfigured): ?>
|
||||
<span class="badge badge--muted">Globalna konfiguracja nieaktywna</span>
|
||||
<?php else: ?>
|
||||
<span class="badge badge--muted">Brak konfiguracji</span>
|
||||
<?php endif; ?>
|
||||
<small class="field-hint">Delegowane faktury uzywaja jednej globalnej konfiguracji z <a href="/settings/integrations/fakturownia">Integracje > Fakturownia</a>.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-actions mt-16">
|
||||
|
||||
@@ -11,10 +11,10 @@ $error = trim((string) ($errorMessage ?? ''));
|
||||
<p class="muted mt-12">Zarzadzaj konfiguracjami wystawiania faktur. Mozesz dodac wiele konfiguracji (np. dla roznych dzialalnosci) i opcjonalnie delegowac wystawianie do Fakturowni.</p>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($error) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $error; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($success !== ''): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e($success) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $success; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ $error = trim((string) ($errorMessage ?? ''));
|
||||
<h2 class="section-title"><?= $isEdit ? 'Edycja konfiguracji paragonu' : 'Nowa konfiguracja paragonu' ?></h2>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($error) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $error; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($success !== ''): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e($success) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $success; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ $error = trim((string) ($errorMessage ?? ''));
|
||||
<p class="muted mt-12">Zarzadzaj konfiguracjami wystawiania paragonow.</p>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($error) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $error; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($success !== ''): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e($success) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $success; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ $error = trim((string) ($errorMessage ?? ''));
|
||||
<p class="muted mt-12">Wybierz typ dokumentu ktorego konfiguracje chcesz zarzadzac.</p>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($error) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $error; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($success !== ''): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e($success) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $success; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -40,15 +40,15 @@ foreach ($pullStatusMappings as $pm) {
|
||||
<p class="muted mt-12"><?= $e($t('settings.allegro.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($warningMessage)): ?>
|
||||
<div class="alert alert--warning mt-12" role="alert"><?= $e((string) $warningMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='warning'; $message=(string) $warningMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
@@ -359,7 +359,7 @@ foreach ($pullStatusMappings as $pm) {
|
||||
<p class="muted mt-12"><?= $e($t('settings.allegro.delivery.description')) ?></p>
|
||||
|
||||
<?php if ($dmServicesError !== ''): ?>
|
||||
<div class="alert alert--danger mt-12"><?= $e($dmServicesError) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $dmServicesError; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($dmOrderMethods === []): ?>
|
||||
|
||||
@@ -11,11 +11,11 @@ $updatedAt = trim((string) ($integration['updated_at'] ?? ''));
|
||||
<p class="muted mt-12"><?= $e($t('settings.apaczka.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ $s = is_array($settings ?? null) ? $settings : [];
|
||||
<p class="muted mt-12"><?= $e($t('settings.company.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ $pastTotal = max(0, (int) ($pastPagination['total'] ?? 0));
|
||||
<h2 class="section-title"><?= $e($t('settings.cron.title')) ?></h2>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<nav class="content-tabs-nav mt-12" aria-label="Zakładki crona">
|
||||
|
||||
@@ -11,15 +11,11 @@ $logs = (array) ($runLogs ?? []);
|
||||
<h2 class="section-title"><?= $e($t('settings.database.title')) ?></h2>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert">
|
||||
<?= $e((string) $errorMessage) ?>
|
||||
</div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status">
|
||||
<?= $e((string) $successMessage) ?>
|
||||
</div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="settings-grid mt-16">
|
||||
@@ -38,18 +34,14 @@ $logs = (array) ($runLogs ?? []);
|
||||
</div>
|
||||
|
||||
<?php if ($pending > 0): ?>
|
||||
<div class="alert alert--warning mt-16" role="status">
|
||||
<?= $e($t('settings.database.state.needs_update')) ?>
|
||||
</div>
|
||||
<div class="mt-16"><?php $type='warning'; $message=(string) $t('settings.database.state.needs_update'); $dismissible=false; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
|
||||
<form class="mt-16" action="/settings/database/migrate" method="post">
|
||||
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
||||
<button type="submit" class="btn btn--primary"><?= $e($t('settings.database.actions.run_update')) ?></button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<div class="alert alert--success mt-16" role="status">
|
||||
<?= $e($t('settings.database.state.up_to_date')) ?>
|
||||
</div>
|
||||
<div class="mt-16"><?php $type='success'; $message=(string) $t('settings.database.state.up_to_date'); $dismissible=false; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ $action = $isEdit
|
||||
<h2 class="section-title"><?= $isEdit ? 'Edytuj status przesyłki' : 'Nowy status przesyłki' ?></h2>
|
||||
|
||||
<?php if ($errorMessage !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="<?= $e($action) ?>" method="post" novalidate class="mt-12">
|
||||
|
||||
@@ -9,10 +9,10 @@ $csrfToken = (string) ($csrfToken ?? '');
|
||||
<section class="card">
|
||||
<h2 class="section-title">Statusy przesyłek</h2>
|
||||
<?php if ($errorMessage !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($successMessage !== ''): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e($successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ $isEdit = $em !== null;
|
||||
<p class="muted mt-12">Konfiguracja skrzynek SMTP do wysylki wiadomosci e-mail.</p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ $attachmentTypes = is_array($attachmentTypes ?? null) ? $attachmentTypes : [];
|
||||
<p class="muted mt-12">Skonfiguruj temat, tresc i zmienne, ktore beda podstawiane podczas wysylki.</p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ $attachmentTypes = is_array($attachmentTypes ?? null) ? $attachmentTypes : [];
|
||||
<p class="muted mt-12">Szablony wiadomosci e-mail z edytorem i systemem zmiennych.</p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -1,103 +1,115 @@
|
||||
<?php
|
||||
/** @var array<int, array<string, mixed>> $rows */
|
||||
$rows = is_array($rows ?? null) ? $rows : [];
|
||||
/** @var array<string, mixed> $settings */
|
||||
$settings = is_array($settings ?? null) ? $settings : [];
|
||||
$integrationId = (int) ($settings['integration_id'] ?? 0);
|
||||
$prefix = (string) ($settings['account_prefix'] ?? '');
|
||||
$departmentId = (string) ($settings['department_id'] ?? '');
|
||||
$defaultKind = (string) ($settings['default_kind'] ?? 'vat');
|
||||
$defaultPaymentDays = (int) ($settings['default_payment_to_days'] ?? 7);
|
||||
$isActive = (bool) ($settings['is_active'] ?? true);
|
||||
$hasToken = (bool) ($settings['has_api_token'] ?? false);
|
||||
$lastTestAt = (string) ($settings['last_test_at'] ?? '');
|
||||
$lastTestStatus = (string) ($settings['last_test_status'] ?? '');
|
||||
$lastTestMessage = (string) ($settings['last_test_message'] ?? '');
|
||||
|
||||
$flashSave = trim((string) ($flashSave ?? ''));
|
||||
$flashTest = trim((string) ($flashTest ?? ''));
|
||||
$flashError = trim((string) ($flashError ?? ''));
|
||||
?>
|
||||
|
||||
<section class="card">
|
||||
<h2 class="section-title">Integracje Fakturownia</h2>
|
||||
<p class="muted mt-12">Konfiguracja kont Fakturowni do wystawiania faktur dla zamowien.</p>
|
||||
<h2 class="section-title">Integracja Fakturownia</h2>
|
||||
<p class="muted mt-12">Jedna globalna konfiguracja konta Fakturowni do wystawiania faktur delegowanych.</p>
|
||||
|
||||
<?php if ($flashError !== ''): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e($flashError) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=$flashError; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($flashSave !== ''): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e($flashSave) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=$flashSave; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($flashTest !== ''): ?>
|
||||
<div class="alert alert--info mt-12" role="status"><?= $e($flashTest) ?></div>
|
||||
<div class="mt-12"><?php $type='info'; $message=$flashTest; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="card mt-16">
|
||||
<h3 class="section-title">Lista integracji</h3>
|
||||
|
||||
<div class="form-actions mt-12">
|
||||
<a class="btn btn--primary" href="/settings/integrations/fakturownia/new">Dodaj integracje</a>
|
||||
<h3 class="section-title">Konfiguracja</h3>
|
||||
<div class="muted mt-12">
|
||||
Token:
|
||||
<strong><?= $e($hasToken ? 'zapisany' : 'brak') ?></strong>
|
||||
Status:
|
||||
<strong><?= $e($isActive ? 'aktywna' : 'nieaktywna') ?></strong>
|
||||
</div>
|
||||
|
||||
<?php if ($rows === []): ?>
|
||||
<p class="muted mt-12">Brak skonfigurowanych integracji Fakturowni. Dodaj pierwsza ponizej.</p>
|
||||
<?php else: ?>
|
||||
<div class="table-wrap mt-12">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nazwa</th>
|
||||
<th>Subdomena</th>
|
||||
<th>Token</th>
|
||||
<th>Status</th>
|
||||
<th>Ostatni test</th>
|
||||
<th>Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($rows as $row):
|
||||
$integrationId = (int) ($row['integration_id'] ?? 0);
|
||||
$name = (string) ($row['name'] ?? '');
|
||||
$prefix = (string) ($row['account_prefix'] ?? '');
|
||||
$hasToken = (bool) ($row['has_api_token'] ?? false);
|
||||
$isActive = (bool) ($row['is_active'] ?? false);
|
||||
$lastTestAt = (string) ($row['last_test_at'] ?? '');
|
||||
$lastTestStatus = (string) ($row['last_test_status'] ?? '');
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $e($name) ?></td>
|
||||
<td>
|
||||
<?php if ($prefix !== ''): ?>
|
||||
<?= $e($prefix . '.fakturownia.pl') ?>
|
||||
<?php else: ?>
|
||||
<span class="muted">brak</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($hasToken): ?>
|
||||
<span class="badge badge--success">Zapisany</span>
|
||||
<?php else: ?>
|
||||
<span class="badge badge--muted">Brak</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($isActive): ?>
|
||||
<span class="badge badge--success">Aktywna</span>
|
||||
<?php else: ?>
|
||||
<span class="badge badge--muted">Nieaktywna</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($lastTestAt !== ''): ?>
|
||||
<?= $e($lastTestAt) ?>
|
||||
<?php if ($lastTestStatus !== ''): ?>
|
||||
<span class="badge badge--<?= $lastTestStatus === 'ok' ? 'success' : 'muted' ?>"><?= $e(strtoupper($lastTestStatus)) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<span class="muted">nigdy</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td style="white-space:nowrap">
|
||||
<a href="/settings/integrations/fakturownia/edit?id=<?= $integrationId ?>" class="btn btn--sm btn--secondary">Edytuj</a>
|
||||
<form action="/settings/integrations/fakturownia/delete" method="post" style="display:inline" class="js-confirm-delete">
|
||||
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
||||
<input type="hidden" name="id" value="<?= $integrationId ?>">
|
||||
<button type="button" class="btn btn--sm btn--danger js-delete-btn">Usun</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<form class="statuses-form mt-16" action="/settings/integrations/fakturownia/save" method="post" novalidate>
|
||||
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
||||
|
||||
<label class="form-field">
|
||||
<span class="field-label">Prefix konta (subdomena) *</span>
|
||||
<input class="form-control" type="text" name="account_prefix" maxlength="63" value="<?= $e($prefix) ?>" pattern="[a-z0-9][a-z0-9-]{1,62}" required>
|
||||
<span class="muted">Wpisz sama subdomene, bez koncowki .fakturownia.pl.</span>
|
||||
</label>
|
||||
|
||||
<label class="form-field">
|
||||
<span class="field-label">Token API <?= $hasToken ? '' : '*' ?></span>
|
||||
<input class="form-control" type="password" name="api_token" autocomplete="new-password" placeholder="<?= $hasToken ? '********' : '' ?>" <?= $hasToken ? '' : 'required' ?>>
|
||||
<span class="muted"><?= $hasToken ? 'Token jest zapisany. Wpisz nowy, aby go nadpisac.' : 'Token API z Fakturowni (Ustawienia > Konta uzytkownikow > API).' ?></span>
|
||||
</label>
|
||||
|
||||
<label class="form-field">
|
||||
<span class="field-label">ID departamentu (opcjonalnie)</span>
|
||||
<input class="form-control" type="text" name="department_id" maxlength="64" value="<?= $e($departmentId) ?>">
|
||||
</label>
|
||||
|
||||
<div class="form-grid-2 mt-0">
|
||||
<label class="form-field">
|
||||
<span class="field-label">Domyslny typ dokumentu</span>
|
||||
<select class="form-control" name="default_kind">
|
||||
<option value="vat" <?= $defaultKind === 'vat' ? 'selected' : '' ?>>Faktura VAT</option>
|
||||
<option value="proforma" <?= $defaultKind === 'proforma' ? 'selected' : '' ?>>Proforma</option>
|
||||
<option value="invoice_other" <?= $defaultKind === 'invoice_other' ? 'selected' : '' ?>>Inna</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label class="form-field">
|
||||
<span class="field-label">Domyslny termin platnosci (dni)</span>
|
||||
<input class="form-control" type="number" name="default_payment_to_days" min="0" max="120" value="<?= $defaultPaymentDays ?>">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label class="form-field">
|
||||
<span class="field-label">Status</span>
|
||||
<label>
|
||||
<input type="checkbox" name="is_active" value="1" <?= $isActive ? 'checked' : '' ?>>
|
||||
Integracja aktywna
|
||||
</label>
|
||||
</label>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn--primary">Zapisz</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card mt-16">
|
||||
<h3 class="section-title">Test polaczenia</h3>
|
||||
<p class="muted mt-12">Wykonuje GET <code><?= $e('https://' . ($prefix !== '' ? $prefix : '{prefix}') . '.fakturownia.pl/account.json') ?></code> z zapisanym tokenem.</p>
|
||||
|
||||
<form action="/settings/integrations/fakturownia/test" method="post" class="mt-12">
|
||||
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
||||
<input type="hidden" name="id" value="<?= $integrationId ?>">
|
||||
<button type="submit" class="btn btn--secondary">Testuj polaczenie</button>
|
||||
</form>
|
||||
|
||||
<?php if ($lastTestAt !== ''): ?>
|
||||
<div class="muted mt-12">
|
||||
Ostatni test: <strong><?= $e($lastTestAt) ?></strong>
|
||||
<?php if ($lastTestStatus !== ''): ?>
|
||||
<span class="badge badge--<?= $lastTestStatus === 'ok' ? 'success' : 'muted' ?>"><?= $e(strtoupper($lastTestStatus)) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($lastTestMessage !== ''): ?>
|
||||
<div><?= $e($lastTestMessage) ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
@@ -20,15 +20,15 @@ if (str_starts_with($lastTestMessage, 'MessageId:')) {
|
||||
<p class="muted mt-12"><?= $e($t('settings.hostedsms.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($testMessage)): ?>
|
||||
<div class="alert alert--info mt-12" role="status"><?= $e((string) $testMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='info'; $message=(string) $testMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ $labelFormat = (string) ($s['label_format'] ?? 'Pdf');
|
||||
<p class="muted mt-12"><?= $e($t('settings.inpost.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ $items = is_array($rows ?? null) ? $rows : [];
|
||||
<p class="muted mt-12"><?= $e($t('settings.integrations_hub.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -10,19 +10,24 @@ $currentStatusFilter = (string) ($printStatusFilter ?? '');
|
||||
<p class="muted mt-12">Klucze API do uwierzytelniania aplikacji drukujacej (Windows Client).</p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($newKey !== ''): ?>
|
||||
<div class="alert alert--warning mt-12">
|
||||
<?php
|
||||
ob_start();
|
||||
?>
|
||||
<strong>Nowy klucz API:</strong>
|
||||
<code id="new-api-key" style="display:inline-block;padding:4px 8px;background:#f5f5f5;border:1px solid #ddd;border-radius:3px;font-size:13px;word-break:break-all;user-select:all"><?= $e($newKey) ?></code>
|
||||
<button type="button" class="btn btn--secondary btn--sm ml-8" onclick="navigator.clipboard.writeText(document.getElementById('new-api-key').textContent)">Kopiuj</button>
|
||||
<br><small class="muted">Ten klucz nie bedzie ponownie wyswietlony. Skopiuj go teraz.</small>
|
||||
</div>
|
||||
<?php
|
||||
$newKeyAlertHtml = ob_get_clean();
|
||||
?>
|
||||
<div class="mt-12"><?php $type='warning'; $messageHtml=$newKeyAlertHtml; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; unset($messageHtml); ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ $scripts = is_array($scripts ?? null) ? $scripts : [];
|
||||
<p class="muted mt-4"><?= $e($t('settings.project_mapping.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ foreach ($dmMappings as $dm) {
|
||||
<p class="muted mt-12"><?= $e($t('settings.integrations.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
@@ -452,7 +452,7 @@ foreach ($dmMappings as $dm) {
|
||||
<p class="muted mt-12"><?= $e($t('settings.integrations.delivery.select_integration_first')) ?></p>
|
||||
<?php else: ?>
|
||||
<?php if ($dmServicesError !== ''): ?>
|
||||
<div class="alert alert--danger mt-12"><?= $e($dmServicesError) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $dmServicesError; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($dmOrderMethods === []): ?>
|
||||
|
||||
@@ -23,15 +23,15 @@ if (str_starts_with($lastTestMessage, 'messageId:')) {
|
||||
<p class="muted mt-12"><?= $e($t('settings.smsplanet.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($testMessage)): ?>
|
||||
<div class="alert alert--info mt-12" role="status"><?= $e((string) $testMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='info'; $message=(string) $testMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ foreach ($statusesList as $statusRow) {
|
||||
<p class="muted mt-12"><?= $e($t('settings.statuses.description')) ?></p>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status"><?= $e((string) $successMessage) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
@@ -76,7 +76,7 @@ foreach ($statusesList as $statusRow) {
|
||||
|
||||
<h2 class="section-title mt-16"><?= $e($t('settings.statuses.statuses.list_title')) ?></h2>
|
||||
<?php if ($groupsList === []): ?>
|
||||
<div class="alert alert--warning mt-12"><?= $e($t('settings.statuses.groups.empty')) ?></div>
|
||||
<div class="mt-12"><?php $type='warning'; $message=(string) $t('settings.statuses.groups.empty'); $dismissible=false; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($groupsList as $group): ?>
|
||||
|
||||
@@ -54,10 +54,10 @@ $defaultCodAmount = $isCod ? number_format($totalWithTax, 2, '.', '') : '0';
|
||||
</div>
|
||||
|
||||
<?php if ($flashSuccessMsg !== ''): ?>
|
||||
<div class="flash flash--success mt-12"><?= $e($flashSuccessMsg) ?></div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $flashSuccessMsg; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($flashErrorMsg !== ''): ?>
|
||||
<div class="flash flash--error mt-12"><?= $e($flashErrorMsg) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $flashErrorMsg; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
@@ -91,7 +91,7 @@ $defaultCodAmount = $isCod ? number_format($totalWithTax, 2, '.', '') : '0';
|
||||
<h3 class="section-title">Przesylka</h3>
|
||||
|
||||
<?php if ($servicesError !== ''): ?>
|
||||
<div class="flash flash--error mt-12"><?= $e($servicesError) ?></div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $servicesError; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="form-field mt-12">
|
||||
@@ -106,7 +106,7 @@ $defaultCodAmount = $isCod ? number_format($totalWithTax, 2, '.', '') : '0';
|
||||
<div class="muted mt-4" style="font-size:12px">Metoda z zamowienia: <strong><?= $e($deliveryMethodName) ?></strong><?php if ($mappedServiceName !== ''): ?> → <?= $e($mappedCarrier === 'inpost' ? 'InPost' : ($mappedCarrier === 'apaczka' ? 'Apaczka' : 'Allegro')) ?>: <?= $e($mappedServiceName) ?><?php endif; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($deliveryMappingDiagnostic !== ''): ?>
|
||||
<div class="flash flash--error mt-8"><?= $e($deliveryMappingDiagnostic) ?></div>
|
||||
<div class="mt-8"><?php $type='danger'; $message=(string) $deliveryMappingDiagnostic; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -116,7 +116,7 @@ $defaultCodAmount = $isCod ? number_format($totalWithTax, 2, '.', '') : '0';
|
||||
|
||||
<div id="shipment-allegro-panel" style="<?= $preselectedCarrier !== 'allegro' ? 'display:none' : '' ?>">
|
||||
<?php if ($servicesError !== ''): ?>
|
||||
<div class="flash flash--error mt-4"><?= $e($servicesError) ?></div>
|
||||
<div class="mt-4"><?php $type='danger'; $message=(string) $servicesError; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="searchable-select" id="shipment-service-wrapper" data-match-id="<?= $e($deliveryMethodId) ?>">
|
||||
<input type="text" class="form-control" id="shipment-service-search" placeholder="Szukaj uslugi dostawy Allegro..." autocomplete="off">
|
||||
|
||||
@@ -109,13 +109,18 @@ foreach ($channelOptions as $channelOption) {
|
||||
|
||||
<section class="card mt-16 statistics-orders-table-wrap">
|
||||
<?php if ($debugEnabled): ?>
|
||||
<div class="alert alert--warning" role="alert">
|
||||
<?php
|
||||
ob_start();
|
||||
?>
|
||||
<strong>DEBUG</strong>
|
||||
<pre style="margin:8px 0 0;white-space:pre-wrap;"><?= $e(json_encode([
|
||||
'filters' => $debugMeta,
|
||||
'diagnostics' => $diagnostics,
|
||||
], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)) ?></pre>
|
||||
</div>
|
||||
<?php
|
||||
$statisticsDebugHtml = ob_get_clean();
|
||||
?>
|
||||
<?php $type='warning'; $messageHtml=$statisticsDebugHtml; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; unset($messageHtml); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$hasData): ?>
|
||||
|
||||
@@ -7,15 +7,11 @@
|
||||
<h2 class="section-title"><?= $e($t('users.create_title')) ?></h2>
|
||||
|
||||
<?php if (!empty($errorMessage)): ?>
|
||||
<div class="alert alert--danger mt-12" role="alert">
|
||||
<?= $e($errorMessage) ?>
|
||||
</div>
|
||||
<div class="mt-12"><?php $type='danger'; $message=(string) $errorMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($successMessage)): ?>
|
||||
<div class="alert alert--success mt-12" role="status">
|
||||
<?= $e($successMessage) ?>
|
||||
</div>
|
||||
<div class="mt-12"><?php $type='success'; $message=(string) $successMessage; $dismissible=true; include dirname(__DIR__) . '/components/alert.php'; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="users-form mt-16" action="/settings/users" method="post" novalidate>
|
||||
|
||||
Reference in New Issue
Block a user