- Coupon Add/Edit/Delete rule AJAX
This commit is contained in:
gmorel
2013-09-09 21:43:58 +02:00
parent 6b6dc1c800
commit 0fe443f53d
8 changed files with 252 additions and 138 deletions

View File

@@ -184,8 +184,9 @@ class CouponController extends BaseAdminController
);
/** @var CouponRuleInterface $rule */
foreach ($rules as $rule) {
foreach ($rules->getRules() as $rule) {
$args['rulesObject'][] = array(
'serviceId' => $rule->getServiceId(),
'name' => $rule->getName(),
'tooltip' => $rule->getToolTip(),
'validators' => $rule->getValidators()
@@ -338,15 +339,15 @@ class CouponController extends BaseAdminController
{
$this->checkAuth('ADMIN', 'admin.coupon.read');
if (!$this->getRequest()->isXmlHttpRequest()) {
$this->redirect(
$this->getRoute(
'admin',
array(),
Router::ABSOLUTE_URL
)
);
}
// if (!$this->getRequest()->isXmlHttpRequest()) {
// $this->redirect(
// $this->getRoute(
// 'admin',
// array(),
// Router::ABSOLUTE_URL
// )
// );
// }
/** @var ConstraintFactory $constraintFactory */
$constraintFactory = $this->container->get('thelia.constraint.factory');