This commit is contained in:
2026-04-08 19:08:40 +02:00
parent 40644eb362
commit 0f7742f10d
25 changed files with 750 additions and 77 deletions

View File

@@ -429,6 +429,7 @@ foreach ($addressesList as $address) {
<th>Przewoznik</th>
<th>Etykieta</th>
<th>Utworzono</th>
<th></th>
</tr>
</thead>
<tbody>
@@ -516,6 +517,12 @@ foreach ($addressesList as $address) {
<?php endif; ?>
</td>
<td class="text-nowrap"><?= $e((string) ($pkg['created_at'] ?? '')) ?></td>
<td>
<form method="post" action="/orders/<?= $e((string) ($orderId ?? 0)) ?>/shipment/<?= $e((string) ($pkg['id'] ?? 0)) ?>/delete" class="form-delete-package" style="display:inline">
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
<button type="submit" class="btn btn--sm btn--danger btn-delete-package">Usun</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
@@ -1055,4 +1062,21 @@ foreach ($addressesList as $address) {
})();
</script>
<script>
document.querySelectorAll('.form-delete-package').forEach(function(form) {
form.addEventListener('submit', function(e) {
e.preventDefault();
if (window.OrderProAlerts && window.OrderProAlerts.confirm) {
window.OrderProAlerts.confirm({
title: 'Usuwanie przesylki',
message: 'Czy na pewno chcesz usunac te przesylke?',
onConfirm: function() { form.submit(); }
});
} else if (confirm('Czy na pewno chcesz usunac te przesylke?')) {
form.submit();
}
});
});
</script>
<?php require __DIR__ . '/partials/email-send-modal.php'; ?>