/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $countries = $this->get('country.repository')->all();
     $defaultCountry = $this->get('shop.context.front')->getCurrentScope()->getDefaultCountry();
     $billingAddress = $form->addChild($this->getElement('nested_fieldset', ['name' => 'billingAddress', 'label' => $this->trans('address.heading.billing_address')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.firstName', 'label' => $this->trans('client.label.first_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.lastName', 'label' => $this->trans('client.label.last_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.street', 'label' => $this->trans('address.label.street')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.streetNo', 'label' => $this->trans('address.label.street_no')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.flatNo', 'label' => $this->trans('address.label.flat_no')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.postCode', 'label' => $this->trans('address.label.post_code')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.province', 'label' => $this->trans('address.label.province')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.city', 'label' => $this->trans('address.label.city')]));
     $billingAddress->addChild($this->getElement('select', ['name' => 'billingAddress.country', 'label' => $this->trans('address.label.country'), 'options' => $countries, 'default' => $defaultCountry]));
     $form->addChild($this->getElement('checkbox', ['name' => 'copyAddress', 'label' => $this->trans('address.label.copy_address')]));
     $shippingAddress = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shippingAddress', 'label' => $this->trans('address.heading.shipping_address')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.firstName', 'label' => $this->trans('client.label.first_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.lastName', 'label' => $this->trans('client.label.last_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.street', 'label' => $this->trans('address.label.street')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.streetNo', 'label' => $this->trans('address.label.street_no')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.flatNo', 'label' => $this->trans('address.label.flat_no')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.postCode', 'label' => $this->trans('address.label.post_code')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.province', 'label' => $this->trans('address.label.province')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.city', 'label' => $this->trans('address.label.city')]));
     $shippingAddress->addChild($this->getElement('select', ['name' => 'shippingAddress.country', 'label' => $this->trans('address.label.country'), 'options' => $countries, 'default' => $defaultCountry]));
     $contactDetails = $form->addChild($this->getElement('nested_fieldset', ['name' => 'contactDetails', 'label' => $this->trans('contact_details.heading.details')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.phone', 'label' => $this->trans('contact_details.label.phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.secondaryPhone', 'label' => $this->trans('contact_details.label.secondary_phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.email', 'label' => $this->trans('contact_details.label.email')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $form->addChild($this->getElement('text_area', ['name' => 'comment', 'rows' => 5, 'cols' => 20, 'label' => $this->trans('order.comment.label')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('image', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data'), 'datagrid' => $this->get('media.datagrid')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $form->addChild($this->getElement('text_field', ['name' => '_username', 'label' => $this->trans('common.label.email')]));
     $form->addChild($this->getElement('password', ['name' => '_password', 'label' => $this->trans('common.label.password')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'code', 'label' => $this->trans('currency.code.label'), 'options' => $this->repository->getCurrenciesToSelect()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $form->addChild($this->getElement('text_field', ['name' => 'phone', 'label' => $this->trans('client.label.phone')]));
     $form->addChild($this->getElement('text_field', ['name' => 'secondaryPhone', 'label' => $this->trans('client.label.secondary_phone')]));
     $form->addChild($this->getElement('text_field', ['name' => 'email', 'label' => $this->trans('client.label.email')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'general_settings', 'label' => $this->trans('form.fieldset.required_data')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('availability.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 8
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $unitForm)
 {
     $unitRequiredData = $unitForm->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $unitTranslationData = $unitRequiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product.repository'))]));
     $unitTranslationData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name')]));
     $unitForm->addFilter($this->getFilter('no_code'));
     $unitForm->addFilter($this->getFilter('trim'));
     $unitForm->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('fieldset.required_data.label')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('order_status_group.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('order_status_group.label.name')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 10
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.label.required')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'code', 'label' => $this->trans('locale.label.code'), 'options' => $this->get('locale.repository')->getLocaleNames()]));
     $requiredData->addChild($this->getElement('select', ['name' => 'currency', 'label' => $this->trans('locale.label.currency'), 'options' => $this->get('currency.collection')->getSelect(['value_key' => 'id', 'label_key' => 'code', 'order_by' => 'code']), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('currency.repository'))]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 11
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'folder', 'label' => $this->trans('theme.label.folder'), 'comment' => $this->trans('theme.comment.folder'), 'options' => $this->getFolderDirectories()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'identifier', 'label' => $this->trans('dictionary.label.identifier')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('dictionary.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'value', 'label' => $this->trans('dictionary.label.value')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 13
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('news.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'topic', 'label' => $this->trans('news.label.topic')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'summary', 'label' => $this->trans('news.label.summary')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'content', 'label' => $this->trans('news.label.content')]));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'discount', 'label' => $this->trans('client_group.discount.label'), 'comment' => $this->trans('client_group.discount.comment'), 'suffix' => '%', 'filters' => [$this->getFilter('comma_to_dot_changer')]]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('client_group.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('client_group.name.label')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 15
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $cart = $this->cartProvider->getCurrentCart();
     $shippingMethod = $form->addChild($this->getElement('radio_group', ['name' => 'shippingMethodCost', 'label' => $this->trans('cart.shipping_method.label'), 'options' => [], 'transformer' => $this->getRepositoryTransformer('entity', $this->get('shipping_method_cost.repository'))]));
     $this->addShippingOptions($shippingMethod, $cart);
     $paymentMethod = $form->addChild($this->getElement('radio_group', ['name' => 'paymentMethod', 'label' => $this->trans('cart.payment_method.label'), 'options' => [], 'transformer' => $this->getRepositoryTransformer('entity', $this->get('payment_method.repository'))]));
     $this->addPaymentOptions($paymentMethod, $cart);
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $groupData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'group_data', 'class' => 'group-data', 'label' => $this->trans('attribute_group.label.group')]));
     $languageData = $groupData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('admin.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('attribute_group.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('attribute_group.label.name')]));
     $attributeData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'attribute_data', 'class' => 'attribute-data', 'label' => $this->trans('attribute_group.label.attributes')]));
     $attributeData->addChild($this->getElement('attribute_editor', ['name' => 'attributes', 'label' => $this->trans('attribute_group.label.attributes'), 'set' => $this->getParam('id'), 'delete_attribute_route' => 'admin.attribute.delete', 'rename_attribute_route' => 'admin.attribute.edit', 'rename_attribute_value_route' => 'admin.attribute_value.edit', 'attributes' => $this->get('attribute.repository')->findAll(), 'transformer' => $this->getRepositoryTransformer('attribute_collection', $this->get('attribute.repository'))]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 17
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'firstName', 'label' => $this->trans('user.label.first_name')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'lastName', 'label' => $this->trans('user.label.last_name')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'username', 'label' => $this->trans('user.label.username')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'email', 'label' => $this->trans('user.label.email')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $form->addChild($this->getElement('tip', ['tip' => '<p>Default credentials:<br/><br/>
                 <strong>Username:</strong> admin<br/>
                 <strong>Login:</strong> admin<br/>
             </p>']));
     $form->addChild($this->getElement('text_field', ['name' => '_username', 'label' => $this->trans('user.label.username')]));
     $form->addChild($this->getElement('password', ['name' => '_password', 'label' => $this->trans('user.label.password')]));
     $form->addChild($this->getElement('submit', ['name' => 'log_in', 'label' => $this->trans('user.button.log_in')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $form->addChild($this->getElement('text_field', ['name' => 'firstName', 'label' => $this->trans('client.label.first_name')]));
     $form->addChild($this->getElement('text_field', ['name' => 'lastName', 'label' => $this->trans('client.label.last_name')]));
     $form->addChild($this->getElement('text_field', ['name' => 'phone', 'label' => $this->trans('contact_details.label.phone')]));
     $form->addChild($this->getElement('text_field', ['name' => 'email', 'label' => $this->trans('contact_details.label.email')]));
     $form->addChild($this->getElement('password', ['name' => 'password', 'label' => $this->trans('common.label.password')]));
     $form->addChild($this->getElement('checkbox', ['name' => 'conditionsAccepted', 'label' => $this->trans('client.label.accept_conditions')]));
     $form->addChild($this->getElement('checkbox', ['name' => 'newsletterAccepted', 'label' => $this->trans('client.label.accept_newsletter')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('order_status.label.enabled'), 'comment' => $this->trans('order_status.comment.enabled'), 'default' => 1]));
     $orderStatusGroupSelectBuilder = new SelectBuilder($this->get('order_status_group.dataset'));
     $orderStatusGroups = $orderStatusGroupSelectBuilder->getItems();
     $requiredData->addChild($this->getElement('select', ['name' => 'orderStatusGroup', 'label' => $this->trans('order_status.label.order_status_group'), 'options' => $orderStatusGroups, 'default' => current(array_keys($orderStatusGroups)), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('order_status_group.repository'))]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('order_status.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('order_status.label.name')]));
     $languageData->addChild($this->getElement('rich_text_editor', ['name' => 'defaultComment', 'label' => $this->trans('order_status.label.default_comment')]));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 21
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $currencies = $this->get('currency.provider')->getSelect();
     $vatValues = $this->get('tax.collection')->getSelect();
     $mainData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'main_data', 'label' => $this->trans('admin.form.label.main_data')]));
     $languageData = $mainData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.language.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product.repository'))]));
     $name = $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('product.label.name')]));
     $languageData->addChild($this->getElement('slug_field', ['name' => 'slug', 'label' => $this->trans('product.label.slug'), 'name_field' => $name, 'generate_route' => 'admin.routing.generate', 'translatable_id' => $this->getParam('id')]));
     $mainData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('product.label.enabled'), 'comment' => $this->trans('product.comment.enabled'), 'default' => 1]));
     $mainData->addChild($this->getElement('text_field', ['name' => 'sku', 'label' => $this->trans('product.label.sku')]));
     $mainData->addChild($this->getElement('select', ['name' => 'producer', 'label' => $this->trans('product.label.producer'), 'options' => $this->get('producer.collection.admin')->getSelect(), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('producer.repository'))]));
     $metaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'meta_data', 'label' => $this->trans('meta.fieldset.name')]));
     $languageData = $metaData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.title', 'label' => $this->trans('meta.label.title')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.keywords', 'label' => $this->trans('meta.label.keywords')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'meta.description', 'label' => $this->trans('meta.label.description')]));
     $categoryPane = $form->addChild($this->getElement('nested_fieldset', ['name' => 'category_pane', 'label' => $this->trans('fieldset.categories.label')]));
     $categoriesField = $categoryPane->addChild($this->getElement('tree', ['name' => 'categories', 'label' => $this->trans('product.label.categories'), 'choosable' => false, 'selectable' => true, 'sortable' => false, 'clickable' => false, 'items' => $this->get('category.collection.admin')->getFlatTree(), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('category.repository'))]));
     $pricePane = $form->addChild($this->getElement('nested_fieldset', ['name' => 'price_pane', 'label' => $this->trans('form.fieldset.prices')]));
     $buyPriceSettings = $pricePane->addChild($this->getElement('nested_fieldset', ['name' => 'buy_price_settings', 'label' => $this->trans('product.label.buy_price.settings'), 'class' => 'priceGroup']));
     $buyPriceSettings->addChild($this->getElement('select', ['name' => 'buyPrice.currency', 'label' => $this->trans('product.label.buy_price.currency'), 'options' => $currencies]));
     $buyPriceTax = $buyPriceSettings->addChild($this->getElement('select', ['name' => 'buyPriceTax', 'label' => $this->trans('product.label.buy_price.tax'), 'options' => $vatValues, 'addable' => true, 'onAdd' => 'onTaxAdd', 'add_item_prompt' => $this->trans('product.tax.add_item_prompt'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('tax.repository'))]));
     $buyPriceSettings->addChild($this->getElement('price_editor', ['name' => 'buyPrice.grossAmount', 'label' => $this->trans('product.label.buy_price.gross_amount'), 'filters' => [$this->getFilter('comma_to_dot_changer')], 'vat_field' => $buyPriceTax]));
     $sellPriceSettings = $pricePane->addChild($this->getElement('nested_fieldset', ['name' => 'sell_price_settings', 'label' => $this->trans('product.label.sell_price.settings'), 'class' => 'priceGroup']));
     $sellPriceSettings->addChild($this->getElement('select', ['name' => 'sellPrice.currency', 'label' => $this->trans('product.label.sell_price.currency'), 'options' => $currencies]));
     $sellPriceTax = $sellPriceSettings->addChild($this->getElement('select', ['name' => 'sellPriceTax', 'label' => $this->trans('product.label.sell_price.tax'), 'options' => $vatValues, 'addable' => true, 'onAdd' => 'onTaxAdd', 'add_item_prompt' => $this->trans('product.tax.add_item_prompt'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('tax.repository'))]));
     $sellPriceAmount = $sellPriceSettings->addChild($this->getElement('price_editor', ['name' => 'sellPrice.grossAmount', 'label' => $this->trans('product.label.sell_price.gross_amount'), 'filters' => [$this->getFilter('comma_to_dot_changer')], 'vat_field' => $sellPriceTax]));
     $sellPriceSettings->addChild($this->getElement('price_editor', ['name' => 'sellPrice.discountedGrossAmount', 'label' => $this->trans('product.label.sell_price.discounted_gross_amount'), 'filters' => [$this->getFilter('comma_to_dot_changer')], 'vat_field' => $sellPriceTax]));
     $sellPriceSettings->addChild($this->getElement('date', ['name' => 'sellPrice.validFrom', 'label' => $this->trans('product.label.sell_price.discount_valid_from'), 'transformer' => new DateTransformer('m/d/Y')]));
     $sellPriceSettings->addChild($this->getElement('date', ['name' => 'sellPrice.validTo', 'label' => $this->trans('product.label.sell_price.discount_valid_to'), 'transformer' => new DateTransformer('m/d/Y')]));
     $stockData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'stock_data', 'label' => $this->trans('product.label.stock.settings')]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'stock', 'label' => $this->trans('product.label.stock'), 'suffix' => $this->trans('pcs'), 'default' => 0]));
     $stockData->addChild($this->getElement('checkbox', ['name' => 'trackStock', 'label' => $this->trans('product.label.track_stock'), 'comment' => $this->trans('product.comment.track_stock')]));
     $stockData->addChild($this->getElement('select', ['name' => 'unit', 'label' => $this->trans('product.label.unit'), 'options' => $this->get('unit.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('unit.repository'))]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'weight', 'label' => $this->trans('product.label.weight'), 'filters' => [$this->getFilter('comma_to_dot_changer')], 'default' => 0]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'dimension.width', 'label' => $this->trans('product.label.dimension.width'), 'filters' => [$this->getFilter('comma_to_dot_changer')]]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'dimension.height', 'label' => $this->trans('product.label.dimension.height'), 'filters' => [$this->getFilter('comma_to_dot_changer')]]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'dimension.depth', 'label' => $this->trans('product.label.dimension.depth'), 'filters' => [$this->getFilter('comma_to_dot_changer')]]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'packageSize', 'label' => $this->trans('product.label.package_size'), 'filters' => [$this->getFilter('comma_to_dot_changer')], 'default' => 1]));
     $availabilityField = $stockData->addChild($this->getElement('select', ['name' => 'availability', 'label' => $this->trans('product.label.availability'), 'options' => $this->get('availability.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('availability.repository'))]));
     $mediaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'media_data', 'label' => $this->trans('product.label.product_photos')]));
     $mediaData->addChild($this->getElement('image', ['name' => 'productPhotos', 'label' => $this->trans('product.label.product_photos'), 'load_route' => $this->getRouterHelper()->generateUrl('admin.media.grid'), 'upload_url' => $this->getRouterHelper()->generateUrl('admin.media.add'), 'repeat_min' => 0, 'repeat_max' => ElementInterface::INFINITE, 'transformer' => $this->getRepositoryTransformer('product_photo_collection', $this->get('media.repository')), 'session_name' => $this->getRequestHelper()->getCurrentRequest()->getSession()->getName(), 'session_id' => $this->getRequestHelper()->getCurrentRequest()->getSession()->getId()]));
     $statusesData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'statuses_data', 'label' => $this->trans('product.label.statuses')]));
     $statusesData->addChild($this->getElement('multi_select', ['name' => 'statuses', 'label' => $this->trans('product.label.statuses'), 'options' => $this->get('product_status.collection.admin')->getSelect(), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('product_status.repository'))]));
     $attributesData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'attributes_data', 'label' => $this->trans('product.label.attributes')]));
     $attributesData->addChild($this->getElement('product_variants_editor', ['name' => 'attributes', 'label' => $this->trans('product.label.attributes'), 'suffixes' => ['+', '-', '%'], 'price_field' => $sellPriceAmount, 'vat_field' => $sellPriceTax, 'vat_values' => $vatValues, 'category_field' => $categoriesField, 'availability_field' => $availabilityField, 'availability' => $availabilityField->getOption('options'), 'transformer' => $this->getRepositoryTransformer('product_attribute_collection', $this->get('product_attribute.repository'))]));
     $shopsData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shops_data', 'label' => $this->trans('shop.label.shops')]));
     $shopsData->addChild($this->getElement('multi_select', ['name' => 'shops', 'label' => $this->trans('product.label.shops'), 'options' => $this->get('shop.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('shop.repository'))]));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 22
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.required_data')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('shop.label.name')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'company', 'label' => $this->trans('shop.label.company'), 'options' => $this->get('company.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('company.repository'))]));
     $requiredData->addChild($this->getElement('select', ['name' => 'theme', 'label' => $this->trans('shop.label.theme'), 'options' => $this->get('theme.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('theme.repository'))]));
     $urlData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'url_data', 'label' => $this->trans('shop.fieldset.url_data')]));
     $urlData->addChild($this->getElement('text_field', ['name' => 'url', 'label' => $this->trans('shop.label.url')]));
     $cartSettings = $form->addChild($this->getElement('nested_fieldset', ['name' => 'cart_settings', 'label' => $this->trans('shop.cart_settings.label')]));
     $cartSettings->addChild($this->getElement('select', ['name' => 'defaultCountry', 'label' => $this->trans('shop.label.default_country'), 'options' => $this->get('country.repository')->all()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 23
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'firstName', 'label' => $this->trans('common.label.address.first_name')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'lastName', 'label' => $this->trans('common.label.address.last_name')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'email', 'label' => $this->trans('common.label.contact_details.email')]));
     $requiredData->addChild($this->getElement('password', ['name' => 'password', 'label' => $this->trans('common.label.password')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'phone', 'label' => $this->trans('common.label.contact_details.phone')]));
     $clientGroupSelectBuilder = new SelectBuilder($this->get('client_group.dataset'));
     $requiredData->addChild($this->getElement('select', ['name' => 'group', 'label' => $this->trans('client.label.client_group'), 'options' => $clientGroupSelectBuilder->getItems(), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('client_group.repository'))]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'discount', 'label' => $this->trans('client.label.discount'), 'suffix' => '%', 'filters' => [$this->getFilter('comma_to_dot_changer')]]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset..translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('shipping_method.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name')]));
     $requiredData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('common.label.enabled'), 'default' => 1]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'hierarchy', 'label' => $this->trans('common.label.hierarchy'), 'default' => 0]));
     $costsData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'costs_data', 'label' => $this->trans('shipping_method.fieldset.costs')]));
     $costsData->addChild($this->getElement('select', ['name' => 'calculator', 'label' => $this->trans('shipping_method.label.calculator'), 'options' => []]));
     $costsData->addChild($this->getElement('select', ['name' => 'currency', 'label' => $this->trans('common.label.currency'), 'options' => $this->get('currency.collection')->getSelect(['value_key' => 'id', 'label_key' => 'code', 'order_by' => 'code']), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('currency.repository'))]));
     $tax = $costsData->addChild($this->getElement('select', ['name' => 'tax', 'label' => $this->trans('common.label.tax'), 'options' => $this->get('tax.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('tax.repository'))]));
     $costsData->addChild($this->getElement('range_editor', ['name' => 'costs', 'label' => $this->trans('shipping_method.label.costs'), 'vat_field' => $tax, 'range_precision' => 2, 'transformer' => $this->getRepositoryTransformer('shipping_cost_collection', $this->get('shipping_method_cost.repository'))]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $mainData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('fieldset.main.label')]));
     $languageData = $mainData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product_status.repository'))]));
     $name = $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('product_status.name.label')]));
     $languageData->addChild($this->getElement('slug_field', ['name' => 'slug', 'label' => $this->trans('product_status.slug.label'), 'name_field' => $name, 'generate_route' => 'admin.routing.generate', 'translatable_id' => $this->getParam('id')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'cssClass', 'label' => $this->trans('product_status.css_class.label'), 'comment' => $this->trans('product_status.css_class.comment')]));
     $metaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'meta_data', 'label' => $this->trans('fieldset.meta.label')]));
     $languageData = $metaData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product_status.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'metaTitle', 'label' => $this->trans('meta.label.title')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'metaKeywords', 'label' => $this->trans('meta.label.keywords')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'metaDescription', 'label' => $this->trans('meta.label.description')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 26
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('coupon.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'description', 'label' => $this->trans('common.label.description')]));
     $requiredData->addChild($this->getElement('date', ['name' => 'validFrom', 'label' => $this->trans('common.label.valid_from'), 'transformer' => new DateTransformer('m/d/Y')]));
     $requiredData->addChild($this->getElement('date', ['name' => 'validTo', 'label' => $this->trans('common.label.valid_to'), 'transformer' => new DateTransformer('m/d/Y')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'code', 'label' => $this->trans('common.label.code')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'clientUsageLimit', 'label' => $this->trans('coupon.label.client_usage_limit')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'globalUsageLimit', 'label' => $this->trans('coupon.label.global_usage_limit')]));
     $discountPane = $form->addChild($this->getElement('nested_fieldset', ['name' => 'discount_pane', 'label' => $this->trans('form.fieldset.discount_settings')]));
     $modifierType = $discountPane->addChild($this->getElement('select', ['name' => 'modifierType', 'label' => $this->trans('coupon.label.modifier_type'), 'options' => $this->getModifierTypes()]));
     $discountPane->addChild($this->getElement('select', ['name' => 'currency', 'label' => $this->trans('common.label.currency'), 'options' => $this->get('currency.provider')->getSelect(), 'dependencies' => [$this->getDependency('show', ['form' => $form, 'field' => $modifierType, 'condition' => new Equals('-')])]]));
     $discountPane->addChild($this->getElement('text_field', ['name' => 'modifierValue', 'label' => $this->trans('coupon.label.modifier_value')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 27
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.required_data')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('company.label.name')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'shortName', 'label' => $this->trans('company.label.short_name')]));
     $addressData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'address_data', 'label' => $this->trans('company.label.address')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'street', 'label' => $this->trans('company.label.street')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'streetNo', 'label' => $this->trans('company.label.street_no')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'flatNo', 'label' => $this->trans('company.label.flat_no')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'province', 'label' => $this->trans('company.label.province')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'postCode', 'label' => $this->trans('company.label.post_code')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'city', 'label' => $this->trans('company.label.city')]));
     $addressData->addChild($this->getElement('select', ['name' => 'country', 'label' => $this->trans('company.label.country'), 'options' => $this->get('country.repository')->all()]));
     $mediaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'media_data', 'label' => $this->trans('fieldset.media')]));
     $mediaData->addChild($this->getElement('image', ['name' => 'photo', 'label' => $this->trans('company.label.logo'), 'load_route' => $this->getRouterHelper()->generateUrl('admin.media.grid'), 'upload_url' => $this->getRouterHelper()->generateUrl('admin.media.add'), 'repeat_min' => 0, 'repeat_max' => 1, 'transformer' => $this->getRepositoryTransformer('entity', $this->get('media.repository')), 'session_id' => $this->getRequestHelper()->getCurrentRequest()->getSession()->getId(), 'session_name' => $this->getRequestHelper()->getCurrentRequest()->getSession()->getName()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 28
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product.repository'))]));
     $name = $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('producer.label.name')]));
     $languageData->addChild($this->getElement('slug_field', ['name' => 'slug', 'label' => $this->trans('producer.label.slug'), 'name_field' => $name, 'generate_route' => 'admin.routing.generate', 'translatable_id' => $this->getParam('id')]));
     $metaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'meta_data', 'label' => $this->trans('fieldset.meta.label')]));
     $languageData = $metaData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('producer.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.title', 'label' => $this->trans('meta.title.label')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.keywords', 'label' => $this->trans('meta.keywords.label')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'meta.description', 'label' => $this->trans('meta.description.label')]));
     $mediaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'media_data', 'label' => $this->trans('fieldset.media')]));
     $mediaData->addChild($this->getElement('image', ['name' => 'photo', 'label' => $this->trans('form.media_data.image_id'), 'load_route' => $this->getRouterHelper()->generateUrl('admin.media.grid'), 'upload_url' => $this->getRouterHelper()->generateUrl('admin.media.add'), 'repeat_min' => 0, 'repeat_max' => 1, 'transformer' => $this->getRepositoryTransformer('media_entity', $this->get('media.repository')), 'session_name' => $this->getRequestHelper()->getCurrentRequest()->getSession()->getName(), 'session_id' => $this->getRequestHelper()->getCurrentRequest()->getSession()->getId()]));
     $delivererData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'deliverers_data', 'label' => $this->trans('producer.deliverers.label')]));
     $delivererSelectBuilder = new SelectBuilder($this->get('deliverer.dataset'));
     $delivererData->addChild($this->getElement('multi_select', ['name' => 'deliverers', 'label' => $this->trans('deliverers'), 'options' => $delivererSelectBuilder->getItems(), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('deliverer.repository'))]));
     $shopsData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shops_data', 'label' => $this->trans('fieldset.shops.label')]));
     $shopsData->addChild($this->getElement('multi_select', ['name' => 'shops', 'label' => $this->trans('shops.label'), 'options' => $this->get('shop.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('shop.repository'))]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 29
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'requiredData', 'label' => $this->trans('admin.form.label.required_data')]));
     $requiredData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('admin.form.label.enabled')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('admin.form.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('contact.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('contact.label.name')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'email', 'label' => $this->trans('contact.label.email')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'phone', 'label' => $this->trans('contact.label.phone')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'businessHours', 'label' => $this->trans('contact.label.business_hours')]));
     $addressData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'addressData', 'label' => $this->trans('contact.label.address')]));
     $languageData = $addressData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('admin.form.label.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('contact.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'street', 'label' => $this->trans('address.label.street')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'streetNo', 'label' => $this->trans('address.label.street_no')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'flatNo', 'label' => $this->trans('address.label.flat_no')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'province', 'label' => $this->trans('address.label.province')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'postCode', 'label' => $this->trans('address.label.post_code')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'city', 'label' => $this->trans('address.label.city')]));
     $languageData->addChild($this->getElement('select', ['name' => 'country', 'label' => $this->trans('address.label.country'), 'options' => $this->get('country.repository')->all()]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
Esempio n. 30
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('form.fieldset.required_data')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('category.repository'))]));
     $name = $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('category.label.name')]));
     $languageData->addChild($this->getElement('slug_field', ['name' => 'slug', 'label' => $this->trans('category.label.slug'), 'name_field' => $name, 'generate_route' => 'admin.routing.generate', 'translatable_id' => $this->getParam('id')]));
     $requiredData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('category.label.enabled'), 'comment' => $this->trans('category.comment.enabled'), 'default' => 1]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'hierarchy', 'label' => $this->trans('category.label.hierarchy')]));
     $requiredData->addChild($this->getElement('tree', ['name' => 'parent', 'label' => $this->trans('category.label.parent'), 'choosable' => true, 'selectable' => false, 'sortable' => false, 'clickable' => false, 'items' => $this->get('category.collection.admin')->getFlatTree(), 'restrict' => $this->getParam('id'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('category.repository'))]));
     $descriptionData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'description_data', 'label' => $this->trans('fieldset.description')]));
     $languageData = $descriptionData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('category.repository'))]));
     $languageData->addChild($this->getElement('rich_text_editor', ['name' => 'shortDescription', 'label' => $this->trans('category.short_description.label')]));
     $languageData->addChild($this->getElement('rich_text_editor', ['name' => 'description', 'label' => $this->trans('category.description.label')]));
     $seoData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'seo_data', 'label' => $this->trans('fieldset.seo')]));
     $languageData = $seoData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('category.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.title', 'label' => $this->trans('meta.label.title')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.keywords', 'label' => $this->trans('meta.label.keywords')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'meta.description', 'label' => $this->trans('meta.label.description')]));
     $shopsData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shops_data', 'label' => $this->trans('fieldset.shops.label')]));
     $shopsData->addChild($this->getElement('multi_select', ['name' => 'shops', 'label' => $this->trans('shop.label.shops'), 'options' => $this->get('shop.collection')->getSelect(), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('shop.repository'))]));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }