<?php
namespace Modules\Admin\Config\ServiceClassCodeRules; class View_Utils_FormFilters extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $CFG = \Engine\Loader_Cfg::getInstance()->getGlobal(); $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); $fieldsValues = $this->values['listingParams']->getFilters(); $form=\Engine\Form\Filters::create(); $form->setColumns(3); $nameFld=new \Engine\Form\Input\Text($this->lang['index']['filters']['classCode'], 'filters[classCode]', $fieldsValues['classCode']); $form->addElement($nameFld); $codeFld = new \App\Form\Input\Autocomplete_Supplier($this->lang['index']['filters']['supplierCode'], 'filters[supplierCode]', $fieldsValues['supplierCode']); $form->addElement($codeFld); $classNameFld = new \Engine\Form\Input\Select($this->lang['index']['filters']['className'], 'filters[className]', $fieldsValues['className']); $values = []; foreach ($CFG['travel']['transportSegmentClassNames'] as $transportKey) { $values[$transportKey] = $_LANG['flightClass'][$transportKey]; } $classNameFld->setPossibleValues( $values ); $classNameFld->showDefaultOption(); $classNameFld->setDefaultOptionText("-"); $form->addElement($classNameFld); $form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing'); $form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters()); return $form; } }