'
+ buildIntegrationCheckboxes(namePrefix)
@@ -107,6 +122,10 @@
if (select.value === 'integration') {
configDiv.innerHTML = buildIntegrationCheckboxes(namePrefix);
+ return;
+ }
+ if (select.value === 'shipment_status') {
+ configDiv.innerHTML = buildShipmentStatusCheckboxes(namePrefix);
}
}
diff --git a/resources/scss/modules/_printing.scss b/resources/scss/modules/_printing.scss
index e150ed8..868e802 100644
--- a/resources/scss/modules/_printing.scss
+++ b/resources/scss/modules/_printing.scss
@@ -34,6 +34,16 @@
}
}
+.print-queue-actions {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+}
+
+.print-queue-delete-form {
+ margin: 0;
+}
+
.btn--outline-primary {
background: transparent;
border: 1px solid var(--c-action-primary);
diff --git a/resources/views/automation/form.php b/resources/views/automation/form.php
index e45bed6..55e37ce 100644
--- a/resources/views/automation/form.php
+++ b/resources/views/automation/form.php
@@ -8,6 +8,7 @@ $actions = $isEdit ? (is_array($rule['actions'] ?? null) ? $rule['actions'] : []
$eventLabels = [
'receipt.created' => 'Utworzono paragon',
+ 'shipment.status_changed' => 'Zmiana statusu przesylki',
];
$recipientLabels = [
@@ -15,6 +16,7 @@ $recipientLabels = [
'client_and_company' => 'Klient + e-mail z danych firmy',
'company' => 'E-mail z danych firmy',
];
+$shipmentStatusOptions = is_array($shipmentStatusOptions ?? null) ? $shipmentStatusOptions : [];
?>
@@ -62,20 +64,35 @@ $recipientLabels = [
@@ -133,7 +150,8 @@ window.AutomationFormData = {
emailTemplates: = json_encode(array_map(function($t) {
return ['id' => (int) $t['id'], 'name' => (string) ($t['name'] ?? '')];
}, $emailTemplates), JSON_UNESCAPED_UNICODE) ?>,
- recipientLabels: = json_encode($recipientLabels, JSON_UNESCAPED_UNICODE) ?>
+ recipientLabels: = json_encode($recipientLabels, JSON_UNESCAPED_UNICODE) ?>,
+ shipmentStatusOptions: = json_encode($shipmentStatusOptions, JSON_UNESCAPED_UNICODE) ?>
};
diff --git a/resources/views/automation/index.php b/resources/views/automation/index.php
index 03cde15..af3d39c 100644
--- a/resources/views/automation/index.php
+++ b/resources/views/automation/index.php
@@ -3,6 +3,7 @@ $rules = is_array($rules ?? null) ? $rules : [];
$eventLabels = [
'receipt.created' => 'Utworzono paragon',
+ 'shipment.status_changed' => 'Zmiana statusu przesylki',
];
?>
diff --git a/resources/views/orders/list.php b/resources/views/orders/list.php
index c7bf820..85091cc 100644
--- a/resources/views/orders/list.php
+++ b/resources/views/orders/list.php
@@ -50,54 +50,7 @@
popup.style.left = left + 'px';
popup.style.top = top + 'px';
}, true);
-
- // Bulk print labels
- var bulkPrintBtn = document.querySelector('.js-bulk-print-labels');
- if (bulkPrintBtn) {
- bulkPrintBtn.addEventListener('click', function () {
- var checked = document.querySelectorAll('.js-table-select-item:checked');
- if (checked.length === 0) {
- if (window.OrderProAlerts) {
- window.OrderProAlerts.show({ message: 'Zaznacz co najmniej jedno zamowienie.', type: 'warning' });
- }
- return;
- }
-
- var orderIds = [];
- checked.forEach(function (cb) { orderIds.push(cb.value); });
- var csrf = bulkPrintBtn.getAttribute('data-csrf') || '';
-
- bulkPrintBtn.disabled = true;
- bulkPrintBtn.textContent = 'Wysylam...';
-
- fetch('/api/print/jobs/bulk', {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ order_ids: orderIds, _token: csrf })
- })
- .then(function (r) { return r.json(); })
- .then(function (data) {
- var created = (data.created || []).length;
- var skipped = (data.skipped || []).length;
- var msg = 'Wyslano ' + created + ' zlecen do drukarki.';
- if (skipped > 0) {
- msg += ' Pominieto ' + skipped + ' (brak etykiety lub juz w kolejce).';
- }
- if (window.OrderProAlerts) {
- window.OrderProAlerts.show({ message: msg, type: 'success' });
- }
- bulkPrintBtn.disabled = false;
- bulkPrintBtn.textContent = 'Drukuj etykiety';
- })
- .catch(function () {
- if (window.OrderProAlerts) {
- window.OrderProAlerts.show({ message: 'Blad sieci — sprobuj ponownie.', type: 'error' });
- }
- bulkPrintBtn.disabled = false;
- bulkPrintBtn.textContent = 'Drukuj etykiety';
- });
- });
- }
})();
+
diff --git a/resources/views/orders/show.php b/resources/views/orders/show.php
index cdd1ded..fd68d07 100644
--- a/resources/views/orders/show.php
+++ b/resources/views/orders/show.php
@@ -354,6 +354,25 @@ foreach ($addressesList as $address) {
if ($eventTypeLabel === $eventTypeKey) {
$eventTypeLabel = $eventType;
}
+ $activitySummary = (string) ($activity['summary'] ?? '');
+ if ($eventType === 'import') {
+ $importDetailsRaw = (string) ($activity['details_json'] ?? '');
+ $importDetails = json_decode($importDetailsRaw, true);
+ if (is_array($importDetails)) {
+ $meta = [];
+ $triggerLabel = trim((string) ($importDetails['trigger_label'] ?? ''));
+ $sourceUpdatedAt = trim((string) ($importDetails['source_updated_at'] ?? ''));
+ if ($triggerLabel !== '') {
+ $meta[] = $triggerLabel;
+ }
+ if ($sourceUpdatedAt !== '') {
+ $meta[] = 'source_updated_at: ' . $sourceUpdatedAt;
+ }
+ if ($meta !== []) {
+ $activitySummary .= ' [' . implode('; ', $meta) . ']';
+ }
+ }
+ }
$actorType = (string) ($activity['actor_type'] ?? 'system');
$actorName = trim((string) ($activity['actor_name'] ?? ''));
if ($actorName !== '') {
@@ -369,7 +388,7 @@ foreach ($addressesList as $address) {
| = $e((string) ($activity['created_at'] ?? '')) ?> |
= $e($eventTypeLabel) ?> |
- = $e((string) ($activity['summary'] ?? '')) ?> |
+ = $e($activitySummary) ?> |
= $e($actorLabel) ?> |
diff --git a/resources/views/settings/printing.php b/resources/views/settings/printing.php
index a82a1ba..71bd653 100644
--- a/resources/views/settings/printing.php
+++ b/resources/views/settings/printing.php
@@ -144,12 +144,23 @@ $currentStatusFilter = (string) ($printStatusFilter ?? '');
= $e($badgeLabel) ?> |
= $e($jobCompletedAt !== '' ? $jobCompletedAt : '-') ?> |
- 0): ?>
-
-
+
+ 0): ?>
+
+
+
+
|
@@ -161,6 +172,20 @@ $currentStatusFilter = (string) ($printStatusFilter ?? '');