Working : Coupon : fix update effect (becomes type), update max usage

This commit is contained in:
gmorel
2013-09-19 23:25:01 +02:00
parent b545e1c012
commit 8e308d21e9
8 changed files with 50 additions and 34 deletions

View File

@@ -201,7 +201,7 @@ class CouponController extends BaseAdminController
$lang = $this->getSession()->getLang();
$eventToDispatch = TheliaEvents::COUPON_UPDATE;
// Create
// Update
if ($this->getRequest()->isMethod('POST')) {
$this->validateCreateOrUpdateForm(
$i18n,
@@ -210,7 +210,7 @@ class CouponController extends BaseAdminController
'updated',
'update'
);
} else { // Update
} else { // Display
// Prepare the data that will hydrate the form
/** @var ConstraintFactory $constraintFactory */
@@ -495,11 +495,12 @@ class CouponController extends BaseAdminController
// Get the form field values
$data = $form->getData();
$couponEvent = new CouponCreateOrUpdateEvent(
$data['code'],
$data['title'],
$data['amount'],
$data['effect'],
$data['type'],
$data['shortDescription'],
$data['description'],
$data['isEnabled'],