Init des modules PaiementALivraison et LivraisonParSecteurs

This commit is contained in:
2021-02-02 11:01:58 +01:00
parent c1daba23d9
commit 2165100ac7
35 changed files with 3884 additions and 5 deletions

View 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';
}
}

View 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';
}
}

View 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';
}
}

View 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";
}
}