diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 6e75bde25..ed6d3131f 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -313,6 +313,7 @@ class ActivityType extends AbstractType 'button_add_label' => 'activity.Insert a document', 'button_remove_label' => 'activity.Remove a document', 'empty_collection_explain' => 'No documents', + 'entry_options' => ['has_title' => true], ]); } diff --git a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php index f9cb645f7..ebe25b9e6 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php @@ -17,6 +17,7 @@ use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\Extension\Core\Type\HiddenType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -64,12 +65,21 @@ class StoredObjectType extends AbstractType [$this, 'transformObject'], [$this, 'reverseTransformObject'] )); + + if ($options['has_title']) { + $builder + ->add('title', TextType::class); + } } public function configureOptions(OptionsResolver $resolver) { $resolver ->setDefault('data_class', StoredObject::class); + + $resolver + ->setDefault('has_title', false) + ->addAllowedValues('has_title', [true, false]); } public function getBlockPrefix()