Skip to content

Commit

Permalink
Merge pull request #4619 from okazy/feat/datetime-search
Browse files Browse the repository at this point in the history
管理画面の検索機能をDateTimeTypeに対応
  • Loading branch information
Kiyotaka Oku authored Jul 21, 2020
2 parents 08412ca + dbcc5fc commit 75f2e1b
Show file tree
Hide file tree
Showing 17 changed files with 922 additions and 327 deletions.
73 changes: 73 additions & 0 deletions src/Eccube/Form/Type/Admin/SearchCustomerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Symfony\Component\Form\Extension\Core\Type\BirthdayType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
Expand Down Expand Up @@ -183,6 +184,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('create_datetime_start', DateTimeType::class, [
'label' => 'admin.common.create_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('create_date_end', DateType::class, [
'label' => 'admin.common.create_date__end',
'required' => false,
Expand All @@ -196,6 +209,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('create_datetime_end', DateTimeType::class, [
'label' => 'admin.common.create_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
->add('update_date_start', DateType::class, [
'label' => 'admin.common.update_date__start',
'required' => false,
Expand All @@ -209,6 +234,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('update_datetime_start', DateTimeType::class, [
'label' => 'admin.common.update_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('update_date_end', DateType::class, [
'label' => 'admin.common.update_date__end',
'required' => false,
Expand All @@ -222,6 +259,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('update_datetime_end', DateTimeType::class, [
'label' => 'admin.common.update_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
->add('last_buy_start', DateType::class, [
'label' => 'admin.order.last_buy_date__start',
'required' => false,
Expand All @@ -235,6 +284,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('last_buy_datetime_start', DateTimeType::class, [
'label' => 'admin.order.last_buy_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_last_buy_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('last_buy_end', DateType::class, [
'label' => 'admin.order.last_buy_date__end',
'required' => false,
Expand All @@ -248,6 +309,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('last_buy_datetime_end', DateTimeType::class, [
'label' => 'admin.order.last_buy_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_last_buy_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
;
}

Expand Down
97 changes: 97 additions & 0 deletions src/Eccube/Form/Type/Admin/SearchOrderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;
Expand Down Expand Up @@ -128,6 +129,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('order_datetime_start', DateTimeType::class, [
'label' => 'admin.order.order_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_order_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('order_date_end', DateType::class, [
'label' => 'admin.order.order_date__end',
'required' => false,
Expand All @@ -141,6 +154,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('order_datetime_end', DateTimeType::class, [
'label' => 'admin.order.order_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_order_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
->add('payment_date_start', DateType::class, [
'label' => 'admin.order.payment_date__start',
'required' => false,
Expand All @@ -154,6 +179,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('payment_datetime_start', DateTimeType::class, [
'label' => 'admin.order.payment_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_payment_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('payment_date_end', DateType::class, [
'label' => 'admin.order.payment_date__end',
'required' => false,
Expand All @@ -167,6 +204,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('payment_datetime_end', DateTimeType::class, [
'label' => 'admin.order.payment_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_payment_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
->add('update_date_start', DateType::class, [
'label' => 'admin.common.update_date__start',
'required' => false,
Expand All @@ -180,6 +229,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('update_datetime_start', DateTimeType::class, [
'label' => 'admin.common.update_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('update_date_end', DateType::class, [
'label' => 'admin.common.update_date__end',
'required' => false,
Expand All @@ -193,6 +254,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('update_datetime_end', DateTimeType::class, [
'label' => 'admin.common.update_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
->add('shipping_delivery_date_start', DateType::class, [
'label' => 'admin.order.delivery_date__start',
'required' => false,
Expand All @@ -206,6 +279,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('shipping_delivery_datetime_start', DateTimeType::class, [
'label' => 'admin.order.delivery_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_shipping_delivery_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('shipping_delivery_date_end', DateType::class, [
'label' => 'admin.order.delivery_date__end',
'required' => false,
Expand All @@ -219,6 +304,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('shipping_delivery_datetime_end', DateTimeType::class, [
'label' => 'admin.order.delivery_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_shipping_delivery_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
->add('payment_total_start', PriceType::class, [
'label' => 'admin.order.purchase_price__start',
'required' => false,
Expand Down
49 changes: 49 additions & 0 deletions src/Eccube/Form/Type/Admin/SearchProductType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

Expand Down Expand Up @@ -104,6 +105,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('create_datetime_start', DateTimeType::class, [
'label' => 'admin.common.create_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('create_date_end', DateType::class, [
'label' => 'admin.common.create_date__end',
'required' => false,
Expand All @@ -117,6 +130,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('create_datetime_end', DateTimeType::class, [
'label' => 'admin.common.create_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_create_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
->add('update_date_start', DateType::class, [
'label' => 'admin.common.update_date__start',
'required' => false,
Expand All @@ -130,6 +155,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('update_datetime_start', DateTimeType::class, [
'label' => 'admin.common.update_date__start',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_start',
'data-toggle' => 'datetimepicker',
],
])
->add('update_date_end', DateType::class, [
'label' => 'admin.common.update_date__end',
'required' => false,
Expand All @@ -143,6 +180,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'data-toggle' => 'datetimepicker',
],
])
->add('update_datetime_end', DateTimeType::class, [
'label' => 'admin.common.update_date__end',
'required' => false,
'input' => 'datetime',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd HH:mm:ss',
'attr' => [
'class' => 'datetimepicker-input',
'data-target' => '#'.$this->getBlockPrefix().'_update_datetime_end',
'data-toggle' => 'datetimepicker',
],
])
;
}

Expand Down
Loading

0 comments on commit 75f2e1b

Please sign in to comment.