<?php
namespace Modules\Admin\Config\ImportedOrders\Services; class View_Utils_FormFilters extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $fieldsValues = $this->values['listingParams']->getFilters(); $form=\Engine\Form\Filters::create(); $form->setColumns(2); $sysListObj = new \App\EntityList\ImportedOrdersSystems(); $sysListObj->setColumns(['name']); $sysListObj->setOrderBy('extResSys.name', 'ASC'); $systemsList = ['' => '-']; foreach($sysListObj->exportRecords() as $rec) { $systemsList[$rec['id']] = $rec['name']; } natcasesort($systemsList); $systemFld= new \Engine\Form\Input\Select($this->lang['index']['filters']['idSystem'], 'filters[idSystem]', $fieldsValues['idSystem']); $systemFld->setPossibleValues($systemsList); $form->addElement($systemFld); $servicesFld = new \App\Form\Input\Select_Service($this->lang['index']['filters']['idService'], 'filters[idService]', $fieldsValues['idService']); $form->addElement($servicesFld); $serviceCodeFld= new \Engine\Form\Input\Text($this->lang['index']['filters']['externalServiceCode'], 'filters[externalServiceCode]', $fieldsValues['externalServiceCode']); $form->addElement($serviceCodeFld); $form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing'); $form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters()); return $form; } }