Browse Source

[Admin] ReductionCatalog : suppression optimisation

develop
Guillaume Bourgeois 1 year ago
parent
commit
18a8c4f8af
1 changed files with 11 additions and 12 deletions
  1. +11
    -12
      Definition/Field/Reduction/ReductionCatalogFieldDefinition.php

+ 11
- 12
Definition/Field/Reduction/ReductionCatalogFieldDefinition.php View File

@@ -99,7 +99,7 @@ class ReductionCatalogFieldDefinition extends AbstractFieldDefinition
}

if(is_null($this->productFamilyArray)) {
$this->productFamilyArray = $this->productFamilyStore->setMerchant($this->merchant)->get();
$this->productFamilyArray = $this->productFamilyStore->setMerchant($this->merchant)->getOnlineAndOffline();
}

if(is_null($this->productCategoryArray)) {
@@ -140,7 +140,16 @@ class ReductionCatalogFieldDefinition extends AbstractFieldDefinition

'usersActive' => BooleanField::new('usersActive')->setFormTypeOption('mapped', false),

'users' => AssociationField::new('users')
'users' => /*ChoiceField::new('users')
->setChoices([null])
->setTemplatePath('@LcSov/adminlte/crud/field/association_many.html.twig')
->setFormTypeOption('attr', [
'data-ajax' => json_encode([
'url' => $this->urlGenerator->generate('app_admin_ajax_users'),
'dataType' => 'json'
])
]),*/
AssociationField::new('users')
->setTemplatePath('@LcSov/adminlte/crud/field/association_many.html.twig')
->setFormTypeOption('choices', $this->usersArray)
->setFormTypeOption(
@@ -154,16 +163,6 @@ class ReductionCatalogFieldDefinition extends AbstractFieldDefinition
return ['data-group-users' => json_encode($data)];
},
),

/*ChoiceField::new('users')
->setChoices([null])
->setTemplatePath('@LcSov/adminlte/crud/field/association_many.html.twig')
->setFormTypeOption('attr', [
'data-ajax' => json_encode([
'url' => $this->urlGenerator->generate('app_admin_ajax_users'),
'dataType' => 'json'
])
]),*/
'productCategoriesActive' => BooleanField::new('productCategoriesActive')->setFormTypeOption('mapped', false),
'productCategories' => AssociationField::new('productCategories')
->setTemplatePath('@LcSov/adminlte/crud/field/association_many.html.twig')

Loading…
Cancel
Save