Example #1
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getEntityManager();
     //    $locale = $this->getConfigurationPool()->getContainer()->get('request_stack')->getCurrentRequest()->getLocale();
     //    $formMapper->add('translations', 'a2lix_translations');
     /*    $formMapper
                 ->add('productCategory', 'entity', array(
                   'required' => true,
                   'class' => "AppBundle\Entity\ProductCategory",
                   'query_builder' => function(EntityRepository $er) use ($locale) {
                     return $er->createQueryBuilder('u')
                       ->join('u.translations', 'ctr')
                       ->where('ctr.locale = :locale')
                       ->orderBy('ctr.name', 'asc')
                       ->setParameter('locale',$locale)
                       ;
                   },
                 ));
           */
     $formMapper->setAdminCode("app.partner");
     $formMapper->tab('general')->with('options', array('class' => 'col-md-2'))->add('active', null, array('required' => false), array('admin-code' => 'app.partner'))->add('company', null, array('required' => false))->add('customer', null, array('required' => false, 'attr' => array('class' => 'selling')))->add('supplier', null, array('required' => false, 'attr' => array('class' => 'purchase')))->add('isEmployee', null, array('required' => false, 'attr' => array('class' => 'employee')))->end()->with('name.and.address', array('class' => 'col-md-5'))->add('address', 'text', array('required' => false, 'label' => false, 'mapped' => false, 'attr' => array('class' => 'geocomplete')))->add('name', null, array('attr' => array('data-geo' => 'name')))->add('parent', null, array('label' => 'Company'))->add('addressType', 'choice', array('required' => false, 'choices' => Partner::getAddressTypeChoices()))->add('street', null, array('attr' => array('class' => 'street')))->add('street2', null, array('required' => false, 'attr' => array('class' => 'street2')))->add('zip', null, array('attr' => array('data-geo' => 'postal_code')))->add('city', null, array('attr' => array('data-geo' => 'locality')))->add('state', null, array('attr' => array('data-geo' => 'administrative_area_level_1')))->add('country', 'country', array('label' => 'country', 'attr' => array('class' => 'country')))->end()->with('further.information', array('class' => 'col-md-5'))->add('language', 'locale', array('preferred_choices' => array('de_CH')))->add('phone', null, array('required' => false, 'attr' => array('data-geo' => 'international_phone_number')))->add('fax', null, array('required' => false))->add('mobile', null, array('required' => false))->add('email', null, array('required' => false))->add('website', null, array('required' => false, 'attr' => array('data-geo' => 'website')))->add('optOut', null, array('required' => false))->add('partnerCategory')->end()->end()->tab('selling')->with('selling')->add('deliveryMethod', 'sonata_type_model')->add('creditLimit', null, array('required' => false))->end()->end()->tab('purchase')->with('selling')->add('debitLimit', null, array('required' => false))->end()->end()->tab('employee')->with('employee')->add('employee', 'sonata_type_admin', array('required' => false, 'btn_add' => false, 'btn_delete' => false), array('admin_code' => 'app.employee'))->end()->end()->tab('comments')->with('comments')->add('comment', null, array('required' => false, 'label' => false))->end()->end();
 }
Example #2
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->setAdminCode("app.supplier");
     $formMapper->tab('general')->with('options', array('class' => 'col-md-2'))->add('active', null, array('required' => false))->add('company', null, array('required' => false))->add('customer', null, array('required' => false, 'attr' => array('class' => 'selling')))->add('supplier', null, array('required' => false, 'attr' => array('class' => 'purchase')))->end()->with('name.and.address', array('class' => 'col-md-5'))->add('address', 'text', array('required' => false, 'label' => false, 'mapped' => false, 'attr' => array('class' => 'geocomplete')))->add('name', null, array('attr' => array('data-geo' => 'name')))->add('parent', null, array('label' => 'Company'))->add('addressType', 'choice', array('required' => false, 'choices' => Partner::getAddressTypeChoices()))->add('street', null, array('attr' => array('class' => 'street')))->add('street2', null, array('required' => false, 'attr' => array('class' => 'street2')))->add('zip', null, array('attr' => array('data-geo' => 'postal_code')))->add('city', null, array('attr' => array('data-geo' => 'locality')))->add('state', null, array('attr' => array('data-geo' => 'administrative_area_level_1')))->add('country', 'country', array('label' => 'country', 'attr' => array('class' => 'country')))->end()->with('further.information', array('class' => 'col-md-5'))->add('language', 'locale', array('preferred_choices' => array('de_CH')))->add('phone', null, array('required' => false, 'attr' => array('data-geo' => 'international_phone_number')))->add('fax', null, array('required' => false))->add('mobile', null, array('required' => false))->add('email', null, array('required' => false))->add('website', null, array('required' => false, 'attr' => array('data-geo' => 'website')))->add('optOut', null, array('required' => false))->add('partnerCategory')->end()->end()->tab('selling')->with('selling')->add('deliveryMethod', 'sonata_type_model')->add('creditLimit', null, array('required' => false))->end()->end()->tab('purchase')->with('selling')->add('debitLimit', null, array('required' => false))->end()->end()->tab('comments')->with('comments')->add('comment', null, array('required' => false, 'label' => false))->end()->end();
 }