- Refactored `listLinkedOffersByIntegration` to `paginateLinkedOffersByIntegration` in `MarketplaceRepository`. - Added pagination support with `page` and `per_page` filters. - Introduced sorting options for offers. - Created `listOfferChannelsByIntegration` method to retrieve distinct sales channels. - Enhanced SQL queries to support dynamic filtering based on provided parameters. feat: Add new fields for products and SKU generation - Introduced new fields: `new_to_date`, `additional_message`, `additional_message_required`, and `additional_message_text` in the `products` table. - Added `findAllSkus` method in `ProductRepository` to retrieve all SKUs. - Created `ProductSkuGenerator` class to handle SKU generation based on a configurable format. - Implemented `nextSku` method to generate the next available SKU. feat: Enhance product settings management in the UI - Added new settings page for product SKU format in `SettingsController`. - Implemented form handling for saving SKU format settings. - Updated the view to include SKU format configuration options. feat: Implement cron job for refreshing ShopPro offer titles - Created `ShopProOfferTitlesRefreshHandler` to handle the cron job for refreshing offer titles. - Integrated with the `OfferImportService` to import offers from ShopPro. docs: Update database schema documentation - Added documentation for new fields in the `products` table and new cron job for offer title refresh. - Documented the purpose and structure of the `app_settings` table. migrations: Add necessary migrations for new features - Created migration to add `products_sku_format` setting in `app_settings`. - Added migration to introduce new fields in the `products` table. - Created migration for the new cron job schedule for refreshing ShopPro offer titles.
100 lines
4.1 KiB
PHP
100 lines
4.1 KiB
PHP
<?php
|
|
$migrationStatus = is_array($status ?? null) ? $status : [];
|
|
$pending = (int) ($migrationStatus['pending'] ?? 0);
|
|
$total = (int) ($migrationStatus['total'] ?? 0);
|
|
$applied = (int) ($migrationStatus['applied'] ?? 0);
|
|
$pendingFiles = (array) ($migrationStatus['pending_files'] ?? []);
|
|
$logs = (array) ($runLogs ?? []);
|
|
?>
|
|
|
|
<section class="card">
|
|
<h1><?= $e($t('settings.title')) ?></h1>
|
|
<p class="muted"><?= $e($t('settings.description')) ?></p>
|
|
<nav class="settings-nav mt-16" aria-label="<?= $e($t('settings.submenu_label')) ?>">
|
|
<a class="settings-nav__link<?= ($activeSettings ?? '') === 'database' ? ' is-active' : '' ?>" href="/settings/database"><?= $e($t('settings.database.title')) ?></a>
|
|
<a class="settings-nav__link<?= ($activeSettings ?? '') === 'integrations' ? ' is-active' : '' ?>" href="/settings/integrations/shoppro"><?= $e($t('settings.integrations.title')) ?></a>
|
|
<a class="settings-nav__link<?= ($activeSettings ?? '') === 'cron' ? ' is-active' : '' ?>" href="/settings/cron"><?= $e($t('settings.cron.title')) ?></a>
|
|
<a class="settings-nav__link<?= ($activeSettings ?? '') === 'gs1' ? ' is-active' : '' ?>" href="/settings/gs1"><?= $e($t('settings.gs1.title')) ?></a>
|
|
<a class="settings-nav__link<?= ($activeSettings ?? '') === 'products' ? ' is-active' : '' ?>" href="/settings/products"><?= $e($t('settings.products.title')) ?></a>
|
|
</nav>
|
|
</section>
|
|
|
|
<section class="card mt-16">
|
|
<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>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($successMessage)): ?>
|
|
<div class="alert alert--success mt-12" role="status">
|
|
<?= $e((string) $successMessage) ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="settings-grid mt-16">
|
|
<div class="settings-stat">
|
|
<span class="settings-stat__label"><?= $e($t('settings.database.stats.total')) ?></span>
|
|
<strong class="settings-stat__value"><?= $e((string) $total) ?></strong>
|
|
</div>
|
|
<div class="settings-stat">
|
|
<span class="settings-stat__label"><?= $e($t('settings.database.stats.applied')) ?></span>
|
|
<strong class="settings-stat__value"><?= $e((string) $applied) ?></strong>
|
|
</div>
|
|
<div class="settings-stat">
|
|
<span class="settings-stat__label"><?= $e($t('settings.database.stats.pending')) ?></span>
|
|
<strong class="settings-stat__value"><?= $e((string) $pending) ?></strong>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ($pending > 0): ?>
|
|
<div class="alert alert--warning mt-16" role="status">
|
|
<?= $e($t('settings.database.state.needs_update')) ?>
|
|
</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>
|
|
<?php endif; ?>
|
|
</section>
|
|
|
|
<section class="card mt-16">
|
|
<h2 class="section-title"><?= $e($t('settings.database.pending_files_title')) ?></h2>
|
|
<div class="table-wrap mt-12">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th><?= $e($t('settings.database.fields.filename')) ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if (empty($pendingFiles)): ?>
|
|
<tr>
|
|
<td class="muted"><?= $e($t('settings.database.pending_files_empty')) ?></td>
|
|
</tr>
|
|
<?php else: ?>
|
|
<?php foreach ($pendingFiles as $filename): ?>
|
|
<tr>
|
|
<td><?= $e((string) $filename) ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<?php if (!empty($logs)): ?>
|
|
<section class="card mt-16">
|
|
<h2 class="section-title"><?= $e($t('settings.database.last_run_logs')) ?></h2>
|
|
<pre class="settings-logs mt-12"><?php foreach ($logs as $line): ?><?= $e((string) $line) . "\n" ?><?php endforeach; ?></pre>
|
|
</section>
|
|
<?php endif; ?>
|