Add validation for Store configuration
This commit is contained in:
@@ -23,9 +23,6 @@
|
||||
namespace Thelia\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Thelia\Log\Tlog;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
class ConfigStoreForm extends BaseForm
|
||||
@@ -34,12 +31,19 @@ class ConfigStoreForm extends BaseForm
|
||||
{
|
||||
$this->formBuilder
|
||||
->add("store_name", "text", array(
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank()
|
||||
),
|
||||
"label" => Translator::getInstance()->trans('Store name'),
|
||||
"label_attr" => array(
|
||||
"for" => "store_name"
|
||||
)
|
||||
))
|
||||
->add("store_email", "text", array(
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank(),
|
||||
new Constraints\Email()
|
||||
),
|
||||
"label" => Translator::getInstance()->trans('Store email address'),
|
||||
"label_attr" => array(
|
||||
"for" => "store_email"
|
||||
@@ -49,40 +53,45 @@ class ConfigStoreForm extends BaseForm
|
||||
"label" => Translator::getInstance()->trans('Business ID'),
|
||||
"label_attr" => array(
|
||||
"for" => "store_business_id"
|
||||
)
|
||||
),
|
||||
"required" => false
|
||||
))
|
||||
->add("store_phone", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Phone"),
|
||||
"label_attr" => array(
|
||||
"for" => "store_phone"
|
||||
)
|
||||
),
|
||||
"required" => false
|
||||
))
|
||||
->add("store_fax", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Fax"),
|
||||
"label_attr" => array(
|
||||
"for" => "store_fax"
|
||||
)
|
||||
),
|
||||
"required" => false
|
||||
))
|
||||
->add("store_address1", "text", array(
|
||||
"constraints" => array(
|
||||
new Constraints\NotBlank()
|
||||
),
|
||||
"label" => Translator::getInstance()->trans("Street Address"),
|
||||
"label_attr" => array(
|
||||
"for" => "store_address1"
|
||||
),
|
||||
"label" => Translator::getInstance()->trans("Street Address ")
|
||||
)
|
||||
))
|
||||
->add("store_address2", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Address Line 2"),
|
||||
"label_attr" => array(
|
||||
"for" => "store_address2"
|
||||
)
|
||||
),
|
||||
"required" => false
|
||||
))
|
||||
->add("store_address3", "text", array(
|
||||
"label" => Translator::getInstance()->trans("Address Line 3"),
|
||||
"label_attr" => array(
|
||||
"for" => "store_address3"
|
||||
)
|
||||
),
|
||||
"required" => false
|
||||
))
|
||||
->add("store_zipcode", "text", array(
|
||||
"constraints" => array(
|
||||
|
||||
Reference in New Issue
Block a user