60 lines
1.8 KiB
PHP
Executable File
60 lines
1.8 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Form;
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
|
|
class CronType extends AbstractType
|
|
{
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
{
|
|
$builder
|
|
->add('submit', SubmitType::class, [
|
|
'label' => 'Valider',
|
|
'attr' => ['class' => 'btn btn-success'],
|
|
])
|
|
|
|
->add('command', TextType::class, [
|
|
'label' => 'Commande',
|
|
'disabled' => true,
|
|
])
|
|
|
|
->add('jsonargument', TextType::class, [
|
|
'label' => 'Argument Commande au format json',
|
|
'disabled' => true,
|
|
])
|
|
|
|
->add('statut', ChoiceType::class, [
|
|
'label' => 'Statut',
|
|
'choices' => ['Désactivé' => -1, 'KO' => '0', 'OK' => '1'],
|
|
])
|
|
|
|
->add('repeatinterval', IntegerType::class, [
|
|
'label' => 'Interval en seconde entre deux éxécution',
|
|
])
|
|
|
|
->add('nextexecdate', DatetimeType::class, [
|
|
'label' => 'Prochaine exécution',
|
|
'widget' => 'single_text',
|
|
'html5' => true,
|
|
'input_format' => 'd/m/Y H:i',
|
|
])
|
|
;
|
|
}
|
|
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => 'App\Entity\Cron',
|
|
'mode' => 'string',
|
|
]);
|
|
}
|
|
}
|