Browse Source

Pages commandes backoffice

feature/export_comptable
Fab 4 years ago
parent
commit
9946b88dc0
1 changed files with 22 additions and 3 deletions
  1. +22
    -3
      ShopBundle/Controller/Backend/OrderController.php

+ 22
- 3
ShopBundle/Controller/Backend/OrderController.php View File



class OrderController extends AdminController class OrderController extends AdminController
{ {
protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)
{
$filterOrderStatus = false;

dump($dqlFilter);
if ($dqlFilter['orderStatus'])$filterOrderStatus = $dqlFilter['orderStatus'];
$dqlFilter = $dqlFilter['filter'];

$queryBuilder = parent::createListQueryBuilder($entityClass, $sortDirection, $sortField, $dqlFilter);

$queryBuilder->leftJoin('entity.orderStatus','orderStatus');

if ($filterOrderStatus) {
$queryBuilder->andWhere('orderStatus.alias = :status');
$queryBuilder->setParameter('status', $filterOrderStatus);
}

return $queryBuilder;
}





public function updateEntity($entity) public function updateEntity($entity)
public function renderOrderShopTemplate($actionName, $templatePath, array $parameters = []) public function renderOrderShopTemplate($actionName, $templatePath, array $parameters = [])
{ {
//dump($this->em->getRepository(OrderShop::class)->getValidOrder()); //dump($this->em->getRepository(OrderShop::class)->getValidOrder());

if ($actionName == 'show') { if ($actionName == 'show') {
$formAddProductToOrder = $this->createForm(AddPoductToOrderType::class, null, array( $formAddProductToOrder = $this->createForm(AddPoductToOrderType::class, null, array(
'action' => $this->generateUrl('easyadmin', [ 'action' => $this->generateUrl('easyadmin', [
$id = $this->request->query->get('id'); $id = $this->request->query->get('id');
$easyadmin = $this->request->attributes->get('easyadmin'); $easyadmin = $this->request->attributes->get('easyadmin');
$entity = $easyadmin['item']; $entity = $easyadmin['item'];
$easyadmin['entity']['name'] = 'OrderShop';
$fields = $this->entity['show']['fields']; $fields = $this->entity['show']['fields'];
$deleteForm = $this->createDeleteForm($this->entity['name'], $id); $deleteForm = $this->createDeleteForm($this->entity['name'], $id);




]; ];


return $this->executeDynamicMethod('render<EntityName>Template', ['show', $this->entity['templates']['show'], $parameters]);
return $this->executeDynamicMethod('renderOrderShopTemplate', ['show', $this->entity['templates']['show'], $parameters]);
} }


/** /**

Loading…
Cancel
Save