<?php
namespace Modules\Admin\KamSalesTargets; 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); $fld = new \App\Form\Input\Autocomplete_User($this->lang['index']['filters']['idKam'], 'filters[idKam]', $fieldsValues['idKam']); $form->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['index']['filters']['year'], 'filters[year]', $fieldsValues['year']); $start = 2020; $end = TODAY_YEAR+2; for ($y=$start; $y<=$end; $y++) { $fld->setPossibleValue($y, $y); } $fld->showDefaultOption(); $form->addElement($fld); $form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing'); $form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters()); return $form; } }