<?php
namespace Modules\Orders\MiceProjects; 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(3); $name = new \Engine\Form\Input\Text($this->lang['index']['filters']['name'], 'filters[name]', $fieldsValues['name']); $form->addElement($name); $type = new \App\Form\Input\Autocomplete_MiceProjectType($this->lang['index']['filters']['type'], 'filters[type]', $fieldsValues['type']['id']); $form->addElement($type); $status = new \Engine\Form\Input\Select($this->lang['index']['filters']['status'], 'filters[status]', $fieldsValues['status']); $status->setPossibleValues([ 'all'=> '-', 'open'=> $this->lang['index']['filters']['status_open'], 'closed'=> $this->lang['index']['filters']['status_closed'], ]); $form->addElement($status); $location = new \App\Form\Input\Autocomplete_CountryCity($this->lang['index']['filters']['location'], 'filters[location]', $fieldsValues['location']); $form->addElement($location); $period = new \Engine\Form\Input\DateInterval($this->lang['index']['filters']['period'], 'filters[period]', $fieldsValues['period']); $form->addElement($period); $corporation = new \App\Form\Input\Autocomplete_Corporate($this->lang['index']['filters']['corporation'], 'filters[corporation]', $fieldsValues['corporation']['id']); $form->addElement($corporation); $responsibleUser = new \App\Form\Input\Autocomplete_User($this->lang['index']['filters']['responsibleUser'], 'filters[responsibleUser]', $fieldsValues['responsibleUser']); $form->addElement($responsibleUser); $projectId = new \Engine\Form\Input\Text($this->lang['index']['filters']['projectId'], 'filters[projectId]', $fieldsValues['projectId']); $form->addElement($projectId); $projectCode = new \Engine\Form\Input\Text($this->lang['index']['filters']['projectCode'], 'filters[projectCode]', $fieldsValues['projectCode']); $form->addElement($projectCode); $form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing'); $form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters()); return $form; } }