/**
  * {@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)
 {
     $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)
 {
     $form->addChild($this->getElement('text_field', ['name' => '_username', 'label' => $this->trans('client.label.username')]));
     $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)
 {
     $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)
 {
     $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)
 {
     $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'));
 }
 /**
  * {@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'));
 }
예제 #9
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'));
 }
 /**
  * {@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'));
 }
예제 #11
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('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.dataset.admin')->getResult('select', [], ['label_column' => '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'));
 }
예제 #12
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' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('select', ['name' => 'folder', 'label' => $this->trans('theme.label.folder'), 'comment' => $this->trans('theme.comment.folder'), 'options' => $this->get('theme.locator')->getThemeFolders()]));
     $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)
 {
     $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->getCurrencyRepository()->getCurrenciesToSelect(), 'default' => $this->getRequestHelper()->getCurrentCurrency()]));
     $requiredData->addChild($this->getElement('checkbox', ['name' => 'enabled', 'label' => $this->trans('common.label.enabled'), 'comment' => $this->trans('currency.comment.enabled')]));
     $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'));
 }
예제 #16
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $unitForm)
 {
     $unitRequiredData = $unitForm->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $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'));
 }
예제 #17
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'));
 }
 /**
  * {@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'));
 }
예제 #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' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('rights_table', ['name' => 'permissions', 'label' => $this->trans('user_group.label.permissions'), 'actions' => $this->getPermissionActions(), 'controllers' => $this->getPermissionTypes(), 'transformer' => $this->getRepositoryTransformer('user_group_permission', $this->get('user_group.repository'))]));
     $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('common.fieldset.general')]));
     $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'), 'rules' => [$this->getRule('required')]]));
     $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')]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'discount', 'label' => $this->trans('common.label.discount'), 'comment' => $this->trans('client.comment.discount'), 'suffix' => '%', 'filters' => [$this->getFilter('comma_to_dot_changer')], 'rules' => [$this->getRule('required')]]));
     $languageData = $requiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('client_group.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
예제 #22
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' => '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'));
 }
예제 #23
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $taxForm)
 {
     $taxRequiredData = $taxForm->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $taxTranslationData = $taxRequiredData->addChild($this->getElement('language_fieldset', ['name' => 'translations', 'label' => $this->trans('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('tax.repository'))]));
     $taxTranslationData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('common.label.name'), 'rules' => [$this->getRule('required')]]));
     $taxRequiredData->addChild($this->getElement('text_field', ['name' => 'value', 'label' => $this->trans('tax.label.value'), 'suffix' => '%', 'rules' => [$this->getRule('required')]]));
     $taxForm->addFilter($this->getFilter('no_code'));
     $taxForm->addFilter($this->getFilter('trim'));
     $taxForm->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'));
 }
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $mainData = $form->addChild($this->getElement('nested_fieldset', ['name' => 'required_data', 'label' => $this->trans('common.fieldset.general')]));
     $mainData->addChild($this->getElement('text_field', ['name' => 'nick', 'label' => $this->trans('product_review.label.nick')]));
     $mainData->addChild($this->getElement('text_field', ['name' => 'rating', 'label' => $this->trans('product_review.label.rating')]));
     $mainData->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'));
 }
예제 #27
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'));
 }
예제 #28
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'));
 }
 /**
  * {@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('common.fieldset.translations'), 'transformer' => $this->getRepositoryTransformer('translation', $this->get('layout_box.repository'))]));
     $languageData->addChild($this->getElement('text_field', ['name' => 'name', 'label' => $this->trans('layout_box.label.name'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('text_field', ['name' => 'identifier', 'label' => $this->trans('layout_box.label.identifier'), 'comment' => $this->trans('layout_box.comment.identifier'), 'rules' => [$this->getRule('required')]]));
     $requiredData->addChild($this->getElement('select', ['name' => 'boxType', 'label' => $this->trans('layout_box.label.box_type')]));
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }