From: Raphaƫl Gertz Date: Wed, 7 Jul 2021 15:22:38 +0000 (+0200) Subject: Add calendar form X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/03955b35edac32b5160ae181ced27ecf47c29273 Add calendar form --- diff --git a/Form/CalendarType.php b/Form/CalendarType.php new file mode 100644 index 0000000..be5fcab --- /dev/null +++ b/Form/CalendarType.php @@ -0,0 +1,41 @@ +add('calendar', TextType::class, ['label' => 'Calendar id', 'attr' => ['placeholder' => 'Your calendar id'], 'constraints' => [new NotBlank(['message' => 'Please provide your calendar id'])]]) + //TODO: validate prefix against [a-v0-9]{5,} + //XXX: see https://developers.google.com/calendar/api/v3/reference/events/insert#id + ->add('prefix', TextType::class, ['label' => 'Prefix', 'attr' => ['placeholder' => 'Your prefix'], 'constraints' => [new NotBlank(['message' => 'Please provide your prefix'])]]) + ->add('project', TextType::class, ['label' => 'Project id', 'attr' => ['placeholder' => 'Your project id'], 'required' => false]) + ->add('client', TextType::class, ['label' => 'Client id', 'attr' => ['placeholder' => 'Your client id'], 'required' => false]) + ->add('secret', TextType::class, ['label' => 'Client secret', 'attr' => ['placeholder' => 'Your client secret'], 'required' => false]) + ->add('submit', SubmitType::class, ['label' => 'Send', 'attr' => ['class' => 'submit']]); + } + + /** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) { + $resolver->setDefaults(['error_bubbling' => true]); + } + + /** + * {@inheritdoc} + */ + public function getName() { + return 'calendar_form'; + } +}