Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', 'text', ['required' => true])->add('entity', 'orocrm_marketing_list_contact_information_entity_choice', ['required' => true])->add('description', 'textarea', ['required' => false]);
     // TODO: remove this listener after full support of manual marketing lists CRM-1878
     $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
         /** @var MarketingList $marketingList */
         $marketingList = $event->getData();
         $form = $event->getForm();
         if ($marketingList && $marketingList->getId() && $marketingList->isManual()) {
             $qb = function (EntityRepository $er) {
                 return $er->createQueryBuilder('mlt')->andWhere('mlt.name = :manualTypeName')->setParameter('manualTypeName', MarketingListTypeEntity::TYPE_MANUAL);
             };
         } else {
             $qb = function (EntityRepository $er) {
                 return $er->createQueryBuilder('mlt')->andWhere('mlt.name != :manualTypeName')->setParameter('manualTypeName', MarketingListTypeEntity::TYPE_MANUAL)->addOrderBy('mlt.name', 'ASC');
             };
         }
         $form->add('type', 'entity', ['class' => 'OroCRMMarketingListBundle:MarketingListType', 'property' => 'label', 'required' => true, 'empty_value' => 'orocrm.marketinglist.form.choose_marketing_list_type', 'query_builder' => $qb]);
     });
     parent::buildForm($builder, $options);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', 'text', array('required' => true))->add('entity', 'oro_report_entity_choice', array('required' => true))->add('type', 'entity', array('class' => 'OroReportBundle:ReportType', 'property' => 'label', 'required' => true, 'empty_value' => 'oro.report.form.choose_report_type'))->add('hasChart', 'checkbox', array('mapped' => false, 'required' => false))->add('chartOptions', 'oro_report_chart', array('required' => true))->add('description', 'textarea', array('required' => false));
     parent::buildForm($builder, $options);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', 'text', ['required' => true])->add('entity', 'oro_segment_entity_choice', ['required' => true])->add('type', 'entity', ['class' => 'OroSegmentBundle:SegmentType', 'property' => 'label', 'required' => true, 'empty_value' => 'oro.segment.form.choose_segment_type'])->add('description', 'textarea', ['required' => false]);
     parent::buildForm($builder, $options);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('name', 'text', ['required' => true])->add('entity', 'orocrm_marketing_list_contact_information_entity_choice', ['required' => true])->add('type', 'entity', ['class' => 'OroCRMMarketingListBundle:MarketingListType', 'property' => 'label', 'required' => true, 'empty_value' => 'orocrm.marketinglist.form.choose_marketing_list_type'])->add('description', 'textarea', ['required' => false]);
     parent::buildForm($builder, $options);
 }