Initial Commit

This commit is contained in:
2019-11-21 12:25:31 +01:00
commit f4aabcb9b1
13959 changed files with 787761 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
<?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 FreeShipping\Form;
use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\NotBlank;
use Thelia\Core\Translation\Translator;
use Thelia\Form\BaseForm;
/**
* Class FreeShippingRuleCreationForm
* @package FreeShipping\Form
*/
class FreeShippingRuleCreationForm extends BaseForm
{
protected function buildForm()
{
$this->formBuilder
->add('area', 'text', array(
'constraints' => array(
new NotBlank()
),
'label' => Translator::getInstance()->trans('Area'),
'label_attr' => array(
'for' => 'free_shipping_area'
)
))
->add('amount', 'text', array(
'constraints' => array(
new NotBlank()
),
'label' => Translator::getInstance()->trans('Amount'),
'label_attr' => array(
'for' => 'free_shipping_amount'
)
))
;
}
/**
* @return string
*/
public function getName()
{
return 'admin_free_shipping_rule_creation';
}
}

View File

@@ -0,0 +1,49 @@
<?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 FreeShipping\Form;
use Symfony\Component\Validator\Constraints\GreaterThan;
/**
* Class FreeShippingRuleModificationForm
* @package Thelia\Form
* @author Michaël Espeche <mespeche@openstudio.fr>
*/
class FreeShippingRuleModificationForm extends FreeShippingRuleCreationForm
{
protected function buildForm()
{
parent::buildForm();
$this->formBuilder
->add("id", "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
;
}
public function getName()
{
return "admin_free_shipping_rule_modification";
}
}