Removed the useless coupon read function
This commit is contained in:
@@ -512,10 +512,6 @@
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::updateAction</default>
|
||||
<requirement key="couponId">\d+</requirement>
|
||||
</route>
|
||||
<route id="admin.coupon.read" path="/admin/coupon/read/{couponId}">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::readAction</default>
|
||||
<requirement key="couponId">\d+</requirement>
|
||||
</route>
|
||||
<route id="admin.coupon.draw.inputs.ajax" path="/admin/coupon/draw/inputs/{couponServiceId}">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::getBackOfficeInputsAjaxAction</default>
|
||||
<requirement key="couponServiceId">.*</requirement>
|
||||
@@ -549,7 +545,7 @@
|
||||
|
||||
<!-- Routes to the Config (system variables) controller -->
|
||||
|
||||
<route id="admin.configuration.inedx" path="/admin/configuration">
|
||||
<route id="admin.configuration.index" path="/admin/configuration">
|
||||
<default key="_controller">Thelia\Controller\Admin\ConfigurationController::indexAction</default>
|
||||
</route>
|
||||
|
||||
|
||||
@@ -53,58 +53,15 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function browseAction()
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
|
||||
$args['urlReadCoupon'] = $this->getRoute(
|
||||
'admin.coupon.read',
|
||||
array('couponId' => 0),
|
||||
Router::ABSOLUTE_URL
|
||||
);
|
||||
|
||||
$args['urlEditCoupon'] = $this->getRoute(
|
||||
'admin.coupon.update',
|
||||
array('couponId' => 0),
|
||||
Router::ABSOLUTE_URL
|
||||
);
|
||||
|
||||
$args['urlCreateCoupon'] = $this->getRoute(
|
||||
'admin.coupon.create',
|
||||
array(),
|
||||
Router::ABSOLUTE_URL
|
||||
);
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$args['coupon_order'] = $this->getListOrderFromSession('coupon', 'coupon_order', 'code');
|
||||
|
||||
return $this->render('coupon-list', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Coupons read display
|
||||
*
|
||||
* @param int $couponId Coupon Id
|
||||
*
|
||||
* @return \Thelia\Core\HttpFoundation\Response
|
||||
*/
|
||||
public function readAction($couponId)
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
|
||||
$coupon = CouponQuery::create()->findPk($couponId);
|
||||
|
||||
if ($coupon === null) {
|
||||
return $this->pageNotFound();
|
||||
}
|
||||
|
||||
$args['couponId'] = $couponId;
|
||||
$args['urlEditCoupon'] = $this->getRoute(
|
||||
'admin.coupon.update',
|
||||
array('couponId' => $couponId),
|
||||
Router::ABSOLUTE_URL
|
||||
);
|
||||
|
||||
return $this->render('coupon-read', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Coupons creation display
|
||||
*
|
||||
@@ -112,9 +69,7 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
// Check current user authorization
|
||||
$response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::CREATE);
|
||||
if ($response !== null) {
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::CREATE)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -165,9 +120,7 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function updateAction($couponId)
|
||||
{
|
||||
// Check current user authorization
|
||||
$response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::UPDATE);
|
||||
if ($response !== null) {
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::UPDATE)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -342,7 +295,9 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function getConditionToUpdateInputAjaxAction($couponId, $conditionIndex)
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
@@ -396,7 +351,9 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function saveConditionsAction($couponId)
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::UPDATE)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
@@ -443,7 +400,9 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function deleteConditionsAction($couponId, $conditionIndex)
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::UPDATE)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
@@ -681,7 +640,10 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function getBackOfficeInputsAjaxAction($couponServiceId)
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
/** @var CouponInterface $coupon */
|
||||
@@ -706,7 +668,10 @@ class CouponController extends BaseAdminController
|
||||
*/
|
||||
public function getBackOfficeConditionSummariesAjaxAction($couponId)
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
if (null !== $response = $this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
/** @var Coupon $coupon */
|
||||
|
||||
Reference in New Issue
Block a user