update
This commit is contained in:
@@ -763,8 +763,10 @@ return [
|
||||
'save' => 'Zapisz ustawienia',
|
||||
],
|
||||
'statuses' => [
|
||||
'title' => 'Mapowanie statusow Allegro',
|
||||
'description' => 'Przypisz kazdemu statusowi orderPRO odpowiadajacy status w Allegro.',
|
||||
'title' => 'Wysylka statusow (orderPRO → Allegro)',
|
||||
'description' => 'Przypisz kazdemu statusowi orderPRO odpowiadajacy status w Allegro. Mapowanie uzywane przy synchronizacji statusow z orderPRO do Allegro.',
|
||||
'pull_title' => 'Mapowanie przy imporcie (Allegro → orderPRO)',
|
||||
'pull_description' => 'Przypisz kazdemu statusowi Allegro odpowiadajacy status w orderPRO. Mapowanie uzywane przy imporcie zamowien z Allegro.',
|
||||
'list_title' => 'Aktualne mapowania',
|
||||
'empty' => 'Brak zapisanych mapowan statusow Allegro.',
|
||||
'fields' => [
|
||||
@@ -796,6 +798,7 @@ return [
|
||||
'mapping_not_found' => 'Nie znaleziono wskazanego mapowania statusu.',
|
||||
'saved' => 'Mapowanie statusu Allegro zostalo zapisane.',
|
||||
'saved_bulk' => 'Mapowania statusow Allegro zostaly zapisane.',
|
||||
'saved_pull' => 'Mapowania importu statusow Allegro zostaly zapisane.',
|
||||
'save_failed' => 'Nie udalo sie zapisac mapowania statusu Allegro.',
|
||||
'deleted' => 'Mapowanie statusu Allegro zostalo usuniete.',
|
||||
'delete_failed' => 'Nie udalo sie usunac mapowania statusu Allegro.',
|
||||
|
||||
@@ -1446,10 +1446,41 @@ details[open] > .order-statuses-side__title .order-statuses-side__arrow {
|
||||
margin-bottom: 10px;
|
||||
|
||||
&__name {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
color: #475569;
|
||||
font-weight: 700;
|
||||
margin-bottom: 5px;
|
||||
text-decoration: none;
|
||||
padding: 3px 6px;
|
||||
border-radius: 6px;
|
||||
border-left: 3px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
|
||||
&:hover {
|
||||
background: #f1f5f9;
|
||||
}
|
||||
}
|
||||
|
||||
&__count {
|
||||
min-width: 24px;
|
||||
text-align: center;
|
||||
border-radius: 999px;
|
||||
background: var(--group-color, #64748b);
|
||||
padding: 1px 6px;
|
||||
font-weight: 700;
|
||||
font-size: 11px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
&.is-active > .order-status-group__name {
|
||||
background: rgba(15, 23, 42, 0.06);
|
||||
color: #0f172a;
|
||||
border-left-color: var(--group-color, #64748b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ $eventLabels = [
|
||||
'payment.status_changed' => 'Zmiana statusu platnosci',
|
||||
'order.status_changed' => 'Zmiana statusu zamowienia',
|
||||
'order.status_aged' => 'Minelo X dni od zmiany statusu',
|
||||
'order.imported' => 'Pobranie zamowienia',
|
||||
];
|
||||
|
||||
$recipientLabels = [
|
||||
|
||||
@@ -18,6 +18,7 @@ $eventLabels = [
|
||||
'payment.status_changed' => 'Zmiana statusu platnosci',
|
||||
'order.status_changed' => 'Zmiana statusu zamowienia',
|
||||
'order.status_aged' => 'Minelo X dni od zmiany statusu',
|
||||
'order.imported' => 'Pobranie zamowienia',
|
||||
];
|
||||
|
||||
$statusLabels = [
|
||||
|
||||
@@ -13,9 +13,21 @@ $panelTitle = trim((string) ($statusPanelTitle ?? 'Statusy'));
|
||||
<div class="order-statuses-side__body">
|
||||
<?php foreach ($panelItems as $group): ?>
|
||||
<?php $groupItems = is_array($group['items'] ?? null) ? $group['items'] : []; ?>
|
||||
<div class="order-status-group">
|
||||
<?php
|
||||
$groupActiveClass = !empty($group['is_active_group']) ? ' is-active' : '';
|
||||
$groupColor = (string) ($group['color_hex'] ?? '#64748b');
|
||||
?>
|
||||
<div class="order-status-group<?= $e($groupActiveClass) ?>">
|
||||
<?php if ((string) ($group['name'] ?? '') !== ''): ?>
|
||||
<div class="order-status-group__name"><?= $e((string) ($group['name'] ?? '')) ?></div>
|
||||
<?php $groupUrl = trim((string) ($group['group_url'] ?? '')); ?>
|
||||
<?php if ($groupUrl !== ''): ?>
|
||||
<a href="<?= $e($groupUrl) ?>" class="order-status-group__name" style="--group-color: <?= $e($groupColor) ?>;">
|
||||
<span class="order-status-group__label"><?= $e((string) ($group['name'] ?? '')) ?></span>
|
||||
<span class="order-status-group__count"><?= $e((string) ((int) ($group['group_count'] ?? 0))) ?></span>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<div class="order-status-group__name"><?= $e((string) ($group['name'] ?? '')) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($groupItems as $item): ?>
|
||||
<?php
|
||||
|
||||
@@ -18,6 +18,7 @@ $statusSyncIntervalMinutes = max(1, (int) ($statusSyncIntervalMinutes ?? 15));
|
||||
$statusMappings = is_array($statusMappings ?? null) ? $statusMappings : [];
|
||||
$orderproStatuses = is_array($orderproStatuses ?? null) ? $orderproStatuses : [];
|
||||
$allegroStatuses = is_array($allegroStatuses ?? null) ? $allegroStatuses : [];
|
||||
$pullStatusMappings = is_array($pullStatusMappings ?? null) ? $pullStatusMappings : [];
|
||||
$allegroMappingIndex = [];
|
||||
foreach ($statusMappings as $m) {
|
||||
$opCode = strtolower(trim((string) ($m['orderpro_status_code'] ?? '')));
|
||||
@@ -25,6 +26,13 @@ foreach ($statusMappings as $m) {
|
||||
$allegroMappingIndex[$opCode] = $m;
|
||||
}
|
||||
}
|
||||
$pullMappingIndex = [];
|
||||
foreach ($pullStatusMappings as $pm) {
|
||||
$aCode = strtolower(trim((string) ($pm['allegro_status_code'] ?? '')));
|
||||
if ($aCode !== '') {
|
||||
$pullMappingIndex[$aCode] = $pm;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<section class="card">
|
||||
@@ -216,6 +224,68 @@ foreach ($statusMappings as $m) {
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="mt-24">
|
||||
<h3 class="section-title"><?= $e($t('settings.allegro.statuses.pull_title')) ?></h3>
|
||||
<p class="muted mt-12"><?= $e($t('settings.allegro.statuses.pull_description')) ?></p>
|
||||
|
||||
<form action="/settings/integrations/allegro/statuses/save-pull" method="post" class="mt-12">
|
||||
<input type="hidden" name="_token" value="<?= $e($csrfToken ?? '') ?>">
|
||||
<div class="table-wrap mt-12">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $e($t('settings.allegro.statuses.fields.allegro_status')) ?></th>
|
||||
<th><?= $e($t('settings.allegro.statuses.fields.orderpro_status_code')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($pullStatusMappings === []): ?>
|
||||
<tr>
|
||||
<td colspan="2" class="muted"><?= $e($t('settings.allegro.statuses.empty')) ?></td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($pullStatusMappings as $pullMapping): ?>
|
||||
<?php
|
||||
$aCode = strtolower(trim((string) ($pullMapping['allegro_status_code'] ?? '')));
|
||||
if ($aCode === '') continue;
|
||||
$aName = (string) ($pullMapping['allegro_status_name'] ?? '');
|
||||
$selectedOrderproCode = strtolower(trim((string) ($pullMapping['orderpro_status_code'] ?? '')));
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $e($aName !== '' ? $aName : $aCode) ?> <code class="muted"><?= $e($aCode) ?></code>
|
||||
<input type="hidden" name="allegro_status_code[]" value="<?= $e($aCode) ?>">
|
||||
<input type="hidden" name="allegro_status_name[]" value="<?= $e($aName) ?>">
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" name="orderpro_status_code[]">
|
||||
<option value=""><?= $e($t('settings.order_statuses.fields.no_mapping')) ?></option>
|
||||
<?php foreach ($orderproStatuses as $opStatus): ?>
|
||||
<?php
|
||||
$opCode = strtolower(trim((string) ($opStatus['code'] ?? '')));
|
||||
$opName = (string) ($opStatus['name'] ?? $opCode);
|
||||
if ($opCode === '') continue;
|
||||
?>
|
||||
<option value="<?= $e($opCode) ?>"<?= $selectedOrderproCode === $opCode ? ' selected' : '' ?>>
|
||||
<?= $e($opName) ?> (<?= $e($opCode) ?>)
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php if ($pullStatusMappings !== []): ?>
|
||||
<div class="form-actions mt-12">
|
||||
<button type="submit" class="btn btn--primary"><?= $e($t('settings.allegro.statuses.actions.save_bulk')) ?></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="content-tab-panel<?= $activeTab === 'settings' ? ' is-active' : '' ?>" data-tab-panel="allegro-tab-settings">
|
||||
|
||||
Reference in New Issue
Block a user