- Coupon Controller
This commit is contained in:
gmorel
2013-09-02 17:08:47 +02:00
parent ae0f2e766b
commit 4b1de5fe93
8 changed files with 1315 additions and 1214 deletions

View File

@@ -256,4 +256,16 @@ class CategoryController extends BaseAdminController
// We did not recognized the action -> return a 404 page
return $this->pageNotFound();
}
/**
* Get a Category from its parent id
*
* @return mixed|\Symfony\Component\HttpFoundation\Response
*/
public function getByParentIdAction($parentId, $_format = 'json')
{
if (null !== $response = $this->checkAuth("admin.catalog.view")) return $response;
return $this->render('categories', $args);
}
}

View File

@@ -77,9 +77,12 @@ class CouponController extends BaseAdminController
*
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function createCoupon($args)
protected function createAction($args)
{
$this->checkAuth("ADMIN", "admin.coupon.view");
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.coupon.create")) return $response;
$message = false;
if ($this->getRequest()->isMethod('POST')) {
try {