67 lines
2.1 KiB
PHP
67 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Form;
|
|
|
|
use Symfony\Component\Form\AbstractType;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
|
|
|
class CronType extends AbstractType
|
|
{
|
|
/**
|
|
* @param FormBuilderInterface $builder
|
|
* @param array $options
|
|
*/
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
{
|
|
$builder
|
|
->add('submit', SubmitType::class, [
|
|
"label" => "Valider",
|
|
"attr" => array("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' => array("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"
|
|
])
|
|
;
|
|
}
|
|
|
|
/**
|
|
* @param OptionsResolver $resolver
|
|
*/
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => 'App\Entity\Cron',
|
|
'mode' => 'string'
|
|
]);
|
|
}
|
|
}
|