|
|
|
|
|
|
|
|
|
|
|
<?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 |
|
|
|
|
|
]); |
|
|
|
|
|
} |
|
|
|
|
|
} |