Explorar el Código

[Global] Bon cadeau

feature/module_traiteur_v1
Fab hace 4 años
padre
commit
9d8e2ce3e3
Se han modificado 2 ficheros con 62 adiciones y 10 borrados
  1. +60
    -0
      ShopBundle/Form/Frontend/EditGiftVoucherType.php
  2. +2
    -10
      ShopBundle/Form/Frontend/SendGiftVoucherType.php

+ 60
- 0
ShopBundle/Form/Frontend/EditGiftVoucherType.php Ver fichero

@@ -0,0 +1,60 @@
<?php

namespace Lc\ShopBundle\Form\Frontend;

use App\Entity\Address;
use App\Entity\OrderShop;
use Doctrine\ORM\EntityManagerInterface;
use Lc\ShopBundle\Model\Ticket;
use Lc\ShopBundle\Services\UtilsManager;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;

class EditGiftVoucherType extends AbstractType
{
protected $orderShopRepository ;
protected $security ;
protected $em ;
protected $priceUtils ;


public function buildForm(FormBuilderInterface $builder, array $options)
{

$builder->add('activationDate', DateType::class, [
'label' => 'Date d\'activation de votre bon cadeau',
'widget'=> 'single_text',
'help'=> 'Date à partir de laquelle la personne pourra utiliser ce bon cadeau.'
//'format'=> 'dd/MM/yyyy'
])
->add('title', TextType::class, [
'label' => 'Message personnalisé affiché dans le bon cadeau',
'help'=> 'Exemple "Joyeux Noël Tonton ! "'
])
->add('email', EmailType::class, [
'label' => 'Email de la personne à qui vous souhaitez offrir ce bon cadeau'
])
->add('ownerName', TextType::class,[
'label' => 'Nom de la ou des personnes qui offrent ce bon cadeau',
'help'=> 'Sera affiché dans le bon cadeau'
]);


}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}

+ 2
- 10
ShopBundle/Form/Frontend/SendGiftVoucherType.php Ver fichero

@@ -30,16 +30,8 @@ class SendGiftVoucherType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{

$builder->add('activationDate', DateType::class, [
'label' => 'Date d\'activation de votre bon cadeau',
'widget'=> 'single_text',
//'format'=> 'dd/MM/yyyy'
])
->add('title', TextType::class, [
'label' => 'Nom de votre bon cadeau'
])
->add('email', EmailType::class, [
'label' => 'Email'
$builder->add('message', TextareaType::class, [
'label' => 'Message personnalisé',
]);



Cargando…
Cancelar
Guardar