<?php
 namespace Modules\Admin\Config\ClientInvoices\TotalRounding; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $_LANG = \App\Loader_Lang::getInstance()->getAll(); $form = \Engine\Form\General::create(); $label = new \Engine\Form\Input\Label(); $label->setDetails($this->lang['index']['description']); $form->addElement($label); $fieldsetActive = \Engine\Form\Container\Fieldset::create($this->lang['legends']['active']); $form->addContainer($fieldsetActive); $fld = new \Engine\Form\Input\Radio($this->lang['content']['activeOpt'], 'active', $this->values['active']); $fld->setPossibleValues(['0' => $_LANG['no'], '1' => $_LANG['yes']]); $fieldsetActive->addElement($fld); $fieldsetRound = \Engine\Form\Container\Fieldset::create($this->lang['legends']['rounding']); $form->addContainer($fieldsetRound); $possibleValuesOfRoundType = [ 'round' => $this->lang['roundTypes']['round'], 'floor' => $this->lang['roundTypes']['floor'], 'ceil' => $this->lang['roundTypes']['ceil'] ]; $radioRoundType = new \Engine\Form\Input\Radio($this->lang['formDefinitions']['formFields']['roundType'], 'roundType', $this->values['roundType'], $possibleValuesOfRoundType); $radioRoundType->setTooltip($this->lang['explanations']['roundingType']); $radioRoundType->setMandatory(); $fieldsetRound->addElement($radioRoundType); $fieldsetService = \Engine\Form\Container\Fieldset::create($this->lang['legends']['blockedServices']); $form->addContainer($fieldsetService); foreach (\App\Config\Services_Basic::getInstance()->getListLinear() as $serviceCode => $serviceDetails) { $possibleValuesOfServices[$serviceCode] = $serviceDetails['name']; } $checkboxesService = new \Engine\Form\Input\Checkboxes($this->lang['content']['serviceCantRound'], 'blockedServices', $this->values['blockedServices'], $possibleValuesOfServices); $checkboxesService->setTooltip($this->lang['explanations']['blockedServices']); $checkboxesService->setStyle('renderMode', 'aligned'); $fieldsetService->addElement($checkboxesService); $fieldsetCurrency = \Engine\Form\Container\Fieldset::create($this->lang['legends']['currencies']); $form->addContainer($fieldsetCurrency); foreach (\App\Config\Currencies::getInstance()->getSimple() as $currencyCode) { $possibleValuesOfCurrecies[$currencyCode] = $currencyCode; } $checkboxesCurrency = new \Engine\Form\Input\Checkboxes($this->lang['content']['currencyDefaultRounded'], 'defaultByCurrency', $this->values['defaultByCurrency'], $possibleValuesOfCurrecies); $checkboxesCurrency->setTooltip($this->lang['explanations']['currencies']); $fieldsetCurrency->addElement($checkboxesCurrency); $form->addElement(new \Engine\Form\Input\Hidden(null, 'save', 1)); $form->addButton(new \Engine\Form\Button\Submit('save')); return $form; } }