This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
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\FormBuilderInterface; |
||
29 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; |
||
30 | use Symfony\Component\Validator\Constraints as Assert; |
||
31 | |||
32 | class ShopMasterType extends AbstractType |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
33 | { |
||
34 | 286 | public function __construct($config) |
|
35 | { |
||
36 | 286 | $this->config = $config; |
|
37 | 286 | } |
|
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | 2 | public function buildForm(FormBuilderInterface $builder, array $options) |
|
43 | { |
||
44 | 2 | $config = $this->config; |
|
45 | |||
46 | $builder |
||
47 | ->add('company_name', 'text', array( |
||
0 ignored issues
–
show
|
|||
48 | 2 | 'label' => '会社名', |
|
49 | 2 | 'required' => false, |
|
50 | 'constraints' => array( |
||
51 | new Assert\Length(array( |
||
52 | 2 | 'max' => $config['stext_len'], |
|
53 | )), |
||
54 | 2 | ) |
|
55 | )) |
||
56 | ->add('shop_name', 'text', array( |
||
0 ignored issues
–
show
|
|||
57 | 2 | 'label' => '店名', |
|
58 | 2 | 'required' => true, |
|
59 | 'constraints' => array( |
||
60 | new Assert\NotBlank(), |
||
61 | new Assert\Length(array( |
||
62 | 'max' => $config['stext_len'], |
||
63 | )), |
||
64 | ) |
||
65 | 2 | )) |
|
66 | ->add('shop_name_eng', 'text', array( |
||
0 ignored issues
–
show
|
|||
67 | 2 | 'label' => '店名(英語表記)', |
|
68 | 'required' => false, |
||
69 | 'constraints' => array( |
||
70 | 2 | new Assert\Length(array( |
|
71 | 2 | 'max' => $config['mtext_len'], |
|
72 | )), |
||
73 | new Assert\Regex(array( |
||
74 | 'pattern' => '/^[[:graph:][:space:]]+$/i' |
||
75 | 2 | )), |
|
76 | ) |
||
77 | 2 | )) |
|
78 | ->add('zip', 'zip', array( |
||
79 | 'required' => false, |
||
80 | 2 | )) |
|
81 | 2 | ->add('address', 'address', array( |
|
82 | 'required' => false, |
||
83 | )) |
||
84 | 2 | ->add('tel', 'tel', array( |
|
85 | 'required' => false, |
||
86 | )) |
||
87 | ->add('fax', 'tel', array( |
||
88 | 'required' => false, |
||
89 | )) |
||
90 | 2 | ->add('business_hour', 'text', array( |
|
0 ignored issues
–
show
|
|||
91 | 'label' => '店舗営業時間', |
||
92 | 'required' => false, |
||
93 | 2 | 'constraints' => array( |
|
0 ignored issues
–
show
|
|||
94 | 2 | new Assert\Length(array( |
|
95 | 'max' => $config['stext_len'], |
||
96 | )) |
||
97 | 2 | ) |
|
98 | )) |
||
99 | ->add('email01', 'email', array( |
||
100 | 'label' => '送信元メールアドレス(From)', |
||
101 | 'required' => false, |
||
102 | 2 | 'constraints' => array( |
|
103 | new Assert\NotBlank(), |
||
104 | new Assert\Email(array('strict' => true)), |
||
105 | ), |
||
106 | )) |
||
107 | ->add('email02', 'email', array( |
||
108 | 'label' => '問い合わせ受付メールアドレス(From, ReplyTo)', |
||
109 | 'required' => false, |
||
110 | 'constraints' => array( |
||
111 | new Assert\NotBlank(), |
||
112 | new Assert\Email(array('strict' => true)), |
||
113 | ), |
||
114 | )) |
||
115 | ->add('email03', 'email', array( |
||
116 | 'label' => '返信受付メールアドレス(ReplyTo)', |
||
117 | 2 | 'required' => false, |
|
118 | 2 | 'constraints' => array( |
|
119 | new Assert\NotBlank(), |
||
120 | new Assert\Email(array('strict' => true)), |
||
121 | 2 | ), |
|
122 | )) |
||
123 | 2 | ->add('email04', 'email', array( |
|
124 | 'label' => '送信エラー受付メールアドレス(ReturnPath)', |
||
125 | 'required' => false, |
||
126 | 2 | 'constraints' => array( |
|
127 | 2 | new Assert\NotBlank(), |
|
128 | new Assert\Email(array('strict' => true)), |
||
129 | ), |
||
130 | )) |
||
131 | 2 | ->add('good_traded', 'textarea', array( |
|
132 | 'label' => '取り扱い商品', |
||
133 | 'required' => false, |
||
134 | 2 | 'constraints' => array( |
|
135 | 2 | new Assert\Length(array( |
|
136 | 'max' => $config['lltext_len'], |
||
137 | )), |
||
138 | ), |
||
139 | 2 | )) |
|
140 | ->add('message', 'textarea', array( |
||
141 | 'label' => 'メッセージ', |
||
142 | 2 | 'required' => false, |
|
143 | 2 | 'constraints' => array( |
|
144 | new Assert\Length(array( |
||
145 | 'max' => $config['lltext_len'], |
||
146 | )), |
||
147 | 2 | ), |
|
148 | )) |
||
149 | |||
150 | 2 | // 送料設定 |
|
151 | 2 | ->add('delivery_free_amount', 'money', array( |
|
152 | 'label' => '送料無料条件(金額)', |
||
153 | 'required' => false, |
||
154 | 'currency' => 'JPY', |
||
155 | 2 | 'precision' => 0, |
|
156 | 'scale' => 0, |
||
157 | 'grouping' => true, |
||
158 | 2 | 'constraints' => array( |
|
159 | 2 | new Assert\Length(array( |
|
160 | 'max' => $config['price_len'], |
||
161 | )), |
||
162 | 2 | new Assert\Regex(array( |
|
163 | 'pattern' => "/^\d+$/u", |
||
164 | 2 | 'message' => 'form.type.numeric.invalid' |
|
165 | )), |
||
166 | ), |
||
167 | 2 | )) |
|
168 | 2 | ->add('delivery_free_quantity', 'integer', array( |
|
169 | 'label' => '送料無料条件(数量)', |
||
170 | 'required' => false, |
||
171 | 2 | 'constraints' => array( |
|
172 | new Assert\Regex(array( |
||
173 | 2 | 'pattern' => "/^\d+$/u", |
|
174 | 'message' => 'form.type.numeric.invalid' |
||
175 | )), |
||
176 | ), |
||
177 | )) |
||
178 | 2 | ->add('option_product_delivery_fee', 'choice', array( |
|
179 | 2 | 'label' => '商品ごとの送料設定を有効にする', |
|
180 | 2 | 'choices' => array( |
|
181 | 2 | '0' => '無効', |
|
182 | '1' => '有効', |
||
183 | ), |
||
184 | 2 | 'expanded' => true, |
|
185 | 'multiple' => false, |
||
186 | )) |
||
187 | ->add('option_multiple_shipping', 'choice', array( |
||
188 | 'label' => '複数配送を有効にする', |
||
189 | 'choices' => array( |
||
190 | 2 | '0' => '無効', |
|
191 | '1' => '有効', |
||
192 | ), |
||
193 | 2 | 'expanded' => true, |
|
194 | 2 | 'multiple' => false, |
|
195 | )) |
||
196 | |||
197 | // 会員設定 |
||
198 | ->add('option_customer_activate', 'choice', array( |
||
199 | 'label' => '仮会員を有効にする', |
||
200 | 2 | 'choices' => array( |
|
201 | '0' => '無効', |
||
202 | '1' => '有効', |
||
203 | ), |
||
204 | 'expanded' => true, |
||
205 | 'multiple' => false, |
||
206 | )) |
||
207 | ->add('option_mypage_order_status_display', 'choice', array( |
||
208 | 'label' => 'マイページに注文状況を表示する', |
||
209 | 'choices' => array( |
||
210 | '0' => '無効', |
||
211 | '1' => '有効', |
||
212 | ), |
||
213 | 'expanded' => true, |
||
214 | 'multiple' => false, |
||
215 | )) |
||
216 | ->add('option_remember_me', 'choice', array( |
||
217 | 'label' => '自動ログイン機能を有効にする', |
||
218 | 'choices' => array( |
||
219 | '0' => '無効', |
||
220 | '1' => '有効', |
||
221 | ), |
||
222 | 'expanded' => true, |
||
223 | 'multiple' => false, |
||
224 | )) |
||
225 | ->add('option_favorite_product', 'choice', array( |
||
226 | 'label' => 'お気に入り商品機能を利用する', |
||
227 | 'choices' => array( |
||
228 | '0' => '無効', |
||
229 | '1' => '有効', |
||
230 | ), |
||
231 | 'expanded' => true, |
||
232 | 'multiple' => false, |
||
233 | )) |
||
234 | |||
235 | // 商品設定 |
||
236 | ->add('nostock_hidden', 'choice', array( |
||
237 | 'label' => '在庫切れ商品を非表示にする', |
||
238 | 'choices' => array( |
||
239 | '0' => '無効', |
||
240 | '1' => '有効', |
||
241 | ), |
||
242 | 'expanded' => true, |
||
243 | 'multiple' => false, |
||
244 | )) |
||
245 | |||
246 | // 地図設定 |
||
247 | ->add('latitude', 'number', array( |
||
248 | 'label' => '緯度', |
||
249 | 'required' => false, |
||
250 | 'precision' => 6, |
||
251 | 'constraints' => array( |
||
252 | new Assert\Regex(array( |
||
253 | 'pattern' => '/^-?([0-8]?[0-9]\.?[0-9]{0,6}|90\.?0{0,6})$/', |
||
254 | 'message' => 'admin.shop.latitude.invalid')) |
||
255 | ) |
||
256 | )) |
||
257 | ->add('longitude', 'number', array( |
||
258 | 'label' => '経度', |
||
259 | 'required' => false, |
||
260 | 'precision' => 6, |
||
261 | 'constraints' => array( |
||
262 | new Assert\Regex(array( |
||
263 | 'pattern' => '/^-?((1?[0-7]?|[0-9]?)[0-9]\.?[0-9]{0,6}|180\.?0{0,6})$/', |
||
264 | 'message' => 'admin.shop.longitude.invalid')) |
||
265 | ), |
||
266 | )) |
||
267 | ; |
||
268 | |||
269 | $builder->add( |
||
270 | $builder |
||
271 | ->create('company_kana', 'text', array( |
||
272 | 2 | 'label' => '会社名(フリガナ)', |
|
273 | 2 | 'required' => false, |
|
274 | 2 | 'constraints' => array( |
|
275 | new Assert\Regex(array( |
||
276 | 'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u", |
||
277 | )), |
||
278 | new Assert\Length(array( |
||
279 | 2 | 'max' => $config['stext_len'], |
|
280 | )), |
||
281 | ), |
||
282 | 2 | )) |
|
283 | 2 | ->addEventSubscriber(new \Eccube\EventListener\ConvertKanaListener('CV')) |
|
284 | 2 | ); |
|
285 | |||
286 | $builder->add( |
||
287 | $builder |
||
288 | ->create('shop_kana', 'text', array( |
||
0 ignored issues
–
show
|
|||
289 | 2 | 'label' => '店名(フリガナ)', |
|
290 | 'required' => false, |
||
291 | 'constraints' => array( |
||
292 | new Assert\Length(array( |
||
293 | 2 | 'max' => $config['stext_len'], |
|
294 | )), |
||
295 | new Assert\Regex(array( |
||
296 | 'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u", |
||
297 | )), |
||
298 | ) |
||
299 | )) |
||
300 | ->addEventSubscriber(new \Eccube\EventListener\ConvertKanaListener('CV')) |
||
301 | ); |
||
302 | } |
||
303 | |||
304 | /** |
||
305 | * {@inheritdoc} |
||
306 | */ |
||
307 | public function setDefaultOptions(OptionsResolverInterface $resolver) |
||
308 | { |
||
309 | 284 | $resolver->setDefaults(array( |
|
310 | 'data_class' => 'Eccube\Entity\BaseInfo', |
||
311 | 284 | )); |
|
312 | } |
||
313 | |||
314 | /** |
||
315 | * {@inheritdoc} |
||
316 | */ |
||
317 | public function getName() |
||
318 | { |
||
319 | return 'shop_master'; |
||
320 | } |
||
321 | } |
||
322 |