<?php
namespace Modules\Admin\Config\Services\AgencyCostCenters;

class View_Utils_FormFilters extends \App\Mvc\View_Utils_FormAbstract
{

	/**
	 * Creates the form for department insert/update.
	 * @see \App\Mvc\View_Utils_FormAbstract::getForm()
	 */
	public function getForm()
	{
		$fieldsValues = $this->values['listingParams']->getFilters();

		$form=\Engine\Form\Filters::create();
		$form->setColumns(2);

		// cost center name filter
		$costCenter=new \Engine\Form\Input\Text($this->lang['index']['filters']['costCenter'], 'filters[costCenter]', $fieldsValues['costCenter']);
		$form->addElement($costCenter);

		// cost center code filter
		$costCenterCode=new \Engine\Form\Input\Text($this->lang['index']['filters']['costCenterCode'], 'filters[costCenterCode]', $fieldsValues['costCenterCode']);
		$form->addElement($costCenterCode);

		$form->setJsCallback('MVC.listing.installedHandlers["listing"].reloadAndResetListing');
		$form->loadMissingDefaultValues($this->values['listingParams']->getDefaultFilters());
		return $form;
	}

}