ver. 0.279: Newsletter frontend migration, Languages facade elimination, bug fix newsletter_unsubscribe
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ namespace admin\Controllers;
|
||||
use Domain\Product\ProductRepository;
|
||||
use Domain\Category\CategoryRepository;
|
||||
use Domain\Integrations\IntegrationsRepository;
|
||||
use Domain\Languages\LanguagesRepository;
|
||||
use admin\ViewModels\Forms\FormEditViewModel;
|
||||
use admin\ViewModels\Forms\FormField;
|
||||
use admin\ViewModels\Forms\FormTab;
|
||||
@@ -19,11 +20,13 @@ class ShopProductController
|
||||
{
|
||||
private ProductRepository $repository;
|
||||
private IntegrationsRepository $integrationsRepository;
|
||||
private LanguagesRepository $languagesRepository;
|
||||
|
||||
public function __construct(ProductRepository $repository, IntegrationsRepository $integrationsRepository)
|
||||
public function __construct(ProductRepository $repository, IntegrationsRepository $integrationsRepository, LanguagesRepository $languagesRepository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
$this->integrationsRepository = $integrationsRepository;
|
||||
$this->languagesRepository = $languagesRepository;
|
||||
}
|
||||
|
||||
// ─── Krok 6: Lista / widok ───────────────────────────────────────
|
||||
@@ -35,7 +38,7 @@ class ShopProductController
|
||||
{
|
||||
$apiloEnabled = $this->integrationsRepository->getSetting( 'apilo', 'enabled' );
|
||||
$shopproEnabled = $this->integrationsRepository->getSetting( 'shoppro', 'enabled' );
|
||||
$dlang = \front\factory\Languages::default_language();
|
||||
$dlang = $this->languagesRepository->defaultLanguage();
|
||||
|
||||
$sortableColumns = [ 'id', 'name', 'price_brutto', 'status', 'promoted', 'quantity' ];
|
||||
|
||||
@@ -221,7 +224,7 @@ class ShopProductController
|
||||
$sets = \shop\ProductSet::sets_list();
|
||||
$producers = ( new \Domain\Producer\ProducerRepository( $db ) )->allProducers();
|
||||
$units = ( new \Domain\Dictionaries\DictionariesRepository( $db ) )->allUnits();
|
||||
$dlang = \front\factory\Languages::default_language();
|
||||
$dlang = $this->languagesRepository->defaultLanguage();
|
||||
|
||||
$viewModel = $this->buildProductFormViewModel(
|
||||
$product, $languages, $categories, $layouts, $products, $sets, $producers, $units, $dlang
|
||||
@@ -949,7 +952,7 @@ class ShopProductController
|
||||
return \Tpl::view( 'shop-product/product-combination', [
|
||||
'product' => $this->repository->findForAdmin( (int) \S::get( 'product_id' ) ),
|
||||
'attributes' => ( new \Domain\Attribute\AttributeRepository( $db ) )->getAttributesListForCombinations(),
|
||||
'default_language' => \front\factory\Languages::default_language(),
|
||||
'default_language' => $this->languagesRepository->defaultLanguage(),
|
||||
'product_permutations' => $this->repository->getCombinationsForTable( (int) \S::get( 'product_id' ) ),
|
||||
] );
|
||||
}
|
||||
@@ -1146,7 +1149,7 @@ class ShopProductController
|
||||
return \Tpl::view( 'shop-product/mass-edit', [
|
||||
'products' => $this->repository->allProductsForMassEdit(),
|
||||
'categories' => $categoryRepository->subcategories( null ),
|
||||
'dlang' => \front\factory\Languages::default_language(),
|
||||
'dlang' => $this->languagesRepository->defaultLanguage(),
|
||||
] );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user