/**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $options = [];
     $processors = $this->getProcessors();
     foreach ($processors as $processor) {
         $options[$processor->getAlias()] = $processor->getName();
     }
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('form.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('payment_method.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name')]));
     $processorType = $requiredData->addChild($this->getElement('select', ['name' => 'processor', 'label' => $this->trans('payment_method.label.processor'), 'options' => $options, 'default' => current(array_keys($options))]));
     $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]));
     $requiredData->addChild($this->getElement('select', ['name' => 'defaultOrderStatus', 'label' => $this->trans('common.label.default_order_status'), 'options' => $this->get('order_status.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('order_status.repository'))]));
     $shippingMethodsData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shipping_methods_data', 'label' => $this->trans('payment_method.fieldset.shipping_methods')]));
     $shippingMethodsData->addChild($this->getElement('multi_select', ['name' => 'shippingMethods', 'label' => $this->trans('payment_method.label.shipping_methods'), 'options' => $this->get('shipping_method.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('shipping_method.repository'))]));
     $repository = $this->get('payment_method_configuration.repository');
     $configurationData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'configuration', 'property_path' => new PropertyPath('configuration'), 'label' => $this->trans('common.fieldset.general'), 'transformer' => $this->getRepositoryTransformer('payment_method_configuration', $repository)]));
     foreach ($processors as $processor) {
         $dependency = $this->getDependency('show', ['form' => $form, 'field' => $processorType, 'condition' => new Equals($processor->getAlias())]);
         $processor->addConfigurationFields($this, $configurationData, $dependency);
     }
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $countries = $this->get('country.repository')->all();
     $defaultCountry = $this->getShopStorage()->getCurrentShop()->getDefaultCountry();
     $billingAddress = $form->addChild($this->getElement('nested_fieldset', ['name' => 'billingAddress', 'label' => $this->trans('client.heading.billing_address')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.firstName', 'label' => $this->trans('client.label.address.first_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.lastName', 'label' => $this->trans('client.label.address.last_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.companyName', 'label' => $this->trans('client.label.address.company_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.vatId', 'label' => $this->trans('client.label.address.vat_id')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.line1', 'label' => $this->trans('client.label.address.line1')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.line2', 'label' => $this->trans('client.label.address.line2')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.postalCode', 'label' => $this->trans('client.label.address.postal_code')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.state', 'label' => $this->trans('client.label.address.state')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.city', 'label' => $this->trans('client.label.address.city')]));
     $billingAddress->addChild($this->getElement('select', ['name' => 'billingAddress.country', 'label' => $this->trans('client.label.address.country'), 'options' => $countries, 'default' => $defaultCountry]));
     $shippingAddress = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shippingAddress', 'label' => $this->trans('client.heading.shipping_address')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.firstName', 'label' => $this->trans('client.label.address.first_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.lastName', 'label' => $this->trans('client.label.address.last_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.line1', 'label' => $this->trans('client.label.address.line1')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.line2', 'label' => $this->trans('client.label.address.line2')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.postalCode', 'label' => $this->trans('client.label.address.postal_code')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.province', 'label' => $this->trans('client.label.address.province')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.city', 'label' => $this->trans('client.label.address.city')]));
     $shippingAddress->addChild($this->getElement('select', ['name' => 'shippingAddress.country', 'label' => $this->trans('client.label.address.country'), 'options' => $countries, 'default' => $defaultCountry]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $countries = $this->get('country.repository')->all();
     $defaultCountry = $this->getShopStorage()->getCurrentShop()->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('common.label.first_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.lastName', 'label' => $this->trans('common.label.last_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.line1', 'label' => $this->trans('address.label.line1'), 'comment' => $this->trans('address.comment.line1')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.line2', 'label' => $this->trans('address.label.line2'), 'comment' => $this->trans('address.comment.line2')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.postalCode', 'label' => $this->trans('address.label.postal_code')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.state', 'label' => $this->trans('address.label.state')]));
     $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]));
     $shippingAddress = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shippingAddress', 'label' => $this->trans('address.heading.shipping_address')]));
     $shippingAddress->addChild($this->getElement('checkbox', ['name' => 'shippingAddress.copyBillingAddress', 'label' => $this->trans('address.label.copy_address')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.firstName', 'label' => $this->trans('common.label.first_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.lastName', 'label' => $this->trans('common.label.last_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.line1', 'label' => $this->trans('address.label.line1'), 'comment' => $this->trans('address.comment.line1')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.line2', 'label' => $this->trans('address.label.line2'), 'comment' => $this->trans('address.comment.line2')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.postalCode', 'label' => $this->trans('address.label.postal_code')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.state', 'label' => $this->trans('address.label.state')]));
     $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('address.heading.contact_details')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.firstName', 'label' => $this->trans('common.label.first_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.lastName', 'label' => $this->trans('common.label.last_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.phone', 'label' => $this->trans('common.label.phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.secondaryPhone', 'label' => $this->trans('common.label.secondary_phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.email', 'label' => $this->trans('common.label.email')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $orderStatuses = $this->get('order_status.dataset.admin')->getResult('select');
     $options = [];
     $processors = $this->getPaymentProcessorCollection();
     foreach ($processors->all() as $processor) {
         $processorName = $processor->getConfigurator()->getName();
         $options[$processorName] = $processorName;
     }
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('payment_method.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $processorType = $requiredData->addChild($this->getElement('select', ['name' => 'processor', 'label' => $this->trans('payment_method.label.processor'), 'options' => $options]));
     $requiredData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('common.label.enabled')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'hierarchy', 'label' => $this->trans('common.label.hierarchy'), 'rules' => [$this->getRule('required')]]));
     $statusesData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'statuses', 'label' => $this->trans('payment_method.fieldset.order_statuses')]));
     $statusesData->addChild($this->getElement('select', ['name' => 'paymentPendingOrderStatus', 'label' => $this->trans('payment_method.label.payment_pending_order_status'), 'options' => $orderStatuses, 'transformer' => $this->getRepositoryTransformer('entity', $this->get('order_status.repository'))]));
     $statusesData->addChild($this->getElement('select', ['name' => 'paymentSuccessOrderStatus', 'label' => $this->trans('payment_method.label.payment_success_order_status'), 'options' => $orderStatuses, 'transformer' => $this->getRepositoryTransformer('entity', $this->get('order_status.repository'))]));
     $statusesData->addChild($this->getElement('select', ['name' => 'paymentFailureOrderStatus', 'label' => $this->trans('payment_method.label.payment_failure_order_status'), 'options' => $orderStatuses, 'transformer' => $this->getRepositoryTransformer('entity', $this->get('order_status.repository'))]));
     $shippingMethodsData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'shipping_methods_data', 'label' => $this->trans('payment_method.fieldset.shipping_methods')]));
     $shippingMethodsData->addChild($this->getElement('multi_select', ['name' => 'shippingMethods', 'label' => $this->trans('payment_method.label.shipping_methods'), 'options' => $this->get('shipping_method.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('shipping_method.repository'))]));
     $configurationData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'configuration', 'property_path' => new PropertyPath('configuration'), 'label' => $this->trans('payment_method.fieldset.processor_configuration')]));
     foreach ($processors->all() as $processor) {
         $dependency = $this->getDependency('show', ['form' => $form, 'field' => $processorType, 'condition' => new Equals($processor->getConfigurator()->getName())]);
         $processor->getConfigurator()->addConfigurationFields($this, $configurationData, $dependency);
     }
     $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('client.label.username')]));
     $form->addChild($this->getElement('password', ['name' => '_password', 'label' => $this->trans('client.label.password')]));
     $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('user.label.username'), 'rules' => [$this->getRule('required')]]));
     $form->addChild($this->getElement('submit', ['name' => 'reset_password', 'label' => $this->trans('user.button.reset_password')]));
     $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' => 'email', 'label' => $this->trans('contact_ticket.label.email')]));
     $form->addChild($this->getElement('text_field', ['name' => 'subject', 'label' => $this->trans('contact_ticket.label.subject')]));
     $form->addChild($this->getElement('text_area', ['name' => 'content', 'label' => $this->trans('contact_ticket.label.content'), 'rows' => 5, 'cols' => 10]));
     $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' => 'nick', 'label' => $this->trans('product_review.label.nick')]));
     $form->addChild($this->getElement('hidden', ['name' => 'rating', 'label' => $this->trans('product_review.label.rating')]));
     $form->addChild($this->getElement('text_area', ['name' => 'review', 'label' => $this->trans('product_review.label.review'), 'rows' => 5, 'cols' => 10]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $orderStatuses = $this->get('order_status.dataset.admin')->getResult('select');
     $form->addChild($this->getElement('select', ['name' => 'orderStatus', 'label' => $this->trans('order_status_history.label.order_status'), 'options' => $orderStatuses, 'transformer' => $this->getRepositoryTransformer('entity', $this->get('order_status.repository'))]));
     $form->addChild($this->getElement('text_area', ['name' => 'comment', 'rows' => 10, 'label' => $this->trans('order_status_history.label.comment')]));
     $form->addChild($this->getElement('checkbox', ['name' => 'notify', 'label' => $this->trans('order_status_history.label.nofity'), 'default' => 1]));
     $form->addChild($this->getElement('submit', ['name' => 'add_order_status_history', 'label' => $this->trans('order_status_history.button.change')]));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
 public function buildForm(FormInterface $form)
 {
     $shippingMethod = $form->addChild($this->getElement('radio_group', ['name' => 'shippingMethod', 'label' => $this->trans('cart.label.shipping_method'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('shipping_method.repository'))]));
     $this->addShippingOptions($shippingMethod);
     $paymentMethod = $form->addChild($this->getElement('radio_group', ['name' => 'paymentMethod', 'label' => $this->trans('cart.label.payment_method'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('payment_method.repository'))]));
     $this->addPaymentOptions($paymentMethod);
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #11
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $currencies = $this->get('currency.dataset.admin')->getResult('select', ['order_by' => 'code'], ['label_column' => 'code', 'value_column' => 'code']);
     $vatValues = $this->get('tax.dataset.admin')->getResult('select');
     $mainData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'main_data', 'label' => $this->trans('common.fieldset.general')]));
     $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('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $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->getRequestHelper()->getAttributesBagParam('id'), 'rules' => [$this->getRule('required')]]));
     $mainData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('common.label.enabled'), 'comment' => $this->trans('common.comment.enabled')]));
     $descriptionData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'description_data', 'label' => $this->trans('common.fieldset.description')]));
     $languageData = $descriptionData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('product.repository'))]));
     $languageData->addChild($this->getElement('rich_text_editor', ['name' => 'shortDescription', 'label' => $this->trans('common.label.short_description')]));
     $languageData->addChild($this->getElement('rich_text_editor', ['name' => 'description', 'label' => $this->trans('common.label.description')]));
     $mainData->addChild($this->getElement('text_field', ['name' => 'sku', 'label' => $this->trans('common.label.sku'), 'rules' => [$this->getRule('required')]]));
     $mainData->addChild($this->getElement('select', ['name' => 'producer', 'label' => $this->trans('common.label.producer'), 'options' => $this->get('producer.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('producer.repository'))]));
     $metaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'meta_data', 'label' => $this->trans('common.fieldset.meta')]));
     $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('common.label.meta.title')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.keywords', 'label' => $this->trans('common.label.meta.keywords')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'meta.description', 'label' => $this->trans('common.label.meta.description')]));
     $categoryPane = $form->addChild($this->getElement('nested_fieldset', ['name' => 'category_pane', 'label' => $this->trans('common.fieldset.categories')]));
     $categoriesField = $categoryPane->addChild($this->getElement('tree', ['name' => 'categories', 'label' => $this->trans('common.label.categories'), 'choosable' => false, 'selectable' => true, 'sortable' => false, 'clickable' => false, 'items' => $this->get('category.dataset.admin')->getResult('flat_tree'), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('category.repository'))]));
     $pricePane = $form->addChild($this->getElement('nested_fieldset', ['name' => 'price_pane', 'label' => $this->trans('common.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('common.label.currency'), 'options' => $currencies]));
     $buyPriceTax = $buyPriceSettings->addChild($this->getElement('select', ['name' => 'buyPriceTax', 'label' => $this->trans('common.label.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('common.label.currency'), 'options' => $currencies]));
     $sellPriceTax = $sellPriceSettings->addChild($this->getElement('select', ['name' => 'sellPriceTax', 'label' => $this->trans('common.label.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('common.label.discounted_price'), 'filters' => [$this->getFilter('comma_to_dot_changer')], 'vat_field' => $sellPriceTax]));
     $sellPriceSettings->addChild($this->getElement('date', ['name' => 'sellPrice.validFrom', 'label' => $this->trans('common.label.valid_from'), 'transformer' => new DateTransformer('m/d/Y')]));
     $sellPriceSettings->addChild($this->getElement('date', ['name' => 'sellPrice.validTo', 'label' => $this->trans('common.label.valid_to'), 'transformer' => new DateTransformer('m/d/Y')]));
     $stockData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'stock_data', 'label' => $this->trans('product.form.fieldset.stock')]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'stock', 'label' => $this->trans('common.label.stock'), 'suffix' => $this->trans('pcs'), 'rules' => [$this->getRule('required')]]));
     $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.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('unit.repository'))]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'weight', 'label' => $this->trans('common.label.dimension.weight'), 'filters' => [$this->getFilter('comma_to_dot_changer')], 'rules' => [$this->getRule('required')]]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'dimension.width', 'label' => $this->trans('common.label.dimension.width'), 'filters' => [$this->getFilter('comma_to_dot_changer')]]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'dimension.height', 'label' => $this->trans('common.label.dimension.height'), 'filters' => [$this->getFilter('comma_to_dot_changer')]]));
     $stockData->addChild($this->getElement('text_field', ['name' => 'dimension.depth', 'label' => $this->trans('common.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')], 'rules' => [$this->getRule('required')]]));
     $availabilityField = $stockData->addChild($this->getElement('select', ['name' => 'availability', 'label' => $this->trans('product.label.availability'), 'options' => $this->get('availability.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('availability.repository'))]));
     $mediaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'media_data', 'label' => $this->trans('product.form.fieldset.photos')]));
     $mediaData->addChild($this->getElement('image', ['name' => 'productPhotos', 'label' => $this->trans('common.label.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_id' => $this->getRequestHelper()->getSessionId(), 'session_name' => $this->getRequestHelper()->getSessionName()]));
     $statusesData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'statuses_data', 'label' => $this->trans('product.form.fieldset.statuses')]));
     $statusesData->addChild($this->getElement('multi_select', ['name' => 'statuses', 'label' => $this->trans('product.label.statuses'), 'options' => $this->get('product_status.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('product_status.repository'))]));
     $attributesData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'attributes_data', 'label' => $this->trans('product.form.fieldset.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('product.common.fieldset.shops')]));
     $shopsData->addChild($this->getElement('multi_select', ['name' => 'shops', 'label' => $this->trans('product.common.fieldset.shops'), 'options' => $this->get('shop.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('shop.repository'))]));
     $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('user.label.username'), 'rules' => [$this->getRule('required')]]));
     $form->addChild($this->getElement('password', ['name' => '_password', 'label' => $this->trans('user.label.password'), 'rules' => [$this->getRule('required')]]));
     $form->addChild($this->getElement('submit', ['name' => 'log_in', 'label' => $this->trans('user.button.log_in')]));
     $resetUrl = $this->getRouterHelper()->generateUrl('admin.user.reset_password');
     $form->addChild($this->getElement('static_text', ['text' => '<a href="' . $resetUrl . '">' . $this->trans('user.button.reset_password') . '</a>']));
     $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('common.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'));
 }
예제 #14
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $cart = $this->cartContext->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' => 'main_data', 'label' => $this->trans('attribute_group.label.group')]));
     $languageData = $groupData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('attribute_group.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $attributesData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'attributes_data', 'label' => $this->trans('attribute_group.fieldset.attributes')]));
     $attributesData->addChild($this->getElement('multi_select', ['name' => 'attributes', 'label' => $this->trans('attribute_group.label.attributes'), 'options' => $this->get('attribute.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('attribute.repository'))]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #16
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $order = $this->getOrderProvider()->getCurrentOrder();
     $countries = $this->get('country.repository')->all();
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('order.form.fieldset.products')]));
     $requiredData->addChild($this->getElement('order_editor', ['name' => 'products', 'label' => $this->trans('order.heading.products'), 'repeat_min' => 1, 'repeat_max' => ElementInterface::INFINITE, 'load_products_route' => 'admin.product.grid', 'on_change' => 'OnProductListChange', 'on_before_change' => 'OnProductListBeforeChange', 'transformer' => $this->getRepositoryTransformer('order_product_collection', $this->get('order_product.repository'))]));
     $orderDetails = $form->addChild($this->getElement('columns', ['name' => 'orderMethodsDetails', 'label' => $this->trans('order.heading.order_methods_details')]));
     $paymentShippingData = $orderDetails->addChild($this->getElement('nested_fieldset', ['name' => 'methods', 'label' => $this->trans('client.heading.billing_address')]));
     $shippingMethod = $paymentShippingData->addChild($this->getElement('select', ['name' => 'shippingMethod', 'label' => $this->trans('order.label.shipping_method'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('shipping_method.repository'))]));
     $this->addShippingOptions($shippingMethod);
     $paymentMethod = $paymentShippingData->addChild($this->getElement('select', ['name' => 'paymentMethod', 'label' => $this->trans('order.label.payment_method'), 'transformer' => $this->getRepositoryTransformer('entity', $this->get('payment_method.repository'))]));
     $this->addPaymentOptions($paymentMethod);
     $order->getModifiers()->map(function (OrderModifierInterface $modifier) use($paymentShippingData) {
         $paymentShippingData->addChild($this->getElement('constant', ['name' => 'summary.' . $modifier->getName(), 'label' => $modifier->getDescription()]))->setValue($modifier->getGrossAmount());
     });
     $summaryData = $orderDetails->addChild($this->getElement('nested_fieldset', ['name' => 'summary', 'label' => $this->trans('order.heading.order_total')]));
     $summaryData->addChild($this->getElement('constant', ['name' => 'productTotal.netPrice', 'label' => $this->trans('order.label.product_total.net_price')]));
     $summaryData->addChild($this->getElement('constant', ['name' => 'productTotal.taxAmount', 'label' => $this->trans('order.label.product_total.tax_amount')]));
     $summaryData->addChild($this->getElement('constant', ['name' => 'productTotal.grossPrice', 'label' => $this->trans('order.label.product_total.gross_price')]));
     $summaryData->addChild($this->getElement('constant', ['name' => 'summary.netAmount', 'label' => $this->trans('order.label.summary.net_amount')]));
     $summaryData->addChild($this->getElement('constant', ['name' => 'summary.taxAmount', 'label' => $this->trans('order.label.summary.tax_amount')]));
     $summaryData->addChild($this->getElement('constant', ['name' => 'summary.grossAmount', 'label' => $this->trans('order.label.summary.gross_amount')]));
     $contactDetails = $form->addChild($this->getElement('nested_fieldset', ['name' => 'contactDetails', 'label' => $this->trans('order.heading.contact_details')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.firstName', 'label' => $this->trans('client.label.contact_details.first_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.lastName', 'label' => $this->trans('client.label.contact_details.last_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.phone', 'label' => $this->trans('client.label.contact_details.phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.secondaryPhone', 'label' => $this->trans('client.label.contact_details.secondary_phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.email', 'label' => $this->trans('client.label.contact_details.email')]));
     $addresses = $form->addChild($this->getElement('columns', ['name' => 'addresses', 'label' => $this->trans('order.heading.address')]));
     $billingAddress = $addresses->addChild($this->getElement('nested_fieldset', ['name' => 'billingAddress', 'label' => $this->trans('client.heading.billing_address')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.firstName', 'label' => $this->trans('client.label.address.first_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.lastName', 'label' => $this->trans('client.label.address.last_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.line1', 'label' => $this->trans('client.label.address.line1')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.line2', 'label' => $this->trans('client.label.address.line2')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.postalCode', 'label' => $this->trans('client.label.address.postal_code')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.state', 'label' => $this->trans('client.label.address.state')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.city', 'label' => $this->trans('client.label.address.city')]));
     $billingAddress->addChild($this->getElement('select', ['name' => 'billingAddress.country', 'label' => $this->trans('client.label.address.country'), 'options' => $countries]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.vatId', 'label' => $this->trans('client.label.address.vat_id')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.companyName', 'label' => $this->trans('client.label.address.company_name')]));
     $shippingAddress = $addresses->addChild($this->getElement('nested_fieldset', ['name' => 'shippingAddress', 'label' => $this->trans('client.heading.shipping_address')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.firstName', 'label' => $this->trans('client.label.address.first_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.lastName', 'label' => $this->trans('client.label.address.last_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.line1', 'label' => $this->trans('client.label.address.line1')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.line2', 'label' => $this->trans('client.label.address.line2')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.postalCode', 'label' => $this->trans('client.label.address.postal_code')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.state', 'label' => $this->trans('client.label.address.state')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.city', 'label' => $this->trans('client.label.address.city')]));
     $shippingAddress->addChild($this->getElement('select', ['name' => 'shippingAddress.country', 'label' => $this->trans('client.label.address.country'), 'options' => $countries]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #17
0
 /**
  * {@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)
 {
     $contactDetails = $form->addChild($this->getElement('nested_fieldset', ['name' => 'contactDetails', 'label' => $this->trans('client.heading.contact_details')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.firstName', 'label' => $this->trans('client.label.contact_details.first_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.lastName', 'label' => $this->trans('client.label.contact_details.last_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.phone', 'label' => $this->trans('client.label.contact_details.phone')]));
     $form->addChild($this->getElement('text_field', ['name' => 'username', 'label' => $this->trans('client.label.username')]));
     $form->addChild($this->getElement('password', ['name' => 'password', 'label' => $this->trans('client.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'));
 }
예제 #19
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'firstName', 'label' => $this->trans('user.label.first_name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'lastName', 'label' => $this->trans('user.label.last_name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'username', 'label' => $this->trans('user.label.username'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'email', 'label' => $this->trans('user.label.email'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('multi_select', ['name' => 'groups', 'label' => $this->trans('user.label.user_group'), 'options' => $this->get('user_group.dataset.admin')->getResult('select'), 'transformer' => $this->getRepositoryTransformer('collection', $this->get('user_group.repository'))]));
     $apiData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'api_data', 'label' => $this->trans('user.fieldset.api_access')]));
     $apiData->addChild($this->getElement('text_field', ['name' => 'apiKey', 'label' => $this->trans('user.label.api_key')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #20
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $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'), 'rules' => [$this->getRule('required')]]));
     $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')]));
     $metaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'meta_data', 'label' => $this->trans('common.fieldset.meta')]));
     $languageData = $metaData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('fieldset.translations.label'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('news.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.title', 'label' => $this->trans('common.label.meta.title')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.keywords', 'label' => $this->trans('common.label.meta.keywords')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'meta.description', 'label' => $this->trans('common.label.meta.description')]));
     $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('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('company.label.name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'shortName', 'label' => $this->trans('company.label.short_name'), 'rules' => [$this->getRule('required')]]));
     $addressData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'address_data', 'label' => $this->trans('address.label.addresses')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'line1', 'label' => $this->trans('address.label.line1')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'line2', 'label' => $this->trans('address.label.line2')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'state', 'label' => $this->trans('address.label.state')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'postalCode', 'label' => $this->trans('address.label.post_code')]));
     $addressData->addChild($this->getElement('text_field', ['name' => 'city', 'label' => $this->trans('address.label.city')]));
     $addressData->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'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $mainData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $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('common.label.name')]));
     $languageData->addChild($this->getElement('slug_field', ['name' => 'slug', 'label' => $this->trans('common.label.slug'), '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.label.css_class'), 'comment' => $this->trans('product_status.comment.css_class')]));
     $metaData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'meta_data', 'label' => $this->trans('common.fieldset.meta')]));
     $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' => 'meta.title', 'label' => $this->trans('common.label.meta.title')]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'meta.keywords', 'label' => $this->trans('common.label.meta.keywords')]));
     $languageData->addChild($this->getElement('text_area', ['name' => 'meta.description', 'label' => $this->trans('common.label.meta.description')]));
     $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.label.comment')]));
     $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('common.fieldset.general')]));
     $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.dataset.admin')->getResult('select', [], ['label_column' => '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.dataset.admin')->getResult('select'), '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'));
 }
예제 #25
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $packageForm)
 {
     $router = $this->getRouterHelper();
     $helper = $this->get('environment_helper');
     $package = $this->getRequestHelper()->getAttributesBagParam('id');
     $operation = $this->getRequestHelper()->getAttributesBagParam('operation');
     $port = $helper->getFreePort();
     $versions = $this->getPackageVersions($package);
     $packageData = $packageForm->addChild($this->getElement('nested_fieldset', ['name' => 'package_data', 'label' => $this->trans('package.fieldset.information')]));
     foreach ($versions as $version) {
         $license = implode('<br />', $version['license']);
         $packageData->addChild($this->getElement('static_text', ['text' => "\n                    <table>\n                        <tr><td><strong>Release date:</strong></td><td>{$version['date']}</td></tr>\n                        <tr><td><strong>Description:</strong></td><td>{$version['description']}</td></tr>\n                        <tr><td><strong>License:</strong></td><td>{$license}</td></tr>\n                    </table>\n                "]));
     }
     $packageRequiredData = $packageForm->addChild($this->getElement('nested_fieldset', ['name' => 'progress_data', 'label' => $this->trans('package.fieldset.progress')]));
     $packageRequiredData->addChild($this->getElement('console_output', ['name' => 'console_output', 'label' => $this->trans('package.label.console_output'), 'port' => $port, 'console_url' => $router->generateUrl('admin.package.console', ['id' => $package, 'operation' => $operation, 'port' => $port])]));
 }
예제 #26
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('select', ['name' => 'code', 'label' => $this->trans('currency.label.code'), '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)
 {
     $contactDetails = $form->addChild($this->getElement('nested_fieldset', ['name' => 'clientDetails', 'label' => $this->trans('client.heading.client_details')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'clientDetails.password', 'label' => $this->trans('client.label.new_password')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #28
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $requiredData = $form->addChild($this->getElement('fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $requiredData->addChild($this->getElement('image', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general'), 'datagrid' => $this->get('media.datagrid')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #29
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $currentOrder = $this->orderContext->getCurrentOrder();
     $shippingMethods = $this->shippingMethodProvider->getShippingMethodOptions($currentOrder);
     $paymentMethods = $this->shippingMethodProvider->getShippingMethodsPaymentOptions($currentOrder);
     $countries = $this->get('country.repository')->all();
     $requiredData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('order.form.fieldset.products')]));
     $requiredData->addChild($this->getElement('order_editor', ['name' => 'products', 'label' => $this->trans('order.heading.products'), 'repeat_min' => 1, 'repeat_max' => ElementInterface::INFINITE, 'load_products_route' => 'admin.product.grid', 'on_change' => 'OnProductListChange', 'on_before_change' => 'OnProductListBeforeChange', 'transformer' => $this->getRepositoryTransformer('order_product_collection', $this->get('order_product.repository'))]));
     $orderDetails = $form->addChild($this->getElement('columns', ['name' => 'orderMethodsDetails', 'label' => $this->trans('order.heading.order_methods_details')]));
     $paymentShippingData = $orderDetails->addChild($this->getElement('nested_fieldset', ['name' => 'methods', 'label' => $this->trans('client.heading.billing_address')]));
     $paymentShippingData->addChild($this->getElement('select', ['name' => 'shippingMethod', 'label' => $this->trans('order.label.shipping_method'), 'options' => $shippingMethods, 'transformer' => $this->getRepositoryTransformer('entity', $this->get('shipping_method.repository'))]));
     $paymentShippingData->addChild($this->getElement('select', ['name' => 'paymentMethod', 'label' => $this->trans('order.label.payment_method'), 'options' => $paymentMethods, 'transformer' => $this->getRepositoryTransformer('entity', $this->get('payment_method.repository'))]));
     $orderTotalData = $orderDetails->addChild($this->getElement('nested_fieldset', ['name' => 'orderTotalData', 'label' => $this->trans('order.heading.order_total')]));
     $orderTotalData->addChild($this->getElement('text_field', ['name' => 'shippingTotal.grossAmount', 'label' => $this->trans('order.label.order_total.shipping')]));
     $contactDetails = $form->addChild($this->getElement('nested_fieldset', ['name' => 'contactDetails', 'label' => $this->trans('order.heading.contact_details')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.firstName', 'label' => $this->trans('client.label.contact_details.first_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.lastName', 'label' => $this->trans('client.label.contact_details.last_name')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.phone', 'label' => $this->trans('client.label.contact_details.phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.secondaryPhone', 'label' => $this->trans('client.label.contact_details.secondary_phone')]));
     $contactDetails->addChild($this->getElement('text_field', ['name' => 'contactDetails.email', 'label' => $this->trans('client.label.contact_details.email')]));
     $addresses = $form->addChild($this->getElement('columns', ['name' => 'addresses', 'label' => $this->trans('order.heading.addresses')]));
     $billingAddress = $addresses->addChild($this->getElement('nested_fieldset', ['name' => 'billingAddress', 'label' => $this->trans('client.heading.billing_address')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.firstName', 'label' => $this->trans('client.label.address.first_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.lastName', 'label' => $this->trans('client.label.address.last_name')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.street', 'label' => $this->trans('client.label.address.street')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.streetNo', 'label' => $this->trans('client.label.address.street_no')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.flatNo', 'label' => $this->trans('client.label.address.flat_no')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.postCode', 'label' => $this->trans('client.label.address.post_code')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.province', 'label' => $this->trans('client.label.address.province')]));
     $billingAddress->addChild($this->getElement('text_field', ['name' => 'billingAddress.city', 'label' => $this->trans('client.label.address.city')]));
     $billingAddress->addChild($this->getElement('select', ['name' => 'billingAddress.country', 'label' => $this->trans('client.label.address.country'), 'options' => $countries]));
     $shippingAddress = $addresses->addChild($this->getElement('nested_fieldset', ['name' => 'shippingAddress', 'label' => $this->trans('client.heading.shipping_address')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.firstName', 'label' => $this->trans('client.label.address.first_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.lastName', 'label' => $this->trans('client.label.address.last_name')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.street', 'label' => $this->trans('client.label.address.street')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.streetNo', 'label' => $this->trans('client.label.address.street_no')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.flatNo', 'label' => $this->trans('client.label.address.flat_no')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.postCode', 'label' => $this->trans('client.label.address.post_code')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.province', 'label' => $this->trans('client.label.address.province')]));
     $shippingAddress->addChild($this->getElement('text_field', ['name' => 'shippingAddress.city', 'label' => $this->trans('client.label.address.city')]));
     $shippingAddress->addChild($this->getElement('select', ['name' => 'shippingAddress.country', 'label' => $this->trans('client.label.address.country'), 'options' => $countries]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #30
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $unitForm)
 {
     $channelRequiredData = $unitForm->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $channelRequiredData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $channelRequiredData->addChild($this->getElement('text_field', ['name' => 'url', 'label' => $this->trans('common.label.url'), 'rules' => [$this->getRule('required')]]));
     $unitForm->addFilter($this->getFilter('no_code'));
     $unitForm->addFilter($this->getFilter('trim'));
     $unitForm->addFilter($this->getFilter('secure'));
 }