<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Customize\Form\Type\Front;
use Eccube\Common\EccubeConfig;
use Eccube\Form\Type\AddressType;
use Eccube\Form\Type\KanaType;
use Eccube\Form\Type\PhoneNumberType;
use Eccube\Form\Type\PostalType;
use Eccube\Form\Validator\Email;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Customize\Form\Type\OrderDetailsBlockType;
class OrderFormType extends AbstractType
{
/**
* @var EccubeConfig
*/
protected $eccubeConfig;
/**
* ContactType constructor.
*
* @param EccubeConfig $eccubeConfig
*/
public function __construct(EccubeConfig $eccubeConfig)
{
$this->eccubeConfig = $eccubeConfig;
}
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('company', TextType::class, [
'required' => true,
'constraints' => [
new Assert\NotBlank(),
],
])
->add('name', TextType::class, [
'required' => true,
'constraints' => [
new Assert\NotBlank(),
],
])
->add('postal_code', PostalType::class, [
'required' => true,
])
->add('address', AddressType::class, [
'required' => true,
])
->add('phone_number', PhoneNumberType::class, [
'required' => true,
])
->add('fax', TextType::class, [
'required' => false,
])
->add('email', EmailType::class, [
'constraints' => [
new Assert\NotBlank(),
new Email(null, null, $this->eccubeConfig['eccube_rfc_email_check'] ? 'strict' : null),
],
])
->add('type', ChoiceType::class, [
'required' => false,
'choices' => [
'1.婦人服' => '1.婦人服',
'2.紳士服' => '2.紳士服',
'3.衣料' => '3.衣料',
'4.子供服' => '4.子供服',
'5.洋品店' => '5.洋品店',
'6.ブティック' => '6.ブティック',
'7.呉服' => '7.呉服',
'8.スポーツ' => '8.スポーツ',
'9.ギフト' => '9.ギフト',
'10.観光旅館' => '10.観光旅館',
'11.雑貨' => '11.雑貨',
'12.飲食店' => '12.飲食店',
'13.寝装寝具' => '13.寝装寝具',
'14.エステ' => '14.エステ',
'15.美容室' => '15.美容室',
'16.化粧品' => '16.化粧品',
'17.百貨店' => '17.百貨店',
'18.医療関係' => '18.医療関係',
'19.組合' => '19.組合',
'20.企画' => '20.企画',
'21.デザイン' => '21.デザイン',
'22.ブライダル' => '22.ブライダル',
'23.ジュエリー' => '23.ジュエリー',
'24.ビデオ店' => '24.ビデオ店',
'25.学校' => '25.学校',
'26.ロータリ' => '26.ロータリ',
'27.造園' => '27.造園',
'28.石材' => '28.石材',
'29.木材' => '29.木材',
'30.運送' => '30.運送',
'31.工務店' => '31.工務店',
'32.鉄工所' => '32.鉄工所',
'33.建設' => '33.建設',
'34.かわら' => '34.かわら',
'35.重機' => '35.重機',
'36.農機' => '36.農機',
'37.製麺業者' => '37.製麺業者',
'38.果実生産者' => '38.果実生産者',
'39.その他' => '39.その他',
'98個人' => '98個人',
],
'placeholder' => '選択してください',
])
->add('etc', TextType::class, [
'required' => false,
])
->add('memo', TextareaType::class, [
'required' => false,
'data' => "○プリント希望で新規・改版のお客様は原稿の送付方法を選択ください。
※当てはまらないものは削除してください
1.データをメールで後ほど添付(store@lemanze.com)
・データ種類 :(拡張子をご記入ください)
・作成アプリケーションソフト :(illustrator等)
・作成OS種類 : Win or Mac
2.FAXにて送信します(FAX:0875-73-5587)
3.郵送または運送便にて送付します
○その他ご質問等ございましたらお書きください",
])
->add('order_detail_block', OrderDetailsBlockType::class, [
'required' => false,
]);
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'orderform';
}
}