app/Customize/Form/Type/Front/OrderFormType.php line 31

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Form\Type\Front;
  13. use Eccube\Common\EccubeConfig;
  14. use Eccube\Form\Type\AddressType;
  15. use Eccube\Form\Type\KanaType;
  16. use Eccube\Form\Type\PhoneNumberType;
  17. use Eccube\Form\Type\PostalType;
  18. use Eccube\Form\Validator\Email;
  19. use Symfony\Component\Form\AbstractType;
  20. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  21. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  22. use Symfony\Component\Form\FormBuilderInterface;
  23. use Symfony\Component\Validator\Constraints as Assert;
  24. use Symfony\Component\Form\Extension\Core\Type\TextType;
  25. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  26. use Customize\Form\Type\OrderDetailsBlockType;
  27. class OrderFormType extends AbstractType
  28. {
  29.     /**
  30.      * @var EccubeConfig
  31.      */
  32.     protected $eccubeConfig;
  33.     /**
  34.      * ContactType constructor.
  35.      *
  36.      * @param EccubeConfig $eccubeConfig
  37.      */
  38.     public function __construct(EccubeConfig $eccubeConfig)
  39.     {
  40.         $this->eccubeConfig $eccubeConfig;
  41.     }
  42.     /**
  43.      * {@inheritdoc}
  44.      */
  45.     public function buildForm(FormBuilderInterface $builder, array $options)
  46.     {
  47.         $builder
  48.             ->add('company'TextType::class, [
  49.                 'required' => true,
  50.                 'constraints' => [
  51.                     new Assert\NotBlank(),
  52.                 ],
  53.             ])
  54.             ->add('name'TextType::class, [
  55.                 'required' => true,
  56.                 'constraints' => [
  57.                     new Assert\NotBlank(),
  58.                 ],
  59.             ])
  60.             ->add('postal_code'PostalType::class, [
  61.                 'required' => true,
  62.             ])
  63.             ->add('address'AddressType::class, [
  64.                 'required' => true,
  65.             ])
  66.             ->add('phone_number'PhoneNumberType::class, [
  67.                 'required' => true,
  68.             ])
  69.             ->add('fax'TextType::class, [
  70.                 'required' => false,
  71.             ])
  72.             ->add('email'EmailType::class, [
  73.                 'constraints' => [
  74.                     new Assert\NotBlank(),
  75.                     new Email(nullnull$this->eccubeConfig['eccube_rfc_email_check'] ? 'strict' null),
  76.                 ],
  77.             ])
  78.             ->add('type'ChoiceType::class, [
  79.               'required' => false,
  80.               'choices'  => [
  81.                     '1.婦人服'     => '1.婦人服',
  82.                     '2.紳士服'     => '2.紳士服',
  83.                     '3.衣料'      => '3.衣料',
  84.                     '4.子供服'     => '4.子供服',
  85.                     '5.洋品店'     => '5.洋品店',
  86.                     '6.ブティック'   => '6.ブティック',
  87.                     '7.呉服'      => '7.呉服',
  88.                     '8.スポーツ'    => '8.スポーツ',
  89.                     '9.ギフト'     => '9.ギフト',
  90.                     '10.観光旅館' => '10.観光旅館',
  91.                     '11.雑貨'     => '11.雑貨',
  92.                     '12.飲食店'    => '12.飲食店',
  93.                     '13.寝装寝具' => '13.寝装寝具',
  94.                     '14.エステ'    => '14.エステ',
  95.                     '15.美容室'    => '15.美容室',
  96.                     '16.化粧品'    => '16.化粧品',
  97.                     '17.百貨店'    => '17.百貨店',
  98.                     '18.医療関係' => '18.医療関係',
  99.                     '19.組合'     => '19.組合',
  100.                     '20.企画'     => '20.企画',
  101.                     '21.デザイン'   => '21.デザイン',
  102.                     '22.ブライダル'  => '22.ブライダル',
  103.                     '23.ジュエリー'  => '23.ジュエリー',
  104.                     '24.ビデオ店'   => '24.ビデオ店',
  105.                     '25.学校'     => '25.学校',
  106.                     '26.ロータリ'   => '26.ロータリ',
  107.                     '27.造園'     => '27.造園',
  108.                     '28.石材'     => '28.石材',
  109.                     '29.木材'     => '29.木材',
  110.                     '30.運送'     => '30.運送',
  111.                     '31.工務店'   => '31.工務店',
  112.                     '32.鉄工所'   => '32.鉄工所',
  113.                     '33.建設'     => '33.建設',
  114.                     '34.かわら'    => '34.かわら',
  115.                     '35.重機'     => '35.重機',
  116.                     '36.農機'     => '36.農機',
  117.                     '37.製麺業者'   => '37.製麺業者',
  118.                     '38.果実生産者' => '38.果実生産者',
  119.                     '39.その他'     => '39.その他',
  120.                     '98個人'       => '98個人',
  121.               ],
  122.               'placeholder' => '選択してください',
  123.             ])
  124.             ->add('etc'TextType::class, [
  125.                 'required' => false,
  126.             ])
  127.             ->add('memo'TextareaType::class, [
  128.                 'required' => false,
  129.                 'data' => "○プリント希望で新規・改版のお客様は原稿の送付方法を選択ください。
  130.  ※当てはまらないものは削除してください
  131.   1.データをメールで後ほど添付(store@lemanze.com)
  132.     ・データ種類 :(拡張子をご記入ください)
  133.     ・作成アプリケーションソフト :(illustrator等)
  134.     ・作成OS種類 : Win or  Mac
  135.   2.FAXにて送信します(FAX:0875-73-5587)
  136.   3.郵送または運送便にて送付します
  137. ○その他ご質問等ございましたらお書きください",
  138.             ])
  139.             ->add('order_detail_block'OrderDetailsBlockType::class, [
  140.                 'required' => false,
  141.             ]);
  142.     }
  143.     /**
  144.      * {@inheritdoc}
  145.      */
  146.     public function getBlockPrefix()
  147.     {
  148.         return 'orderform';
  149.     }
  150. }