WIP
- Coupon : ajax add
This commit is contained in:
@@ -344,8 +344,20 @@ class AvailableForTotalAmountManager extends CouponRuleAbstract
|
||||
$cleanedCurrencies[$currency->getCode()] = $currency->getSymbol();
|
||||
}
|
||||
|
||||
$name1 = $this->translator->trans(
|
||||
'Price',
|
||||
array(),
|
||||
'constraint'
|
||||
);
|
||||
$name2 = $this->translator->trans(
|
||||
'Currency',
|
||||
array(),
|
||||
'constraint'
|
||||
);
|
||||
|
||||
return array(
|
||||
self::INPUT1 => array(
|
||||
'title' => $name1,
|
||||
'availableOperators' => $this->availableOperators[self::INPUT1],
|
||||
'availableValues' => '',
|
||||
'type' => 'text',
|
||||
@@ -354,6 +366,7 @@ class AvailableForTotalAmountManager extends CouponRuleAbstract
|
||||
'selectedOperator' => ''
|
||||
),
|
||||
self::INPUT2 => array(
|
||||
'title' => $name2,
|
||||
'availableOperators' => $this->availableOperators[self::INPUT2],
|
||||
'availableValues' => $cleanedCurrencies,
|
||||
'type' => 'select',
|
||||
|
||||
@@ -304,8 +304,15 @@ class AvailableForXArticlesManager extends CouponRuleAbstract
|
||||
*/
|
||||
protected function generateInputs()
|
||||
{
|
||||
$name1 = $this->translator->trans(
|
||||
'Quantity',
|
||||
array(),
|
||||
'constraint'
|
||||
);
|
||||
|
||||
return array(
|
||||
self::INPUT1 => array(
|
||||
'title' => $name1,
|
||||
'availableOperators' => $this->availableOperators[self::INPUT1],
|
||||
'type' => 'text',
|
||||
'class' => 'form-control',
|
||||
|
||||
@@ -330,7 +330,7 @@ class CouponController extends BaseAdminController
|
||||
/**
|
||||
* Manage Coupons read display
|
||||
*
|
||||
* @param int $couponId Coupon Id
|
||||
* @param string $ruleId Rule service id
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
@@ -338,16 +338,21 @@ class CouponController extends BaseAdminController
|
||||
{
|
||||
$this->checkAuth('ADMIN', 'admin.coupon.read');
|
||||
|
||||
// @todo uncomment
|
||||
// if (!$this->getRequest()->isXmlHttpRequest()) {
|
||||
// $this->redirect('index');
|
||||
// }
|
||||
if (!$this->getRequest()->isXmlHttpRequest()) {
|
||||
$this->redirect(
|
||||
$this->getRoute(
|
||||
'admin',
|
||||
array(),
|
||||
Router::ABSOLUTE_URL
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/** @var ConstraintFactory $constraintFactory */
|
||||
$constraintFactory = $this->container->get('thelia.constraint.factory');
|
||||
$inputs = $constraintFactory->getInputs($ruleId);
|
||||
|
||||
if (!$inputs) {
|
||||
if ($inputs === null) {
|
||||
return $this->pageNotFound();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user