Init des modules PaiementALivraison et LivraisonParSecteurs
This commit is contained in:
36
local/modules/DeliveryRound/Form/DeliveryRoundConfigForm.php
Normal file
36
local/modules/DeliveryRound/Form/DeliveryRoundConfigForm.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace DeliveryRound\Form;
|
||||
|
||||
use DeliveryRound\DeliveryRound;
|
||||
use Thelia\Form\BaseForm;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
|
||||
/**
|
||||
* Class DeliveryRoundConfigForm
|
||||
* @package DeliveryRound\Form
|
||||
* @author Etienne Perriere <eperriere@openstudio.fr>
|
||||
*/
|
||||
class DeliveryRoundConfigForm extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add(
|
||||
'price',
|
||||
'number',
|
||||
[
|
||||
'constraints' => [new Constraints\NotBlank()],
|
||||
'required' => true,
|
||||
'label' => $this->translator->trans('Price', [], DeliveryRound::DOMAIN_NAME),
|
||||
'label_attr' => ['for' => 'price'],
|
||||
'data' => DeliveryRound::getConfigValue('price', 0)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'deliveryround_config_form';
|
||||
}
|
||||
}
|
||||
32
local/modules/DeliveryRound/Form/DeliveryRoundDeleteForm.php
Normal file
32
local/modules/DeliveryRound/Form/DeliveryRoundDeleteForm.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace DeliveryRound\Form;
|
||||
|
||||
use Thelia\Form\BaseForm;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
|
||||
/**
|
||||
* Class DeliveryRoundDeleteForm
|
||||
* @package DeliveryRound\Form
|
||||
* @author Etienne Perriere <eperriere@openstudio.fr>
|
||||
*/
|
||||
class DeliveryRoundDeleteForm extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add(
|
||||
'id',
|
||||
'integer',
|
||||
[
|
||||
'constraints' => [new Constraints\NotBlank()],
|
||||
'required' => true,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'deliveryround_delete_form';
|
||||
}
|
||||
}
|
||||
77
local/modules/DeliveryRound/Form/DeliveryRoundForm.php
Normal file
77
local/modules/DeliveryRound/Form/DeliveryRoundForm.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace DeliveryRound\Form;
|
||||
|
||||
use DeliveryRound\DeliveryRound;
|
||||
use DeliveryRound\Model\Map\DeliveryRoundTableMap;
|
||||
use Thelia\Form\BaseForm;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
|
||||
/**
|
||||
* Class DeliveryRoundForm
|
||||
* @package DeliveryRound\Form
|
||||
* @author Etienne Perriere <eperriere@openstudio.fr>
|
||||
*/
|
||||
class DeliveryRoundForm extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add(
|
||||
'zipcode',
|
||||
'text',
|
||||
[
|
||||
'constraints' => [new Constraints\NotBlank()],
|
||||
'required' => true,
|
||||
'label' => $this->translator->trans('ZipCode', [], DeliveryRound::DOMAIN_NAME),
|
||||
'label_attr' => ['for' => 'delivery-round-zipcode'],
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'city',
|
||||
'text',
|
||||
[
|
||||
'constraints' => [new Constraints\NotBlank()],
|
||||
'required' => true,
|
||||
'label' => $this->translator->trans('City', [], DeliveryRound::DOMAIN_NAME),
|
||||
'label_attr' => ['for' => 'delivery-round-city'],
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'address',
|
||||
'text',
|
||||
[
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('Address', [], DeliveryRound::DOMAIN_NAME),
|
||||
'label_attr' => ['for' => 'delivery-round-address'],
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'day',
|
||||
'choice',
|
||||
[
|
||||
'choices' => DeliveryRoundTableMap::getValueSet(DeliveryRoundTableMap::DAY),
|
||||
'constraints' => [new Constraints\NotBlank()],
|
||||
'required' => true,
|
||||
'label' => $this->translator->trans('Day', [], DeliveryRound::DOMAIN_NAME),
|
||||
'label_attr' => ['for' => 'delivery-round-day'],
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'delivery_period',
|
||||
'text',
|
||||
[
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('Delivery period', [], DeliveryRound::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'for' => 'delivery-round-delivery_period'
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'deliveryround_form';
|
||||
}
|
||||
}
|
||||
46
local/modules/DeliveryRound/Form/DeliveryRoundUpdateForm.php
Normal file
46
local/modules/DeliveryRound/Form/DeliveryRoundUpdateForm.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: apenalver
|
||||
* Date: 28/06/2016
|
||||
* Time: 10:30
|
||||
*/
|
||||
|
||||
namespace DeliveryRound\Form;
|
||||
|
||||
use DeliveryRound\DeliveryRound;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
/**
|
||||
* Class DeliveryRoundUpdateForm
|
||||
* @package DeliveryRound/Form
|
||||
*/
|
||||
class DeliveryRoundUpdateForm extends DeliveryRoundForm
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm();
|
||||
|
||||
$this->formBuilder
|
||||
->add('id', 'integer', array(
|
||||
"label" => $this->translator->trans("Id", [], DeliveryRound::DOMAIN_NAME),
|
||||
"label_attr" => ["for" => "delivery-round-id"],
|
||||
"required" => true,
|
||||
"constraints" => [
|
||||
new NotBlank()
|
||||
],
|
||||
"attr" => array()
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "deliveryround_update_form";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user