Example #1
1
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('form.group_general', array('translation_domain' => 'CmfRoutingBundle'))->add('parent', Sf2CompatUtil::getFormTypeName('doctrine_phpcr_odm_tree'), array('choice_list' => array(), 'select_root_node' => true, 'root_node' => $this->routeRoot))->add('name', Sf2CompatUtil::getFormTypeName('text'))->end();
     if (null === $this->getParentFieldDescription()) {
         $formMapper->with('form.group_general', array('translation_domain' => 'CmfRoutingBundle'))->add('content', Sf2CompatUtil::getFormTypeName('doctrine_phpcr_odm_tree'), array('choice_list' => array(), 'required' => false, 'root_node' => $this->contentRoot))->end()->with('form.group_advanced', array('translation_domain' => 'CmfRoutingBundle'))->add('variablePattern', Sf2CompatUtil::getFormTypeName('text'), array('required' => false), array('help' => 'form.help_variable_pattern'))->add('defaults', Sf2CompatUtil::getFormTypeName('sonata_type_immutable_array'), array('keys' => $this->configureFieldsForDefaults($this->getSubject()->getDefaults())))->add('options', Sf2CompatUtil::getFormTypeName('sonata_type_immutable_array'), array('keys' => $this->configureFieldsForOptions($this->getSubject()->getOptions())), array('help' => 'form.help_options'))->end()->end();
     }
 }
Example #2
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('archer', array('class' => 'col-md-6'))->add('matricule', 'text')->add('firstname', 'text')->add('lastname', 'text')->add('birthday')->add('affiliatedSince')->add('category', EntityType::class, array('class' => 'BAArcheryBundle:Category', 'choice_label' => 'acronym', 'label' => 'Catégorie'))->add('isActif')->end()->with('Competition inscrit', array('class' => 'col-md-6'))->add('inscrit')->end();
     if (!$this->isChild()) {
         $formMapper->with('club', array('class' => 'col-md-6'))->add('club', EntityType::class, array('class' => 'BAArcheryBundle:Club', 'choice_label' => 'acronym', 'label' => 'Club'))->end();
     }
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     if ($this->hasProvider()) {
         $tabSettings = array('class' => 'col-md-4');
     } else {
         $tabSettings = array('class' => 'col-md-8');
     }
     $formMapper->with('tab.group.bruery_classification_tag_general', $tabSettings)->end();
     if ($this->hasProvider()) {
         $formMapper->with('tab.group.bruery_classification_tag_settings', array('class' => 'col-md-8'))->end();
     }
     $formMapper->with('tab.group.bruery_classification_tag_general')->add('name')->end();
     if ($this->hasSubject() && $this->getSubject()->getId()) {
         $formMapper->with('tab.group.bruery_classification_tag_general')->add('slug')->end();
     }
     $formMapper->with('tab.group.bruery_classification_tag_general')->add('enabled', null, array('required' => false))->end();
     if ($this->hasProvider()) {
         $instance = $this->getSubject();
         if ($instance && $instance->getId()) {
             $this->provider->load($instance);
             $this->provider->buildEditForm($formMapper);
         } else {
             $this->provider->buildCreateForm($formMapper);
         }
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('username')->add('email')->add('plainPassword', 'text', array('required' => false))->end();
     if (!$this->getSubject()->hasRole('ROLE_SUPER_ADMIN')) {
         $formMapper->with('Management')->add('roles', 'sonata_security_roles', array('expanded' => true, 'multiple' => true, 'required' => false))->add('locked', null, array('required' => false))->add('expired', null, array('required' => false))->add('enabled', null, array('required' => false))->add('credentialsExpired', null, array('required' => false))->end();
     }
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('tab_user', array('class' => 'col-md-8'))->add('username', 'text')->add('email', 'email')->add('licence', 'text', array('required' => false))->add('plainPassword', 'text', array('required' => !$this->getSubject() || is_null($this->getSubject()->getId())))->end()->with('tab_status', array('class' => 'col-md-4'))->add('enabled', 'checkbox', array('required' => false))->add('locked', 'checkbox', array('required' => false))->add('expired', 'checkbox', array('required' => false))->add('credentialsExpired', 'checkbox', array('required' => false))->end()->with('tab_roles', array('class' => 'col-md-12'))->add('roles', 'user_admin_roles')->end();
     if ($this->isGranted('ROLE_SUPER_ADMIN')) {
         $formMapper->with('tab_status')->add('newsletter', 'checkbox', array('required' => false))->end();
     }
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->isChild()) {
         $formMapper->with($this->trans('order.form.group_main_label', array(), 'SonataOrderBundle'))->add('customer', 'sonata_type_model_list')->end();
     }
     $formMapper->with($this->trans('order.form.group_main_label', array(), 'SonataOrderBundle'))->add('currency', 'sonata_currency')->add('locale', 'locale')->add('status', 'sonata_order_status', array('translation_domain' => 'SonataOrderBundle'))->add('paymentStatus', 'sonata_payment_transaction_status', array('translation_domain' => 'SonataPaymentBundle'))->add('deliveryStatus', 'sonata_product_delivery_status', array('translation_domain' => 'SonataDeliveryBundle'))->add('validatedAt')->end()->with($this->trans('order.form.group_billing_label', array(), 'SonataOrderBundle'), array('collapsed' => true))->add('billingName')->add('billingAddress1')->add('billingAddress2')->add('billingAddress3')->add('billingCity')->add('billingPostcode')->add('billingCountryCode', 'country')->add('billingFax')->add('billingEmail')->add('billingMobile')->end()->with($this->trans('order.form.group_shipping_label', array(), 'SonataOrderBundle'), array('collapsed' => true))->add('shippingName')->add('shippingAddress1')->add('shippingAddress2')->add('shippingAddress3')->add('shippingCity')->add('shippingPostcode')->add('shippingCountryCode', 'country')->add('shippingFax')->add('shippingEmail')->add('shippingMobile')->end();
 }
Example #7
0
 /**
  * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
  *
  * @return void
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $rubric = $this->getSubject();
     $formMapper->with('Rubric', array('class' => 'col-md-8'))->end();
     $formMapper->with('Attributes', array('class' => 'col-md-4'))->end();
     $this->addInformationBlock($formMapper);
     $formMapper->with('Rubric');
     $formMapper->add('title');
     if (!$rubric->isRoot()) {
         $formMapper->add('parent', 'rubricchoice', array('label' => 'Parent Rubric'))->add('path', 'slug_text', array('source_field' => 'title', 'usesource_title' => $this->trans('Use rubric title')))->setHelps(array('path' => 'Path used for building rubric url'));
     }
     $formMapper->add('abstract')->add('redirectUrl')->add('controllerName', 'modulechoice', array('label' => 'Choose module', 'required' => false, 'empty_value' => ' '));
     $formMapper->end();
     $formMapper->with('Attributes');
     $this->addMenuRelatedFields($rubric, $formMapper);
     if ($rubric->getModuleError()) {
         $formMapper->add('moduleError', 'genemu_plain', array('attr' => array('style' => 'color:red')));
     }
     $formMapper->end();
     if ($this->subject && $this->subject->getId()) {
         $url = $this->configurationPool->getContainer()->get('iphp.core.entity.router')->entitySiteUrl($this->subject);
         $formMapper->setHelps(['status' => '<a target="_blank" href="' . $url . '">' . $url . '</a>']);
     }
     $this->configureModuleFormFields($rubric, $formMapper);
 }
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('username')->add('email')->add('plainPassword', 'text', array('required' => !$this->getSubject() || is_null($this->getSubject()->getId())))->end()->with('Groups')->add('groups', 'sonata_type_model', array('required' => false, 'expanded' => true, 'multiple' => true))->end();
     if ($this->getSubject() && !$this->getSubject()->hasRole('ROLE_SUPER_ADMIN')) {
         $formMapper->with('Management')->add('realRoles', 'lyssal_security_roles', array('label' => 'form.label_roles', 'expanded' => true, 'multiple' => true, 'required' => false))->add('locked', null, array('required' => false))->add('expired', null, array('required' => false))->add('enabled', null, array('required' => false))->add('credentialsExpired', null, array('required' => false))->end();
     }
 }
Example #9
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('username')->add('email')->add('plainPassword', 'text', array('required' => false))->end();
     if (!$this->getSubject()->hasRole('ROLE_SUPER_ADMIN')) {
         $formMapper->with('Management')->add('roles', 'choice', array('expanded' => false, 'multiple' => true, 'required' => false, 'choices' => $this->getConfigurationPool()->getContainer()->get("bde.main.roles_provider")->getRoles()))->add('locked', null, array('required' => false))->add('expired', null, array('required' => false))->add('enabled', null, array('required' => false))->add('credentialsExpired', null, array('required' => false))->end();
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General', array('class' => 'col-md-6'))->add('name')->add('description', 'textarea', array('required' => false))->end()->with('Options', array('class' => 'col-md-6'))->add('position', 'integer', array('required' => false, 'data' => 0))->add('parent', 'sonata_category_selector', array('category' => $this->getSubject() ?: null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'required' => false))->end();
     if (interface_exists('Sonata\\MediaBundle\\Model\\MediaInterface')) {
         $formMapper->with('General')->add('media', 'sonata_type_model_list', array('required' => false), array('link_parameters' => array('provider' => 'sonata.media.provider.image', 'context' => 'sonata_category')))->end();
     }
 }
Example #11
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('form.group_general', array('translation_domain' => 'CmfRoutingBundle'))->add('parentDocument', TreeModelType::class, array('choice_list' => array(), 'select_root_node' => true, 'root_node' => $this->routeRoot))->add('name', TextType::class)->end();
     if (null === $this->getParentFieldDescription()) {
         $formMapper->with('form.group_general', array('translation_domain' => 'CmfRoutingBundle'))->add('content', TreeModelType::class, array('choice_list' => array(), 'required' => false, 'root_node' => $this->contentRoot))->end()->with('form.group_advanced', array('translation_domain' => 'CmfRoutingBundle'))->add('variablePattern', TextType::class, array('required' => false), array('help' => 'form.help_variable_pattern'))->add('defaults', ImmutableArrayType::class, array('keys' => $this->configureFieldsForDefaults($this->getSubject()->getDefaults())))->add('options', ImmutableArrayType::class, array('keys' => $this->configureFieldsForOptions($this->getSubject()->getOptions())), array('help' => 'form.help_options'))->end()->end();
     }
 }
Example #12
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->getSubject() || !$this->getSubject()->isInternal() && !$this->getSubject()->isError()) {
         $formMapper->with($this->trans('form_page.group_main_label'))->add('url', 'text', array('attr' => array('readonly' => 'readonly')))->end();
     }
     if ($this->hasSubject() && !$this->getSubject()->getId()) {
         $formMapper->with($this->trans('form_page.group_main_label'))->add('site', null, array('required' => true, 'read_only' => true))->end();
     }
     $formMapper->with($this->trans('form_page.group_main_label'))->add('name')->add('enabled', null, array('required' => false))->add('position')->end();
     if ($this->hasSubject() && !$this->getSubject()->isInternal()) {
         $formMapper->with($this->trans('form_page.group_main_label'))->add('type', 'sonata_page_type_choice', array('required' => false))->end();
     }
     $formMapper->with($this->trans('form_page.group_main_label'))->add('templateCode', 'sonata_page_template', array('required' => true))->add('parent', 'sonata_page_selector', array('page' => $this->getSubject() ?: null, 'site' => $this->getSubject() ? $this->getSubject()->getSite() : null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'required' => false), array('link_parameters' => array('siteId' => $this->getSubject() ? $this->getSubject()->getSite()->getId() : null)))->end();
     if (!$this->getSubject() || !$this->getSubject()->isDynamic()) {
         $formMapper->with($this->trans('form_page.group_main_label'))->add('pageAlias', null, array('required' => false))->add('target', 'sonata_page_selector', array('page' => $this->getSubject() ?: null, 'site' => $this->getSubject() ? $this->getSubject()->getSite() : null, 'model_manager' => $this->getModelManager(), 'class' => $this->getClass(), 'filter_choice' => array('request_method' => 'all'), 'required' => false), array('link_parameters' => array('siteId' => $this->getSubject() ? $this->getSubject()->getSite()->getId() : null)))->end();
     }
     if (!$this->getSubject() || !$this->getSubject()->isHybrid()) {
         $formMapper->with($this->trans('form_page.group_seo_label'))->add('slug', 'text', array('required' => false))->add('customUrl', 'text', array('required' => false))->end();
     }
     $formMapper->with($this->trans('form_page.group_seo_label'), array('collapsed' => true))->add('title', null, array('required' => false))->add('metaKeyword', 'textarea', array('required' => false))->add('metaDescription', 'textarea', array('required' => false))->end();
     if ($this->hasSubject() && !$this->getSubject()->isCms()) {
         $formMapper->with($this->trans('form_page.group_advanced_label'), array('collapsed' => true))->add('decorate', null, array('required' => false))->end();
     }
     $formMapper->with($this->trans('form_page.group_advanced_label'), array('collapsed' => true))->add('javascript', null, array('required' => false))->add('stylesheet', null, array('required' => false))->add('rawHeaders', null, array('required' => false))->end();
     $formMapper->setHelps(array('name' => $this->trans('help_page_name')));
 }
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('form.group_general')->add('parent', 'doctrine_phpcr_odm_tree', array('choice_list' => array(), 'select_root_node' => true, 'root_node' => $this->routeRoot))->add('name', 'text')->end();
     if (null === $this->getParentFieldDescription()) {
         $formMapper->with('form.group_general')->add('variablePattern', 'text', array('required' => false))->add('routeContent', 'doctrine_phpcr_odm_tree', array('choice_list' => array(), 'required' => false, 'root_node' => $this->contentRoot))->add('defaults', 'sonata_type_immutable_array', array('keys' => $this->configureFieldsForDefaults()))->end();
     }
 }
Example #14
0
 /**
  * {@inheritdoc}
  */
 public function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->isChild()) {
         $formMapper->with($this->trans('invoice.form.group_main_label', array(), $this->translationDomain))->add('customer', 'sonata_type_model_list')->end();
     }
     $formMapper->with($this->trans('invoice.form.group_main_label', array(), $this->translationDomain))->add('reference')->add('currency', 'sonata_currency')->add('status', 'sonata_invoice_status', array('translation_domain' => $this->translationDomain))->add('totalExcl')->add('totalInc')->end()->with($this->trans('invoice.form.group_billing_label', array(), $this->translationDomain), array('collapsed' => true))->add('name')->add('phone')->add('address1')->add('address2')->add('address3')->add('city')->add('postcode')->add('country', 'country')->add('fax')->add('email')->add('mobile')->end();
 }
Example #15
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $provider = $this->getPoolProvider($this->pool);
     if ($provider) {
         $tabSettings = array('class' => 'col-md-4');
     } else {
         $tabSettings = array('class' => 'col-md-8');
     }
     $formMapper->with('tab.group.bruery_classification_collection_general', $tabSettings)->end();
     if ($provider) {
         $formMapper->with('tab.group.bruery_classification_collection_settings', array('class' => 'col-md-8'))->end();
     }
     $formMapper->with('tab.group.bruery_classification_collection_general')->add('name')->add('description', 'textarea', array('required' => false, 'attr' => array('rows' => 8)))->add('enabled', null, array('required' => false))->end();
     if (interface_exists('Sonata\\MediaBundle\\Model\\MediaInterface')) {
         $formMapper->with('tab.group.bruery_classification_collection_general')->add('media', 'sonata_type_model_list', array('required' => false), array('link_parameters' => array('provider' => 'sonata.media.provider.image', 'context' => 'sonata_collection')))->end();
     }
     if ($provider) {
         $instance = $this->getSubject();
         if ($instance && $instance->getId()) {
             $provider->load($instance);
             $provider->buildEditForm($formMapper);
         } else {
             $provider->buildCreateForm($formMapper);
         }
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     // define group zoning
     $formMapper->with($this->trans('form_dashboard.group_main_label'), array('class' => 'col-md-12'))->end();
     $formMapper->with($this->trans('form_dashboard.group_main_label'))->add('name')->add('enabled', null, array('required' => false))->end();
     $formMapper->setHelps(array('name' => $this->trans('help_dashboard_name')));
 }
Example #17
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('Slide')->add('imageContent', 'sonata_type_model_list', [], ['link_parameters' => ['context' => 'default', 'provider' => 'sonata.media.provider.image']])->add('parentGallery', 'entity', ['class' => 'Imperiv\\Bundle\\GalleryBundle\\Entity\\GalleryPage'])->add('displayOrder', 'text', ['required' => false])->add('textContent', 'textarea', ['required' => false, 'attr' => ['class' => 'tinymce']])->end();
     if ($this->getSubject()->getTextContent() !== NULL) {
         $transparentZoneParameters = unserialize($this->getSubject()->getTransparentZoneParameters());
         $formMapper->with('Transparent Zone')->add('orientation', 'choice', ['choices' => [1 => 'Vertical', 2 => 'Horizontal'], 'data' => $transparentZoneParameters['orientation'], 'mapped' => false])->add('size', 'integer', ['label' => 'Height/Width', 'required' => false, 'data' => $transparentZoneParameters['size'], 'mapped' => false])->add('opacity', 'number', ['label' => 'Opacity', 'required' => false, 'data' => $transparentZoneParameters['opacity'], 'mapped' => false])->add('color', 'text', ['label' => 'Color', 'required' => false, 'attr' => ['class' => 'colorpicker'], 'data' => $transparentZoneParameters['color'], 'mapped' => false])->add('position', 'integer', ['label' => 'Position', 'required' => false, 'data' => $transparentZoneParameters['position'], 'mapped' => false])->add('closable', 'checkbox', ['label' => 'Closable', 'required' => false, 'data' => $transparentZoneParameters['closable'], 'mapped' => false])->end();
     }
 }
 /**
  * {@inheritDoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('form.group_general')->add('name', 'text')->add('label', 'text')->end();
     if (null === $this->getParentFieldDescription()) {
         // Add the choice for the node links "target"
         $formMapper->with('form.group_general')->add('linkType', 'choice_field_mask', array('choices' => array('route' => 'route', 'uri' => 'uri', 'content' => 'content'), 'map' => array('route' => array('route'), 'uri' => array('uri'), 'content' => array('content', 'doctrine_phpcr_odm_tree')), 'empty_value' => 'auto', 'required' => false))->add('route', 'text', array('required' => false))->add('uri', 'text', array('required' => false))->add('content', 'doctrine_phpcr_odm_tree', array('root_node' => $this->contentRoot, 'choice_list' => array(), 'required' => false))->end();
     }
 }
Example #19
0
 /**
  * Configure edit view
  *
  * @param FormMapper $formMapper
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('Projecte', array('class' => 'col-md-7'))->add('name', null, array('label' => 'Nom'))->add('description', null, array('label' => 'Descripció', 'attr' => array('style' => 'resize:vertical', 'rows' => 13)))->add('services', null, array('label' => 'Serveis', 'required' => false))->end()->with('Controls', array('class' => 'col-md-5'))->add('position', null, array('label' => 'Posició'))->add('enabled', null, array('label' => 'Actiu', 'required' => false))->end()->with('Traduccions', array('class' => 'col-md-7'))->add('translations', 'a2lix_translations_gedmo', array('required' => false, 'label' => ' ', 'translatable_class' => 'AppBundle\\Entity\\Translations\\ProjectTranslation', 'fields' => array('name' => array('label' => 'Nom', 'required' => false), 'description' => array('label' => 'Descripció', 'required' => false, 'attr' => array('style' => 'resize:vertical', 'rows' => 13)))))->end()->with('Imatge principal', array('class' => 'col-md-5'))->add('imageFile', 'file', array('label' => 'Arxiu', 'required' => false, 'help' => $this->getImageHelperFormMapperWithThumbnail()))->end();
     if ($this->id($this->getSubject())) {
         // only on edit mode, disable when creating new subjects
         $formMapper->with('Imatges addicionals', array('class' => 'col-md-7'))->add('images', 'sonata_type_collection', array('label' => ' ', 'required' => false, 'cascade_validation' => true), array('edit' => 'inline', 'inline' => 'table', 'sortable' => 'position'))->end();
     }
 }
Example #20
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('username')->add('email')->add('plainPassword', 'text', array('required' => false))->end()->with('Profile')->add('firstname', 'text', array('required' => false))->add('lastname', 'text', array('required' => false))->add('website', 'text', array('required' => false))->add('biography', 'text', array('required' => false))->end();
     if (!$this->getSubject()->hasRole('ROLE_SUPER_ADMIN')) {
         $formMapper->with('Management')->add('roles', 'sonata_security_roles', array('expanded' => true, 'multiple' => true, 'required' => false))->add('locked', null, array('required' => false))->add('expired', null, array('required' => false))->add('enabled', null, array('required' => false))->add('credentialsExpired', null, array('required' => false))->end();
     }
     $formMapper->with('Security')->add('token', null, array('required' => false))->add('twoStepVerificationCode', null, array('required' => false))->end();
 }
Example #21
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('username')->add('email')->add('plainPassword', 'text', array('required' => false))->end()->with('Groups')->add('groups', 'sonata_type_model', array('required' => false, 'expanded' => false, 'by_reference' => false, 'multiple' => true, 'compound' => false))->end()->with('Profile')->add('dateOfBirth', 'birthday', array('required' => false))->add('firstname', null, array('required' => false))->add('lastname', null, array('required' => false))->add('website', 'url', array('required' => false))->add('biography', 'text', array('required' => false))->add('gender', 'choice', array('choices' => array(UserInterface::GENDER_UNKNOWN => 'gender_unknown', UserInterface::GENDER_FEMALE => 'gender_female', UserInterface::GENDER_MAN => 'gender_male'), 'required' => true, 'translation_domain' => $this->getTranslationDomain()))->add('locale', 'locale', array('required' => false))->add('timezone', 'timezone', array('required' => false))->add('phone', null, array('required' => false))->end()->with('Social')->add('facebookUid', null, array('required' => false))->add('facebookName', null, array('required' => false))->add('twitterUid', null, array('required' => false))->add('twitterName', null, array('required' => false))->add('gplusUid', null, array('required' => false))->add('gplusName', null, array('required' => false))->end();
     if (is_object($this->getSubject()) && !$this->getSubject()->hasRole('ROLE_SUPER_ADMIN')) {
         $formMapper->with('Management')->add('realRoles', 'sonata_security_roles', array('expanded' => false, 'multiple' => true, 'required' => false))->add('locked', null, array('required' => false))->add('expired', null, array('required' => false))->add('enabled', null, array('required' => false))->add('credentialsExpired', null, array('required' => false))->end();
     }
     $formMapper->with('Security')->add('token', null, array('required' => false))->add('twoStepVerificationCode', null, array('required' => false))->end();
 }
 /**
  * @param FormMapper $formMapper
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     /* filtrar solo CFF */
     $factura = new \Bundles\FacturaBundle\Entity\FacFactura();
     $qry_factura = $this->modelManager->getEntityManager($factura)->createQuery("SELECT s FROM \\Bundles\\FacturaBundle\\Entity\\FacFactura s WHERE s.estado != 'ANULADA' AND s.idTipofactura = 2");
     $formMapper->with('Nota_credito', array('class' => 'col-md-8'))->end()->with('Detalle', array('class' => 'col-md-12'))->end()->with('Resumen', array('class' => 'col-md-4'))->end();
     $formMapper->with('Nota_credito')->add('numero', null, array('attr' => array('style' => 'width:300px', 'maxlength' => '25')))->add('fecha', null, array('label' => 'Fecha nota de crédito', 'widget' => 'single_text', 'format' => 'dd/MM/y', 'attr' => array('class' => 'bootstrap-datepicker', 'style' => 'width:200px', 'maxlength' => '25')))->add('idFactura', 'sonata_type_model', array('empty_value' => '...ninguno...', 'label' => 'CFF (seleccione CCF)', 'required' => TRUE, 'btn_add' => FALSE, 'query' => $qry_factura, 'attr' => array('style' => 'width:300px')))->add('idMotivoNotacredito', null, array('label' => 'Motivo de la nota de crédito', 'attr' => array('style' => 'width:300px')))->end()->with('Detalle')->add('notacreditoDetalle', 'sonata_type_collection', array('label' => 'Elemento'), array('edit' => 'inline', 'inline' => 'table'))->end()->with('Resumen')->add('sumas', null, array('attr' => array('style' => 'width:300px', 'maxlength' => '25')))->add('iva', null, array('attr' => array('style' => 'width:300px', 'maxlength' => '25')))->add('ivaRetenido', null, array('attr' => array('style' => 'width:300px', 'maxlength' => '25')))->add('subtotal', null, array('attr' => array('style' => 'width:300px', 'maxlength' => '25')))->add('ventaTotal', null, array('attr' => array('style' => 'width:300px', 'maxlength' => '25')));
 }
Example #23
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General', ['class' => 'col-md-6'])->end()->with('Language', ['class' => 'col-md-6'])->end()->with('Contenu', ['class' => 'col-md-12'])->end()->with('Seo', ['class' => 'col-md-12'])->end();
     $formMapper->with('General')->add('permalink', null, ['required' => true, 'help' => $this->trans('zapoyok_content.form.help.permalink', [], 'admin')])->add('title', null, ['required' => true])->end()->with('Language')->add('language', 'choice', ['choices' => $this->languages])->add('translations', 'sonata_type_collection', ['cascade_validation' => true, 'label' => $this->trans('zapoyok_content.page.translations.label', [], 'admin')], ['edit' => 'inline', 'inline' => 'table', 'sortable' => 'position', 'link_parameters' => ['context' => 'default'], 'admin_code' => 'zapoyok_content.admin.translation'])->end()->with('Contenu')->add('message', 'ckeditor', ['label' => false])->end()->with('Seo')->add('name', null, ['required' => false])->add('meta_keywords', 'text', ['required' => false])->add('meta_description', 'text', ['required' => false])->end();
     if ($this->getSubject()->getLocked()) {
         $formMapper->add('permalink', null, ['required' => true, 'help' => $this->trans('zapoyok_content.form.help.permalink.locked', [], 'admin'), 'attr' => ['readonly' => true]]);
     }
 }
Example #24
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $esFusionado = $this->getSubject()->getEsFusionado();
     $formMapper->with($this->getTranslator()->trans('datos_generales'), array('collapsed' => false))->add('nombre', null, array('label' => $this->getTranslator()->trans('nombre')))->add('descripcion', null, array('label' => $this->getTranslator()->trans('descripcion'), 'required' => false))->end();
     if ($esFusionado == false) {
         $formMapper->with($this->getTranslator()->trans('datos_generales'), array('collapsed' => false))->add('esCatalogo', null, array('label' => $this->getTranslator()->trans('es_catalogo')))->end()->with($this->getTranslator()->trans('origen_datos_sql'), array('collapsed' => true))->add('conexion', null, array('label' => $this->getTranslator()->trans('nombre_conexion'), 'required' => false))->add('sentenciaSql', null, array('label' => $this->getTranslator()->trans('sentencia_sql'), 'required' => false))->end()->with($this->getTranslator()->trans('origen_datos_archivo'), array('collapsed' => true))->add('archivoNombre', null, array('label' => $this->getTranslator()->trans('archivo_asociado'), 'required' => false, 'read_only' => true))->add('file', 'file', array('label' => $this->getTranslator()->trans('subir_nuevo_archivo'), 'required' => false))->end();
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('username')->add('email')->add('plainPassword', 'text', array('required' => !$this->getSubject() || is_null($this->getSubject()->getId())))->end()->with('Groups')->add('groups', 'sonata_type_model', array('required' => false, 'expanded' => true, 'multiple' => true))->end()->with('Profile')->add('dateOfBirth', 'birthday', array('required' => false))->add('firstname', null, array('required' => false))->add('lastname', null, array('required' => false))->add('gender', 'sonata_user_gender', array('required' => true, 'translation_domain' => $this->getTranslationDomain()))->add('phone', null, array('required' => false))->end();
     if ($this->getSubject() && !$this->getSubject()->hasRole('ROLE_SUPER_ADMIN')) {
         $formMapper->with('Management')->add('realRoles', 'sonata_security_roles', array('label' => 'form.label_roles', 'expanded' => true, 'multiple' => true, 'required' => false))->add('locked', null, array('required' => false))->add('expired', null, array('required' => false))->add('enabled', null, array('required' => false))->add('credentialsExpired', null, array('required' => false))->end();
     }
     $formMapper->with('Security')->add('token', null, array('required' => false))->add('twoStepVerificationCode', null, array('required' => false))->end();
 }
Example #26
0
 protected function configureFormFields(FormMapper $formMapper)
 {
     $esFusionado = $this->getSubject()->getEsFusionado();
     $formMapper->with($this->getTranslator()->trans('datos_generales'), array('collapsed' => false))->add('nombre', null, array('label' => $this->getTranslator()->trans('nombre')))->add('descripcion', null, array('label' => $this->getTranslator()->trans('descripcion'), 'required' => false))->add('periodicidad', null, array('label' => 'Periodicidad de actualización'))->add('ventana', null, array('attr' => array('label' => 'Ventana de actualización', 'min' => '0')))->add('fechaCorte', null, array('attr' => array('label' => 'Dia de Corte', 'min' => '1', 'max' => '30')))->add('actualizacionIncremental', null, array('attr' => array('label' => '¿Es actualización incremental?')))->end();
     if ($esFusionado == false) {
         $formMapper->with($this->getTranslator()->trans('datos_generales'), array('collapsed' => false))->add('esCatalogo', null, array('label' => $this->getTranslator()->trans('es_catalogo')))->end()->with($this->getTranslator()->trans('origen_datos_sql'), array('collapsed' => true))->add('conexiones', null, array('label' => $this->getTranslator()->trans('nombre_conexion'), 'required' => false, 'expanded' => true))->add('sentenciaSql', null, array('label' => $this->getTranslator()->trans('sentencia_sql'), 'required' => false, 'attr' => array('rows' => 7, 'cols' => 50)))->end()->with($this->getTranslator()->trans('origen_datos_archivo'), array('collapsed' => true))->add('archivoNombre', null, array('label' => $this->getTranslator()->trans('archivo_asociado'), 'required' => false, 'read_only' => true))->add('file', 'file', array('label' => $this->getTranslator()->trans('subir_nuevo_archivo'), 'required' => false))->end();
     }
 }
Example #27
0
 protected function configureFormFields(FormMapper $form)
 {
     $form->with('Page')->add('title')->add('content', 'ckeditor', ['config_name' => 'page'])->end();
     if ($this->getSubject()) {
         $form->with('Route')->add('slug', null, ['required' => false])->end();
     }
     $form->with('SEO')->add('seoMetaData', 'sonata_type_model_list', ['required' => false])->end();
     $form->setHelps(['slug' => "If you leave empty it will be automatically created from the page title.<br/><br/> <b>Example:</b> <br/> <b>Title</b>: This article <br/> <b>Slug</b>: this-article"]);
 }
Example #28
0
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     // define group zoning
     $formMapper->with($this->trans('group_comment'), array('class' => 'col-md-6'))->end()->with($this->trans('group_general'), array('class' => 'col-md-6'))->end();
     if (!$this->isChild()) {
         $formMapper->with($this->trans('group_general'))->add('post', 'sonata_type_model_list')->end();
     }
     $formMapper->with($this->trans('group_general'))->add('name')->add('email')->add('url', null, array('required' => false))->end()->with($this->trans('group_comment'))->add('status', 'sonata_news_comment_status', array('expanded' => true, 'multiple' => false))->add('message', null, array('attr' => array('rows' => 6)))->end();
 }
Example #29
0
 /**
  * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
  */
 public function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with($this->trans('address.form.group_advanced_label', array(), 'SonataCustomerBundle'))->add('type', 'choice', array('choices' => Address::getTypesList(), 'translation_domain' => 'SonataCustomerBundle'))->add('current', null, array('required' => false))->add('name')->end();
     $formMapper->with($this->trans('address.form.group_contact_label', array(), 'SonataCustomerBundle'))->add('firstname')->add('lastname')->add('phone')->end();
     if (!$this->isChild()) {
         $formMapper->with($this->trans('address.form.group_contact_label', array(), 'SonataCustomerBundle'))->add('customer', 'sonata_type_model_list')->end();
     }
     $formMapper->with($this->trans('address.form.group_address_label', array(), 'SonataCustomerBundle'))->add('address1')->add('address2')->add('address3')->add('postcode')->add('city')->add('countryCode', 'country')->end();
 }
 /**
  * {@inheritdoc}
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('Informations obligatoires')->add('username', null, array('label' => 'Matricule', 'attr' => array('maxlength' => '6'), 'required' => true, 'error_bubbling' => true))->add('lastname', null, array('required' => true))->add('firstname', null, array('required' => true))->add('gender', 'sonata_user_gender', array('translation_domain' => $this->getTranslationDomain()))->add('dateOfBirth', 'sonata_type_date_picker', array('widget' => 'single_text', 'format' => 'dd-MM-yyyy'))->add('enabled', null, array('required' => false))->end()->with('Fonction & service')->add('fonction', 'sonata_type_model_list', array('label' => 'Fonction', 'required' => true, 'error_bubbling' => true))->add('service', 'sonata_type_model_list', array('label' => 'Service référent', 'required' => true, 'error_bubbling' => true))->add('services', null, array('required' => false, 'expanded' => true, 'multiple' => true, 'label' => 'Services secondaires'))->end()->with('Dates arrivée & départ')->add('date_entree', 'sonata_type_date_picker', array('label' => 'Date d\'entrée', 'placeholder' => '', 'widget' => 'single_text', 'format' => 'dd-MM-yyyy', 'required' => true))->add('date_sortie', 'sonata_type_date_picker', array('label' => 'Date de sortie', 'placeholder' => '', 'widget' => 'single_text', 'format' => 'dd-MM-yyyy', 'required' => false))->add('raison_sortie', 'choice', array('choices' => array('' => '', 'MATERNITE' => 'MATERNITE', 'RETRAITE' => 'RETRAITE', 'ARRET MALADIE' => 'ARRET MALADIE', 'FIN DE CONTRAT' => 'FIN DE CONTRAT'), 'label' => 'Raison de sortie', 'required' => false))->end()->with('Contact')->add('email', null, array('required' => false))->add('phone', null, array('required' => false))->add('adresse', null, array('label' => 'Adresse'))->add('zip', null, array('label' => 'Code postal', 'attr' => array('maxlength' => '5')))->add('ville', null, array('label' => 'Ville'))->end()->end();
     $roles = array('ROLE_SONATA_USER_ADMIN_USER_ADMIN' => 'Utilisateurs', 'ROLE_SONATA_CHARTE_ADMIN' => 'Chartes', 'ROLE_SONATA_TYPE_ADMIN' => 'Type tenu et materiel', 'ROLE_SONATA_TENUE_ADMIN' => 'Tenues', 'ROLE_SONATA_MATERIEL_ADMIN' => 'Materiel', 'ROLE_SONATA_PHOTO_ADMIN' => 'Photos', 'ROLE_SONATA_INFOMAIL_ADMIN' => 'Infomails', 'ROLE_STATS_CHARTES' => 'Statistiques chartes');
     // ['Utilisateurs', 'Fonctions', 'Services', 'Chartes', 'Tenues', 'Matériels', 'Infomails', 'Photos'];
     if ($this->getSubject() && !$this->getSubject()->hasRole('ROLE_ADMIN') || !$this->getSubject()->hasRole('ROLE_RH')) {
         $formMapper->with('Permissions')->add('Roles', 'choice', ['label' => 'Accès à la gestion de :', 'choices' => $roles, 'multiple' => true, 'expanded' => true, 'required' => false])->end();
     }
 }