Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

範囲外の日付を入力すると発生する不具合を修正しました。 #5576

Merged
merged 4 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Eccube/Form/Type/Admin/CalendarType.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_date_start',
Expand Down
4 changes: 4 additions & 0 deletions src/Eccube/Form/Type/Admin/CustomerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'value' => date('Y-m-d', strtotime('-1 day')),
'message' => 'form_error.select_is_future_or_now_date',
]),
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
])
->add('plain_password', RepeatedPasswordType::class, [
Expand Down
4 changes: 4 additions & 0 deletions src/Eccube/Form/Type/Admin/NewsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'years' => range($this->eccubeConfig['eccube_news_start_year'], date('Y') + 3),
'constraints' => [
new Assert\NotBlank(),
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
])
->add('title', TextType::class, [
Expand Down
4 changes: 4 additions & 0 deletions src/Eccube/Form/Type/Admin/OrderPdfType.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data' => new \DateTime(),
'constraints' => [
new Assert\NotBlank(),
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'data-target' => '#'.$this->getBlockPrefix().'_issue_date',
Expand Down
84 changes: 84 additions & 0 deletions src/Eccube/Form/Type/Admin/SearchCustomerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_birth_start',
Expand All @@ -115,6 +121,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_birth_end',
Expand Down Expand Up @@ -176,6 +188,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_date_start',
Expand All @@ -187,6 +205,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_start',
Expand All @@ -199,6 +223,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_date_end',
Expand All @@ -210,6 +240,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_end',
Expand All @@ -222,6 +258,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_date_start',
Expand All @@ -233,6 +275,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_start',
Expand All @@ -245,6 +293,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_date_end',
Expand All @@ -256,6 +310,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_end',
Expand All @@ -268,6 +328,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_last_buy_start',
Expand All @@ -279,6 +345,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_last_buy_datetime_start',
Expand All @@ -291,6 +363,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'input' => 'datetime',
'widget' => 'single_text',
'placeholder' => ['year' => '----', 'month' => '--', 'day' => '--'],
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_last_buy_end',
Expand All @@ -302,6 +380,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_last_buy_datetime_end',
Expand Down
12 changes: 12 additions & 0 deletions src/Eccube/Form/Type/Admin/SearchLoginHistoryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_start',
Expand All @@ -87,6 +93,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'constraints' => [
new Assert\Range([
'min'=> '0003-01-01',
'minMessage' => 'form_error.out_of_range',
]),
],
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_end',
Expand Down
Loading