Working : Coupon : fix links and errors display

This commit is contained in:
gmorel
2013-09-13 12:42:33 +02:00
parent 530c3d1102
commit ed4809bac4
14 changed files with 411 additions and 397 deletions

View File

@@ -23,7 +23,10 @@
namespace Thelia\Form;
use Symfony\Component\Validator\Constraints\Date;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotEqualTo;
/**
* Created by JetBrains PhpStorm.
@@ -68,7 +71,6 @@ class CouponCreationForm extends BaseForm
'shortDescription',
'text',
array(
'invalid_message' => 'test',
'constraints' => array(
new NotBlank()
)
@@ -78,7 +80,6 @@ class CouponCreationForm extends BaseForm
'description',
'textarea',
array(
'invalid_message' => 'test',
'constraints' => array(
new NotBlank()
)
@@ -88,16 +89,23 @@ class CouponCreationForm extends BaseForm
'effect',
'text',
array(
'invalid_message' => 'test',
'constraints' => array(
new NotBlank()
new NotBlank(),
new NotEqualTo(
array(
'value' => -1
)
)
)
)
)
->add(
'amount',
'money',
array()
array(
'constraints' => array(
new NotBlank()
))
)
->add(
'isEnabled',
@@ -109,7 +117,8 @@ class CouponCreationForm extends BaseForm
'text',
array(
'constraints' => array(
new NotBlank()
new NotBlank(),
new Date()
)
)
)
@@ -133,7 +142,12 @@ class CouponCreationForm extends BaseForm
'text',
array(
'constraints' => array(
new NotBlank()
new NotBlank(),
new GreaterThanOrEqual(
array(
'value' => -1
)
)
)
)
)