1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This file is part of EC-CUBE |
4
|
|
|
* |
5
|
|
|
* Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved. |
6
|
|
|
* |
7
|
|
|
* http://www.lockon.co.jp/ |
8
|
|
|
* |
9
|
|
|
* This program is free software; you can redistribute it and/or |
10
|
|
|
* modify it under the terms of the GNU General Public License |
11
|
|
|
* as published by the Free Software Foundation; either version 2 |
12
|
|
|
* of the License, or (at your option) any later version. |
13
|
|
|
* |
14
|
|
|
* This program is distributed in the hope that it will be useful, |
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
|
|
|
* GNU General Public License for more details. |
18
|
|
|
* |
19
|
|
|
* You should have received a copy of the GNU General Public License |
20
|
|
|
* along with this program; if not, write to the Free Software |
21
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
|
25
|
|
|
namespace Eccube\Form\Type\Admin; |
26
|
|
|
|
27
|
|
|
use Symfony\Component\Form\AbstractType; |
28
|
|
|
use Symfony\Component\Form\Extension\Core\Type; |
29
|
|
|
use Symfony\Component\Form\FormBuilderInterface; |
30
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
31
|
|
|
|
32
|
|
|
class TradelawType extends AbstractType |
|
|
|
|
33
|
|
|
{ |
34
|
|
|
protected $config; |
35
|
|
|
|
36
|
663 |
|
public function __construct ($config) |
37
|
|
|
{ |
38
|
663 |
|
$this->config = $config; |
39
|
|
|
} |
40
|
|
|
|
41
|
23 |
|
public function buildForm(FormBuilderInterface $builder, array $options) |
|
|
|
|
42
|
|
|
{ |
43
|
|
|
$builder |
44
|
23 |
|
->add('law_company', 'text', array( |
45
|
23 |
|
'label' => '販売業者', |
46
|
|
|
'required' => true, |
47
|
|
|
'constraints' => array( |
48
|
23 |
|
new Assert\NotBlank(), |
49
|
|
|
), |
50
|
|
|
)) |
51
|
23 |
|
->add('law_manager', 'text', array( |
52
|
23 |
|
'label' => '運営責任者', |
53
|
|
|
'required' => true, |
54
|
|
|
'constraints' => array( |
55
|
23 |
|
new Assert\NotBlank(), |
56
|
|
|
), |
57
|
|
|
)) |
58
|
23 |
|
->add('law_zip', 'zip', array( |
59
|
23 |
|
'required' => true, |
60
|
|
|
)) |
61
|
23 |
|
->add('law_address', 'address', array( |
62
|
23 |
|
'label' => '所在地', |
63
|
|
|
'required' => true, |
64
|
|
|
'pref_name' => 'law_pref', |
65
|
|
|
'addr01_name' => 'law_addr01', |
66
|
|
|
'addr02_name' => 'law_addr02', |
67
|
|
|
)) |
68
|
23 |
|
->add('law_tel', 'tel', array( |
69
|
23 |
|
'label' => 'TEL', |
70
|
|
|
'required' => true, |
71
|
|
|
)) |
72
|
23 |
|
->add('law_fax', 'tel', array( |
73
|
23 |
|
'label' => 'FAX', |
74
|
|
|
'required' => false, |
75
|
|
|
)) |
76
|
23 |
|
->add('law_email', 'email', array( |
77
|
23 |
|
'label' => 'メールアドレス', |
78
|
|
|
'required' => true, |
79
|
|
|
'constraints' => array( |
80
|
23 |
|
new Assert\NotBlank(), |
81
|
23 |
|
new Assert\Email(array('strict' => true)), |
82
|
23 |
|
new Assert\Regex(array( |
83
|
23 |
|
'pattern' => '/^[[:graph:][:space:]]+$/i', |
84
|
|
|
'message' => 'form.type.graph.invalid', |
85
|
|
|
)), |
86
|
|
|
), |
87
|
|
|
)) |
88
|
23 |
|
->add('law_url', 'text', array( |
89
|
23 |
|
'label' => 'URL', |
90
|
|
|
'required' => true, |
91
|
|
|
'constraints' => array( |
92
|
23 |
|
new Assert\NotBlank(), |
93
|
23 |
|
new Assert\Url(), |
94
|
|
|
), |
95
|
|
|
)) |
96
|
23 |
|
->add('law_term01', 'textarea', array( |
97
|
23 |
|
'label' => '商品代金以外の必要料金', |
98
|
|
|
'required' => true, |
99
|
|
|
'constraints' => array( |
100
|
23 |
|
new Assert\NotBlank(), |
101
|
|
|
), |
102
|
|
|
)) |
103
|
23 |
|
->add('law_term02', 'textarea', array( |
104
|
23 |
|
'label' => '注文方法', |
105
|
|
|
'required' => true, |
106
|
|
|
'constraints' => array( |
107
|
23 |
|
new Assert\NotBlank(), |
108
|
|
|
), |
109
|
|
|
)) |
110
|
23 |
|
->add('law_term03', 'textarea', array( |
111
|
23 |
|
'label' => '支払方法', |
112
|
|
|
'required' => true, |
113
|
|
|
'constraints' => array( |
114
|
23 |
|
new Assert\NotBlank(), |
115
|
|
|
), |
116
|
|
|
)) |
117
|
23 |
|
->add('law_term04', 'textarea', array( |
118
|
23 |
|
'label' => '支払期限', |
119
|
|
|
'required' => true, |
120
|
|
|
'constraints' => array( |
121
|
23 |
|
new Assert\NotBlank(), |
122
|
|
|
), |
123
|
|
|
)) |
124
|
23 |
|
->add('law_term05', 'textarea', array( |
125
|
23 |
|
'label' => '引き渡し時期', |
126
|
|
|
'required' => true, |
127
|
|
|
'constraints' => array( |
128
|
23 |
|
new Assert\NotBlank(), |
129
|
|
|
), |
130
|
|
|
)) |
131
|
23 |
|
->add('law_term06', 'textarea', array( |
132
|
23 |
|
'label' => '返品・交換について', |
133
|
|
|
'required' => true, |
134
|
|
|
'constraints' => array( |
135
|
23 |
|
new Assert\NotBlank(), |
136
|
|
|
), |
137
|
|
|
)); |
138
|
|
|
} |
139
|
|
|
|
140
|
663 |
|
public function getName() |
|
|
|
|
141
|
|
|
{ |
142
|
663 |
|
return 'tradelaw'; |
143
|
|
|
} |
144
|
|
|
} |
145
|
|
|
|