Skip to content

Commit

Permalink
Merge pull request EC-CUBE#1788 from izayoi256/issue/1766
Browse files Browse the repository at this point in the history
フリガナ項目でカナ変換を行なうよう変更
  • Loading branch information
chihiro-adachi authored Oct 17, 2016
2 parents f8b6ca6 + 97ca49c commit 851875c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 36 deletions.
23 changes: 14 additions & 9 deletions src/Eccube/Form/Type/Admin/SearchOrderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('name', 'text', array(
'required' => false,
))
->add('kana', 'text', array(
'required' => false,
'constraints' => array(
new Assert\Regex(array(
'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u",
'message' => 'form.type.admin.notkanastyle',
)),
),
))
->add('email', 'email', array(
'required' => false,
))
Expand Down Expand Up @@ -169,6 +160,20 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
))
;

$builder->add(
$builder
->create('kana', 'text', array(
'required' => false,
'constraints' => array(
new Assert\Regex(array(
'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u",
'message' => 'form.type.admin.notkanastyle',
)),
),
))
->addEventSubscriber(new \Eccube\EventListener\ConvertKanaListener('CV'))
);
}

/**
Expand Down
61 changes: 34 additions & 27 deletions src/Eccube/Form/Type/Admin/ShopMasterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
)),
)
))
->add('company_kana', 'text', array(
'label' => '会社名(フリガナ)',
'required' => false,
'constraints' => array(
// todo カナへの変換
new Assert\Regex(array(
'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u",
)),
new Assert\Length(array(
'max' => $config['stext_len'],
)),
),
))
->add('shop_name', 'text', array(
'label' => '店名',
'required' => true,
Expand All @@ -76,19 +63,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
)),
)
))
->add('shop_kana', 'text', array(
'label' => '店名(フリガナ)',
'required' => false,
'constraints' => array(
new Assert\Length(array(
'max' => $config['stext_len'],
)),
// todo カナへの変換
new Assert\Regex(array(
'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u",
)),
)
))
->add('shop_name_eng', 'text', array(
'label' => '店名(英語表記)',
'required' => false,
Expand Down Expand Up @@ -288,8 +262,41 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'message' => 'admin.shop.longitude.invalid'))
),
))

;

$builder->add(
$builder
->create('company_kana', 'text', array(
'label' => '会社名(フリガナ)',
'required' => false,
'constraints' => array(
new Assert\Regex(array(
'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u",
)),
new Assert\Length(array(
'max' => $config['stext_len'],
)),
),
))
->addEventSubscriber(new \Eccube\EventListener\ConvertKanaListener('CV'))
);

$builder->add(
$builder
->create('shop_kana', 'text', array(
'label' => '店名(フリガナ)',
'required' => false,
'constraints' => array(
new Assert\Length(array(
'max' => $config['stext_len'],
)),
new Assert\Regex(array(
'pattern' => "/^[ァ-ヶヲ-゚ー]+$/u",
)),
)
))
->addEventSubscriber(new \Eccube\EventListener\ConvertKanaListener('CV'))
);
}

/**
Expand Down

0 comments on commit 851875c

Please sign in to comment.