Merge branch 'master' of https://github.com/thelia/thelia into coupon
# By Manuel Raynaud (18) and others # Via franck (9) and others * 'master' of https://github.com/thelia/thelia: (39 commits) Working : Working : Working : Working : Fixed minor visual glitches Working : Resize countries flag + Add bootstrap-switch fix test suite clear asset cache in cache:cler command Added a 'development mode' to assetic smarty plugin rewriting router use good Request object Added Tools\URL test case, and a test case superclass for initializing Tools\URL remove unused UrlWritin controller create router for rewriting matching customer substitutions fix typo in front id Working : For attributes on labels Working : For attributes on labels add label_attr attribute to form smarty plugin start refactorin rewriting routing ... Conflicts: core/lib/Thelia/Config/Resources/routing/front.xml templates/admin/default/assets/less/thelia/bootstrap-editable.less templates/admin/default/categories.html
This commit is contained in:
@@ -26,11 +26,11 @@ use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
|
||||
/**
|
||||
* Class AddressForm
|
||||
* Class AddressCreateForm
|
||||
* @package Thelia\Form
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class AddressForm extends BaseForm
|
||||
class AddressCreateForm extends BaseForm
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,8 @@ class AddressForm extends BaseForm
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "address name"
|
||||
"label" => "address name",
|
||||
"required" => true
|
||||
))
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(
|
||||
69
core/lib/Thelia/Form/AddressUpdateForm.php
Normal file
69
core/lib/Thelia/Form/AddressUpdateForm.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Form;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
|
||||
/**
|
||||
* Class AddressUpdateForm
|
||||
* @package Thelia\Form
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class AddressUpdateForm extends AddressCreateForm {
|
||||
|
||||
/**
|
||||
*
|
||||
* in this function you add all the fields you need for your Form.
|
||||
* Form this you have to call add method on $this->formBuilder attribute :
|
||||
*
|
||||
* $this->formBuilder->add("name", "text")
|
||||
* ->add("email", "email", array(
|
||||
* "attr" => array(
|
||||
* "class" => "field"
|
||||
* ),
|
||||
* "label" => "email",
|
||||
* "constraints" => array(
|
||||
* new \Symfony\Component\Validator\Constraints\NotBlank()
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* ->add('age', 'integer');
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string the name of you form. This name must be unique
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_address_update";
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ abstract class BaseForm
|
||||
$successUrl = $default;
|
||||
}
|
||||
|
||||
return URL::absoluteUrl($successUrl);
|
||||
return URL::getInstance()->absoluteUrl($successUrl);
|
||||
}
|
||||
|
||||
public function createView()
|
||||
|
||||
@@ -67,6 +67,10 @@ class CartAdd extends BaseForm
|
||||
new Constraints\Callback(array("methods" => array(
|
||||
array($this, "checkProduct")
|
||||
)))
|
||||
),
|
||||
"label" => "product",
|
||||
"label_attr" => array(
|
||||
"for" => "cart_product"
|
||||
)
|
||||
))
|
||||
->add("product_sale_elements_id", "text", array(
|
||||
|
||||
@@ -32,6 +32,10 @@ class CategoryCreationForm extends BaseForm
|
||||
->add("title", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Category title *",
|
||||
"label_attr" => array(
|
||||
"for" => "title"
|
||||
)
|
||||
))
|
||||
->add("parent", "integer", array(
|
||||
|
||||
@@ -40,11 +40,47 @@ class CurrencyCreationForm extends BaseForm
|
||||
}
|
||||
|
||||
$this->formBuilder
|
||||
->add("name" , "text" , array("constraints" => array(new NotBlank())))
|
||||
->add("locale" , "text" , array("constraints" => array(new NotBlank())))
|
||||
->add("symbol" , "text" , array("constraints" => array(new NotBlank())))
|
||||
->add("rate" , "text" , array("constraints" => array(new NotBlank())))
|
||||
->add("code" , "text" , array("constraints" => $code_constraints))
|
||||
->add("name" , "text" , array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Name *",
|
||||
"label_attr" => array(
|
||||
"for" => "name"
|
||||
))
|
||||
)
|
||||
->add("locale" , "text" , array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
))
|
||||
)
|
||||
->add("symbol" , "text" , array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Symbol *",
|
||||
"label_attr" => array(
|
||||
"for" => "symbol"
|
||||
))
|
||||
)
|
||||
->add("rate" , "text" , array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "Rate from € *",
|
||||
"label_attr" => array(
|
||||
"for" => "rate"
|
||||
))
|
||||
)
|
||||
->add("code" , "text" , array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label" => "ISO 4217 code *",
|
||||
"label_attr" => array(
|
||||
"for" => "iso_4217_code"
|
||||
))
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user