diff --git a/core/lib/Thelia/Form/ConfigStoreForm.php b/core/lib/Thelia/Form/ConfigStoreForm.php index 6f6c0f705..382e91c4d 100644 --- a/core/lib/Thelia/Form/ConfigStoreForm.php +++ b/core/lib/Thelia/Form/ConfigStoreForm.php @@ -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( diff --git a/templates/backOffice/default/config-store.html b/templates/backOffice/default/config-store.html index fec18c8cc..2355f3b66 100644 --- a/templates/backOffice/default/config-store.html +++ b/templates/backOffice/default/config-store.html @@ -50,50 +50,50 @@
{form_field form=$form field='store_name'}
- +
- +
{/form_field} {form_field form=$form field='store_business_id'}
- +
- +
{/form_field} {form_field form=$form field='store_email'}
- +
- +
{/form_field} {form_field form=$form field='store_phone'}
- +
- +
{/form_field} {form_field form=$form field='store_fax'}
- +
- +
{/form_field} @@ -104,41 +104,41 @@ {form_field form=$form field='store_address1'}
- - + +
{/form_field} {form_field form=$form field='store_address2'}
- +
{/form_field} {form_field form=$form field='store_address3'}
- +
{/form_field} {form_field form=$form field='store_zipcode'}
- - + +
{/form_field} {form_field form=$form field='store_city'}
- - + +
{/form_field} {form_field form=$form field='store_country'}
- - {loop type="country" name="country1"} {/loop}