Просмотр исходного кода

Suppresion déclinaison

feature/export_comptable
Fab 4 лет назад
Родитель
Сommit
0eb4df3bf4
2 измененных файлов: 5 добавлений и 19 удалений
  1. +3
    -17
      ShopBundle/Controller/Backend/ProductFamilyController.php
  2. +2
    -2
      ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js

+ 3
- 17
ShopBundle/Controller/Backend/ProductFamilyController.php Просмотреть файл

@@ -272,12 +272,6 @@ class ProductFamilyController extends AdminController
$entity->addProduct($newProduct);
}
}else {
dump('blop');
foreach ($entity->getProducts() as $product) {

dump($product);

}
//Récupère le product origin
$originProducts = $this->em->getRepository(ProductInterface::class)->findBy(array(
'productFamily' => $entity->getId(),
@@ -301,26 +295,20 @@ class ProductFamilyController extends AdminController
if ($entity->getActiveProducts()) {
$originProduct->setStatus(-1);
} else {
foreach ($entity->getProducts() as $product) {
/*foreach ($entity->getProducts() as $product) {
$product->setStatus(0);
}
}*/
$originProduct->setStatus(1);
}

//Enregistrement
$originProduct->setProductFamily($entity);
$this->em->persist($originProduct);
$entity->addProduct($originProduct);

foreach ($entity->getProducts() as $product) {
$product->setProductFamily($entity);
$this->em->persist($product);
$entity->addProduct($product);
dump($product);

}
//die();

}
}

@@ -353,9 +341,7 @@ class ProductFamilyController extends AdminController
$id = $this->request->query->get('id');
$easyadmin = $this->request->attributes->get('easyadmin');
$entity = $easyadmin['item'];
foreach ($entity->getProducts() as $product){
dump($product);
}

if ($this->request->isXmlHttpRequest() && $property = $this->request->query->get('property')) {
$newValue = 'true' === mb_strtolower($this->request->query->get('newValue'));
$fieldsMetadata = $this->entity['list']['fields'];

+ 2
- 2
ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js Просмотреть файл

@@ -269,10 +269,10 @@ $(window).on('load', function () {
deleteProductForm: function () {
if (confirm('Êtes-vous sur de cette action ?')) {
this.status = -1;
/*Vue.delete(this.$parent.formProducts, this.keyForm);
//Vue.delete(this.$parent.formProducts, this.keyForm);
this.$nextTick(function () {
this.$parent.updateSortableProducts(true);
});*/
});
}

},

Загрузка…
Отмена
Сохранить