Add pagination to the product list (backOffice)

This commit is contained in:
Guillaume Barral
2014-06-03 12:35:52 +02:00
parent 6137fb8893
commit eb895bc544
5 changed files with 39 additions and 25 deletions

View File

@@ -169,7 +169,8 @@ class CategoryController extends AbstractSeoCrudController
return array(
'category_id' => $this->getRequest()->get('category_id', 0),
'folder_id' => $this->getRequest()->get('folder_id', 0),
'current_tab' => $this->getRequest()->get('current_tab', 'general')
'current_tab' => $this->getRequest()->get('current_tab', 'general'),
'page' => $this->getRequest()->get('page', 1)
);
}
@@ -182,14 +183,17 @@ class CategoryController extends AbstractSeoCrudController
array(
'category_order' => $currentOrder,
'product_order' => $product_order,
'category_id' => $this->getRequest()->get('category_id', 0)
'category_id' => $this->getRequest()->get('category_id', 0),
'page' => $this->getRequest()->get('page', 1)
));
}
protected function redirectToListTemplate()
{
$category_id = $this->getRequest()->get('category_id', 0);
$this->redirectToListTemplateWithId($category_id);
$this->redirectToRoute('admin.categories', array(
'category_id' => $this->getRequest()->get('category_id', 0),
'page' => $this->getRequest()->get('page', 1))
);
}
protected function redirectToListTemplateWithId($category_id)

View File

@@ -361,7 +361,8 @@ class ProductController extends AbstractSeoCrudController
'product_id' => $this->getRequest()->get('product_id', 0),
'folder_id' => $this->getRequest()->get('folder_id', 0),
'accessory_category_id' => $this->getRequest()->get('accessory_category_id', 0),
'current_tab' => $this->getRequest()->get('current_tab', 'general')
'current_tab' => $this->getRequest()->get('current_tab', 'general'),
'page' => $this->getRequest()->get('page', 1)
);
}
@@ -386,7 +387,8 @@ class ProductController extends AbstractSeoCrudController
return $this->render('categories',
array(
'product_order' => $currentOrder,
'category_id' => $this->getCategoryId()
'category_id' => $this->getCategoryId(),
'page' => $this->getRequest()->get('page', 1)
));
}
@@ -394,7 +396,10 @@ class ProductController extends AbstractSeoCrudController
{
$this->redirectToRoute(
'admin.products.default',
array('category_id' => $this->getCategoryId())
array(
'category_id' => $this->getCategoryId(),
'page' => $this->getRequest()->get('page', 1)
)
);
}
@@ -438,18 +443,6 @@ class ProductController extends AbstractSeoCrudController
);
}
protected function performAdditionalUpdateAction($updateEvent)
{
if ($this->getRequest()->get('save_mode') != 'stay') {
// Redirect to parent product list
$this->redirectToRoute(
'admin.categories.default',
array('category_id' => $this->getCategoryId())
);
}
}
protected function performAdditionalUpdatePositionAction($positionEvent)
{
// Redirect to parent product list