public function displayOrders(Request $request)
    {
        $page = (int) $request->query->get('page', 1);
        $perPage = (int) $request->query->get('per-page', 10);
        $offsetStart = 0;

        $todo = $request->query->get('todo', Order::STATUS_TODO);
        $start = $request->query->get('start', Order::STATUS_NO_FILTER);
        $limit = $request->query->get('limit', []);

        if ($page > 0) {
            $offsetStart = ($page - 1) * $perPage;
        }

        $sort = $request->query->get('sort');

        $baseIds = array_keys($this->getAclForUser()->get_granted_base([\ACL::ORDER_MASTER]));

        $ordersListTodo = $this->getOrderRepository()->listOrders($baseIds, $offsetStart, $perPage, $sort,
            ['todo' => Order::STATUS_TODO, 'created_on' => $start, 'limit' => $limit]);
        $ordersListProcessed = $this->getOrderRepository()->listOrders($baseIds, $offsetStart, $perPage, $sort,
            ['todo' => Order::STATUS_PROCESSED, 'created_on' => $start, 'limit' => $limit]);
        $totalTodo = $this->getOrderRepository()->countTotalOrders($baseIds, ['todo' => Order::STATUS_TODO, 'created_on' => $start, 'limit' => $limit]);
        $totalProcessed = $this->getOrderRepository()->countTotalOrders($baseIds, ['todo' => Order::STATUS_PROCESSED, 'created_on' => $start, 'limit' => $limit]);

        return $this->render('prod/orders/order_box.html.twig', [
            'page'         => $page,
            'perPage'      => $perPage,
            'totalTodo'        => $totalTodo,
            'totalProcessed' => $totalProcessed,
            'orders_todo'       => new ArrayCollection($ordersListTodo),
            'orders_processed'       => new ArrayCollection($ordersListProcessed),
            'todo' => $todo,
            'start' => $start,
            'date' => $limit ?  $limit['date']: null
        ]);
    }
public function displayOrders(Request $request)
    {
        $page = (int) $request->query->get('page', 1);
        $perPage = (int) $request->query->get('per-page', 10);
        $offsetStart = 0;

        $todo = $request->query->get('todo', Order::STATUS_TODO);
        $start = $request->query->get('start', Order::STATUS_NO_FILTER);
        $limit = $request->query->get('limit', []);

        if ($page > 0) {
            $offsetStart = ($page - 1) * $perPage;
        }

        $sort = $request->query->get('sort');

        $baseIds = array_keys($this->getAclForUser()->get_granted_base([\ACL::ORDER_MASTER]));

        $ordersListTodo = $this->getOrderRepository()->listOrders($baseIds, $offsetStart, $perPage, $sort,
            ['todo' => Order::STATUS_TODO, 'created_on' => $start, 'limit' => $limit]);
        $ordersListProcessed = $this->getOrderRepository()->listOrders($baseIds, $offsetStart, $perPage, $sort,
            ['todo' => Order::STATUS_PROCESSED, 'created_on' => $start, 'limit' => $limit]);
        $totalTodo = $this->getOrderRepository()->countTotalOrders($baseIds, ['todo' => Order::STATUS_TODO, 'created_on' => $start, 'limit' => $limit]);
        $totalProcessed = $this->getOrderRepository()->countTotalOrders($baseIds, ['todo' => Order::STATUS_PROCESSED, 'created_on' => $start, 'limit' => $limit]);

        return $this->render('prod/orders/order_box.html.twig', [
            'page'         => $page,
            'perPage'      => $perPage,
            'totalTodo'        => $totalTodo,
            'totalProcessed' => $totalProcessed,
            'orders_todo'       => new ArrayCollection($ordersListTodo),
            'orders_processed'       => new ArrayCollection($ordersListProcessed),
            'todo' => $todo,
            'start' => $start,
            'date' => $limit ?  $limit['date']: null
        ]);
    }
public function displayOrders ( Request $ request ) { $ page = ( int ) $ request -> query -> get ( 'page' , 1 ) ; $ perPage = ( int ) $ request -> query -> get ( 'per-page' , 10 ) ; $ offsetStart = 0 ; $ todo = $ request -> query -> get ( 'todo' , Order :: STATUS_TODO ) ; $ start = $ request -> query -> get ( 'start' , Order :: STATUS_NO_FILTER ) ; $ limit = $ request -> query -> get ( 'limit' , [ ] ) ; if ( $ page > 0 ) { $ offsetStart = ( $ page - 1 ) * $ perPage ; } $ sort = $ request -> query -> get ( 'sort' ) ; $ baseIds = array_keys ( $ this -> getAclForUser ( ) -> get_granted_base ( [ \ ACL :: ORDER_MASTER ] ) ) ; $ ordersListTodo = $ this -> getOrderRepository ( ) -> listOrders ( $ baseIds , $ offsetStart , $ perPage , $ sort , [ 'todo' => Order :: STATUS_TODO , 'created_on' => $ start , 'limit' => $ limit ] ) ; $ ordersListProcessed = $ this -> getOrderRepository ( ) -> listOrders ( $ baseIds , $ offsetStart , $ perPage , $ sort , [ 'todo' => Order :: STATUS_PROCESSED , 'created_on' => $ start , 'limit' => $ limit ] ) ; $ totalTodo = $ this -> getOrderRepository ( ) -> countTotalOrders ( $ baseIds , [ 'todo' => Order :: STATUS_TODO , 'created_on' => $ start , 'limit' => $ limit ] ) ; $ totalProcessed = $ this -> getOrderRepository ( ) -> countTotalOrders ( $ baseIds , [ 'todo' => Order :: STATUS_PROCESSED , 'created_on' => $ start , 'limit' => $ limit ] ) ; return $ this -> render ( 'prod/orders/order_box.html.twig' , [ 'page' => $ page , 'perPage' => $ perPage , 'totalTodo' => $ totalTodo , 'totalProcessed' => $ totalProcessed , 'orders_todo' => new ArrayCollection ( $ ordersListTodo ) , 'orders_processed' => new ArrayCollection ( $ ordersListProcessed ) , 'todo' => $ todo , 'start' => $ start , 'date' => $ limit ? $ limit [ 'date' ] : null ] ) ; }
Display list of orders

@param Request     $request

@return Response
Display list of orders